E2E Tests Notes Part 1 & 2
What do we want to achieve with E2E tests? | Comments |
---|---|
| (AN) - @Philip Wilsdon (Unlicensed) I don’t understand what this means, can you (or someone else) clarify, please? Came from your comment, see 36 seconds in video 1 |
| (AN) - Absolutely |
| (AN) - Smoke tests in Prod |
| (AN) - Absolutely |
| (AN) - Absolutely |
| (AN) - Absolutely |
Should we have validation on every form field to be tested by E2E tests | Comments |
---|---|
No - we should test one of every type of field (e.g. so we are covering whether the mandatory/optional flag on fields is working, and whether validation is working, rather than all fields that are mandatory and all fields that have validation). |
|
Should we have unit tests per field and then a single/small number of E2E tests to verify behaviour when any validation fails is enough | Comments |
---|---|
Unit testing |
|
|
|
|
|
| (AN) - and the work needed is an alteration to the unit test for that field |
|
|
E2E testing |
|
| (AN) - trust the unit tests that the scenarios have been applied correctly to the correct fields |
|
|
|
|
| (AN) - there should not be large-scale replication of what the unit tests are testing |
| (AN) - the ACs for a small initial vertical slice, should reflect only that small initial vertical slice. So unit tests and E2E tests should be relatively simple as a result. As the feature develops, more unit tests will be required and the E2E tests will likely need refactoring. NOTE#1 |
| (AN) - If all 4 fields are optional and have no validation, the user should be able to submit the form with nothing entered, so the E2E test should test just that. This way, if there’s already one field which is mandatory and one field with validation, and another field is added, the E2E test would not need modifying. |
| (AN) - most common reason for E2E test failure is absence of the specific data expected. If this dependency can be removed, E2E tests become much more of a useful tool for the team |
|
|
| (AndyD) - So for TIS Self-service, is there value in creating, refactoring and running E2E tests in advance of users starting to use the app. And even when we have users testing the app, where they will be anticipating issues, how much value is there in putting loads of effort into having written, refactored and run E2E test many multiple times? For TIS, however, this is a ‘live’ system, where we need to protect its integrity as much as possible, so the effort going into E2E tests is much more valuable. |
Other |
|
| (AN) - @Philip Wilsdon (Unlicensed) did we mean “code” here or “E2E” tests? Pretty sure it was code - think this came from shivani - something around making sure codebase in the future is easier to maintain or tests easier to maintain |
| (AN) - so is this something we need to build then? @Andy Dingley / @Joseph (Pepe) Kelly |
|
|
| (AN) - if our environments are secured with logins, and anyone with access to those pre-Prod environments have signed up (contractual small print) to being professional in their handling of data, why do we need to anonymise / obfuscate data? Is that a stupid question? |
NOTE#1 - When building a new feature, consider at which point E2E tests need to be written, with an emphasis on as early as possible. They should be designed to stop bad code going to Production.
Environments | Comments |
---|---|
| (AN) - there’s a bit of a conflict to manage here, I think. Obfuscating data in non-Prod environments, but having an environment for users to run data-reliant testing (e.g. Bulk Upload). |
| (AN) - perhaps we need to spin up and destroy an environment for users to test/play with, on demand? |
How do tests work with our code review process e.g if changes are requested several days after a PR has been reviewed and merged - slows us down? | Comments |
---|---|
| (AN) - @Philip Wilsdon (Unlicensed) Could you clarify the “in newsprint - what happens” - are you asking for how this sort of thing would be handled by a team working with a physical product, or do you mean “in the next Sprint - what happens”? Typo - should be next sprint. I think the question was; if in sprint A, the coding and E2E tests all done and working well. However, in Sprint B, the E2E Test then fails, how do we handle this |
| (AN) - would be good to have some |
| (AN) - we can’t expect a reviewer to match the PR to the AC - it won’t always be obvious which AC a PR is designed to meet. It should be clear which AC an E2E test is designed to meet though. |
| (AndyD) - No. This goes against the CI/CD approach we’re adopting. |
|
|
|
|
|
|
|
|
|
|
|
|
| (AN) - testing is the responsibility of all developers, not just Shivani |
|
|
Other | Comments |
---|---|
|
|
|
|
|
|
|
|
|
|
(AN) NOTE#2 - Question: is this really rough flow part of the issue, or am I getting things really confused here?
| Step1 | Step2 | Step3 | Step4 | Step5 | Step6 |
---|---|---|---|---|---|---|
Current | Dev works on code --> | PR process --> | Code merged to |
| E2E tests run --> | Manual push from |
Ideal? | Dev works on code --> | PR process --> | Code merged to |
| E2E tests run --> |
|
(AN) NOTE#3 - This way Prod
is protected from deployments from master
, unrelated to the initial code going through the pipeline, that may break E2E tests on integration to the wider codebase which would break Prod
. The swapping of Pre-Prod
and Prod
would mean the last version of Prod
would be stored on Pre-Prod
and therefore, presumably revertible?
Slack: https://hee-nhs-tis.slack.com/
Jira issues: https://hee-tis.atlassian.net/issues/?filter=14213