Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Cypress message formatting for softAssert in headless mode #3201

Merged
merged 1 commit into from
Nov 7, 2022
Merged

Correct Cypress message formatting for softAssert in headless mode #3201

merged 1 commit into from
Nov 7, 2022

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Nov 4, 2022

This PR resolves issue #3200 "Bad formatting in Cypress soft assertions headless error messages"

It corrects the tab and new line formatting characters in cypress/support/e2e.js used in headless mode.

Verification

Temporarily edit src/data/faq.json and introduce several errors such as removing target='_blank' from two links.

In one terminal execute
npm start

Once the localhost website is shown in a browser open a second terminal and execute
npx cypress run -s 'cypress/e2e/faq_link_attr.cy.js'

Check that the error message looks correctly formatted with each error starting on a separate line 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:
        AssertionError: http://localhost:8000/en/faq/results/#risk_encounter_no_warning in /en/faq/results/: expected '<a>' to have attribute 'target'
        AssertionError: 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)


Internal Tracking ID: EXPOSUREAPP-14291

Copy link
Member

@larswmh larswmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your bringing up this issue and providing a PR @MikeMcC399!

@thomasaugsten thomasaugsten merged commit 97fff5e into corona-warn-app:master Nov 7, 2022
@MikeMcC399 MikeMcC399 deleted the fix/cypress-error-format branch November 7, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad formatting in Cypress soft assertions headless error messages
4 participants