Open genosis opened 1 year ago
Thank you for submitting this issue. Since you are using an outdated version of TestCafe, we recommend you update TestCafe to the latest version to check if this issue has been addressed. We constantly improve our tools, and there is a chance that this issue has been already resolved and/or is no longer reproducible in the latest version. We look forward to your response.
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)
<!DOCTYPE html>
~ 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...