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

PP-10627 add agreement details page cy test #4038

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

SandorArpa
Copy link
Contributor

WHAT

  • add a new test that checks the rendering of the agreement details page in specifics

@SandorArpa SandorArpa force-pushed the PP-10627-add_agreement_details_page_cy_test branch 2 times, most recently from a90f4de to e6c52dd Compare July 11, 2023 13:30
@SandorArpa SandorArpa marked this pull request as ready for review July 11, 2023 14:01

cy.get('.govuk-heading-l').should('have.text', 'Agreement detail')

cy.get('.govuk-summary-list__value').contains('Test User')
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not clear which .govuk-summary-list__value this is checking, which might make it difficult to debug if it starts failiing.

To be more deliberate about which elements we are checking the contents of, we could add a data-cy attribute on the elements in the Nunjucks and use that in the test to get the element we're checking.

See: https://pay-team-manual.cloudapps.digital/manual/how-to/write-cypress-tests.html#select-elements-with-the-data-cy-attribute

Also, are we checking all the attributes on the agreement are displayed as expected? Id, reference, status etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@SandorArpa SandorArpa force-pushed the PP-10627-add_agreement_details_page_cy_test branch 3 times, most recently from 12e6f6b to b02f026 Compare July 12, 2023 16:17

cy.get('.govuk-heading-l').should('have.text', 'Agreement detail')

cy.get('[data-cy=agreement-detail]').get('h2').contains('Payment instrument')
Copy link
Contributor

Choose a reason for hiding this comment

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

This assertion is ever so slightly confusing as we're also asserting on the "Payment instrument" title further down when we have assertions for the payment instrument section. It makes it seem like the assertions below this might be looking at the payment instrument section.

Maybe we can remove this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -57,7 +57,7 @@ describe('Agreements', () => {
cy.setEncryptedCookies(userExternalId)
})

it('should correctly display agreements for a given service', () => {
it.only('should correctly display agreements for a given service', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

.only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦

- add a new test that checks the rendering of the agreement details page in specifics
@SandorArpa SandorArpa force-pushed the PP-10627-add_agreement_details_page_cy_test branch from b02f026 to d9a0549 Compare July 13, 2023 08:39
Copy link
Contributor

@stephencdaly stephencdaly left a comment

Choose a reason for hiding this comment

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

LGTM!

@SandorArpa SandorArpa merged commit 296c97c into master Jul 13, 2023
5 checks passed
@SandorArpa SandorArpa deleted the PP-10627-add_agreement_details_page_cy_test branch July 13, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants