Issue
I have a few questions regarding angular (with a PHP Laravel backend) e2e testing with cypress.
- In my company we have the idea to have our cypress e2e tests in an extra repository so all people (backend, QA) could also write and edit tests. I am not sure if that's such a good idea, because it feels odd to have the test not at the source code. But on the other hand, e2e also tests the backend, so it isn’t next to the source anyway. What are the best practices for Angular here? We have no staff for testing. Just front/backend developers and QA people who don’t write tests currently.
- Is it a good Idea to have the exact same tests for e2e and integration? In my opinion, these are two different test sets and I shouldn’t just use the e2e tests with mock data to have my integration testing.
Thanks in Advance!
Solution
1
I would separate e2e tests from the actual code. Component testing goes inside the same repository. But e2e tests should be on its own if it's somewhat serious.You can use this cypress boilerplate. It's perfect for multiple teams, since it's configured in a way to separate commands from each team so there can't be no overriding command names. Make sure to read the documentation(5-10min).
To quickly get started with the QA, backend team approach:
$ npx @optimumqa/cypress-boilerplate my-cypress-project
$ cd my-cypress-project
$ npm install
$ npm run add-project
# Project name: website1
# Team name: qa
# baseUrl: http://www.website1.com
$ npm run qa-website1-staging
After, you can add another project with the same name but for another team, in your case, backend.
support/e2e/commands.ts
- Shared commandssupport/e2e/qa/website1/commands.ts
- qa commands for this projectsupport/e2e/backend/website1/commands.ts
- backend commands for this project
Answered By - Darko Riđić
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.