Description
Frontend is still consolidating and a lot of big changes are being done. It seems it's no the best time to prepare any test here. But, when consolidation finishes, we should create a solid web test suite that allows us to test all the functionality of MPIC while we keep working on the frontend side.
I have been exploring cypress as a framework to create end-to-end web tests. It seems that creating these tests with this library is not a lot of work and the time we can save is huge. There would be a bit of extra work if we want to prepare the frontend to be more testable ("tagging" properly web componentes somehow to identify them while coding the test cases, for example) but it's worth it.
There are already a couple of test cases working at https://gitlab.wikimedia.org/repos/data-engineering/mpic/-/tree/integration-tests?ref_type=heads (integration-tests branch that is WIP). Web tests can be run with `npx cypress run --spec cypress/e2e/mpic.cy.js'
Acceptance Criteria
-
We agree 'cypress' is the proper framework to use for web testing (of course this discussion is open to other frameworks)<< Per T368612#10069663 and discussions with QTE, we opted to go with WebdriverIO - We have, at least, test cases for all the positive scenarios:
- Instruments are listed properly
- Register a new instrument
- Modify an existing instrument
- View an instrument
- Delete an instrument
Notes
- Cypress library: https://github.com/cypress-io/cypress
- Sample e2e test case already working for MPIC (it modifies the description of an instrument): https://gitlab.wikimedia.org/repos/data-engineering/mpic/-/blob/integration-tests/cypress/e2e/mpic.cy.js?ref_type=heads