You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a Cypress test which uses soft assertions in headless mode, any error messages logged are badly formatted. They are missing the intended new lines between each error logged.
Temporarily edit src/data/faq.json and introduce several errors such as removing target='_blank' from two links.
In one terminal windows execute npm start
Once the localhost website is shown in a browser, open a second terminal window and execute npx cypress run -s 'cypress/e2e/faq_link_attr.cy.js'
A badly formatted message such as
1 failing
1) Check attributes of FAQ links
Check links are using _blank to open in new frame
Test links for _blank presence:
Error: tnAssertionError: http://localhost:8000/en/faq/results/#risk_encounter_no_warning in /en/faq/results/: expected '<a>' to have attribute 'target'nAssertionError: http://localhost:8000/en/faq/results/#risk_encounter_different_devices in /en/faq/results/: expected '<a>' to have attribute 'target'
at Context.eval (webpack:///./cypress/support/e2e.js:88:18)
will be displayed. The "t" is supposed to be a tab and the "n" is supposed to be a new line. There is no new line separating the individual errors so the output is very hard to read.
Where to find the issue
Cypress test suite using soft assertions
Describe the issue
When running a Cypress test which uses soft assertions in headless mode, any error messages logged are badly formatted. They are missing the intended new lines between each error logged.
This is similar to the issue Error in Cypress softAssert error message format #3040 reported for headed mode.
Steps to reproduce
Temporarily edit
src/data/faq.json
and introduce several errors such as removingtarget='_blank'
from two links.In one terminal windows execute
npm start
Once the localhost website is shown in a browser, open a second terminal window and execute
npx cypress run -s 'cypress/e2e/faq_link_attr.cy.js'
A badly formatted message such as
will be displayed. The "t" is supposed to be a tab and the "n" is supposed to be a new line. There is no new line separating the individual errors so the output is very hard to read.
Suggestion
Correct the message format in
cwa-website/cypress/support/e2e.js
Lines 82 to 86 in 8f71437
n
should be\n
for new linet
should be\t
for tab(See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences.)
Internal Tracking ID: EXPOSUREAPP-14291
The text was updated successfully, but these errors were encountered: