I've encountered an unusual problem that I need help describing and solving.
Your assistance is greatly appreciated!
The issue I'm facing involves Testcafe behaving differently when running the same test script on various browsers.
testcafe: 0.23.1
firefox: 63.0.1
chrome: 70.0.3538.102
typescript: 3.1.6
This is a snippet of the Typescript code from the executed test script:
(Code snippet with imports, fixtures, and tests)
I write my code in VisualStudio Code and execute the test in Firefox using the command: -e
testcafe firefox .\stackoverflow.ts -e
Question 1:
The exact same test script runs successfully in
Firefox
: passes without issues
Chrome
: fails with the error message provided below:
Error message displayed after the failed Chrome test execution
To rectify this error, I had to implement the following workaround:
.click(genderSelect).click(genderSelect)
After applying this workaround, the test script now passes in Chrome as well. What could be causing this discrepancy between browser behaviors?
Question 2: Despite implementing the above-mentioned workaround involving double clicks, executing the test script in Chrome presents a new challenge:
The message indicating successful test completion while not all code lines are executed
Although the radio button I intended to click remains unpressed visually, the test still passes successfully. As a temporary solution, I resorted to repeating the click action for assurance:
.click(buildingTypeRadioInput).click(buildingTypeRadioInput)
Why does the test return a pass result even when not all code lines are executed as expected?