Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Running a basic test for TestCafe seems to run indefinitely displaying a spinning set of green dots

Đang mở
#231 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, macos

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện tình trạng treo với firstTest.js bằng lệnh TestCafe 1.19.0 đã được báo cáo trên macOS Ventura và bộ xử lý M1. Đọc issue #221 của browser-tools được liên kết và so sánh hành vi của NativeBinaryHasFailedError với cổng 1337; hoàn thành nghĩa là xác định được nguyên nhân có thể tái hiện hoặc một quy trình khắc phục sự cố đã được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

OS: MacOS STATE: Need clarification

Currently, I am trying to run a basic sample test to confirm TestCafe is configured and working properly. However, upon running the test from the command line it responds with a set of 3 green dots animated to run in a circle like a loading or hourglass prompt to indicate it is running. The problem is it seems to run indefinitely as I have waiting for 20 minutes or longer to be sure it wasn't just running slow. The only way to recover is to find the process in another window and kill it to free up Port 1337 that it is running on. I have added a console.log statement to troubleshoot but nothing is output, and I have tried to enable logging but have not found a way to do this thus far.

Some other details and background...
My main goal is to run TestCafe as the testing framework used by GT-UI (Guidewire Testing Framework - which uses TestCafe for it's automation).
I am running on MacOS Ventura 13.3.1 with the M1 processor currently.
I was previously running GT-UI and TestCafe without issue on my old Intel based Mac, however, after upgrading to a new Mac with the M1 processor I ran into issues as noted below...

Initially I ran into this error while attempting to run GT-UI tests via TestCafe:
ERROR NativeBinaryHasFailedError: The find-window process failed with the 1 exit code.

After some research I found an article mentioning a new version of TestCafe would resolve some issues with the M1 processor:
https://testcafe.io/403664/release-notes/framework/2021-12-22-testcafe-v1-18-0-released#upgrade-instructions

I upgraded to TestCafe version 1.19.0 (which I am currently on) followed all the steps in that article yet the error persisted.

After more troubleshooting and research I came across this article on that error:
https://github.com/DevExpress/testcafe-browser-tools/issues/221

I performed the steps referenced there (some duplicated from the previous article) and the 'chmod +x' command seemed to change the behavior I was seeing. Now, instead of the 'NativeBinaryHasFailed' error being seen, now the test (running from GT-UI) seems to 'hang' much sooner in the process and no longer produces any error at all. The only way to recover is to find the process running on port 1337 and kill it...

At this point I had started working with Guidewire Support on this issue, however, they just directed me to try and run a test directly from TestCafe to rule out GT-UI having an issue.

So, at this point, I added a few simple sample tests (detailed below) to run directly via TestCafe from the command line as a troubleshooting step.

This is where the original problem noted above comes in....
Currently, when I attempt to run either of the sample tests directly from TestCafe from the command line I am getting the reply of the 3 green dots animated to run in a circle indicating the test is running. However, as stated above, this process seems to run indefinitely with no output or logging that I can find to get more info on what is going on.

Upon reporting this to Guidewire Support they mentioned that the Test 'hanging' when running directly from TestCafe or when running via GT-UI are a TestCafe issue and not a GT-UI issue and they recommended I file a support case with TestCafe, and here I am...

I would like to get some assistance with throubleshooting the hanging tests via initiating logging or debugging or some other method to get more details on exactly what is going on and why the test is hanging in order to resolve the issue.

Please let me know what can be done to further troubleshoot this issue...

Below are some supporting details:

~ Test 1 - firstTest.js (this is a test taken directly from the TestCafe getting started page)

import { Selector } from 'testcafe';

fixture('Getting Started')
.page('https://devexpress.github.io/testcafe/example');

test('My first test', async t => {
await t
.typeText('#developer-name', 'John Smith')
.click('#submit-button')
.expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');
console.log("Test is running.........");
});

~ Test 2 - firstPageOpenTest.js (test taken from testcafe examples from repo: https://github.com/DevExpress/testcafe-examples/blob/master/examples/check-if-opened-with-testcafe/index.html)

import { Selector } from 'testcafe';

fixture Check to ensure that the page was opened with TestCafe
.page('./openPageTest.html');

test('Check to ensure that the page was opened with TestCafe', async t => {
console.log("Page Open test is running....");
await t.expect(Selector('#main').innerText).eql('The page was opened with TestCafe: yes');
});

~ Test 2 - related HTML file - (from same examples repo noted above)

<title>Check to ensure that the page was opened with TestCafe</title> The page was opened with TestCafe: <script> const resultSpan = document.getElementById('result'); const isInTestCafe = !!window['%testCafeDriverInstance%'];
resultSpan.textContent = isInTestCafe ? 'yes' : 'no';
</script>

~ Console output when attempting to run a test:

(py310) p@APL gt-ui (user/p/gw-releases-flaine) $ testcafe --version
1.19.0
(py310) p@APL gt-ui (user/p/gw-releases-flaine) $ testcafe -b
firefox
chrome
safari
(py310) p@APL gt-ui (user/p/gw-releases-flaine) $ testcafe firstTest.js
⠏

Please let me know of anything further I can provide to push this issue forward...

Ngôn ngữ chính
C++
Star
30
Fork
32
Merge trung bình
32 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DevExpress/testcafe-browser-tools

Tất cả issue của DevExpress/testcafe-browser-tools

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.