-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix and improve acceptance testing attributes #665
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://eaflood.atlassian.net/browse/WATER-4336 In WATER-4070 we logged that the Billing & Data team were struggling because they could not access the larger bill runs. The service would appear to be busy for a while and then eventually error. We were able to figure out it was simply that the service was not able to return all the data needed using the current design, which listed out all the transactions in a bill run. We also knew the data could be collected in a more performant way. So, we ended up rebuilding the whole journey of viewing a bill run, the bills in it and the transaction details. This also gave us the opportunity to add attributes to elements likely to be referenced in our acceptance tests. A [recognised best practice in selecting elements in tests](https://docs.cypress.io/guides/references/best-practices#Selecting-Elements) is to avoid brittle, complex selectors and to use `data-*` attributes instead. > For reference we have opted for `data-test` as our convention The legacy pages had none of this, and often didn't even bother with ID's. This means a common battle with the acceptance tests we inherited is finding suitable selectors for the elements we needed. We now need to [update those tests we broke](DEFRA/water-abstraction-acceptance-tests#78) because of our new pages. Doing this has allowed us to spot a few places where we've made mistakes and others where `data-test` would help. This change is us making those tweaks to the billing templates.
Cruikshanks
requested review from
Demwunz,
robertparkinson,
Jozzey and
Beckyrose200
January 18, 2024 08:33
robertparkinson
approved these changes
Jan 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4336
In WATER-4070 we logged that the Billing & Data team struggled because they could not access the larger bill runs. The service would appear to be busy for a while and then eventually error.
We figured out it was simply that the service could not return all the data needed using the current design, which listed out all the transactions in a bill run. We also knew the data could be collected in a more performant way.
So, we ended up rebuilding the whole journey of viewing a bill run, the bills in it and the transaction details.
This also allowed us to add attributes to elements likely referenced in our acceptance tests. A recognised best practice in selecting elements in tests is to avoid brittle, complex selectors and to use
data-*
attributes instead.The legacy pages had none of this, and often didn't even bother with IDs. This means a common battle with the acceptance tests we inherited is finding suitable selectors for the elements we needed.
We now need to update those tests we broke because of our new pages. Doing this has allowed us to spot a few places where we've made mistakes and others where
data-test
would help. This change is us making those tweaks to the billing templates.