cypress-io / testing-workshop-cypress

End-to-end testing workshop with Cypress
https://testing-workshop-cypress.netlify.app/
479 stars 190 forks source link

Full day Cypress workshop ideas #22

Open bahmutov opened 5 years ago

bahmutov commented 5 years ago

first half - same as before

second half - new content

euZebe commented 5 years ago

Quite off topic, but I think it could be great to make tests fail by default, rather than having them pass even when not touching a single line.

Furthermore, considering I know how to use Cypress after almost a day of workshop, I would be pleased to find some test strategy advice (even if it may vary a lot from one projet to another).

bahmutov commented 5 years ago

@euZebe you mean the exercises in this current workshop have tests that pass by default? And that is bad? I see, although most of the tests are empty and have comments "do this A, do thing B".

under the test strategy advice, what do you mean? Which features to test? Or the breakdown between unit tests and e2e tests and when to write each type of test? I do have some content to put for this topic for sure.

euZebe commented 5 years ago

@bahmutov other languages' tutorials and exercices often fail, so that you clearly see that something is missing ; here is an example with Kotlin koans. I didn't think about how to make something similar, but I find it more TDD. I would be glad to help however.

About test strategy advices, I mean you can know how to write a unit test (technically speaking), if you don't know what to test, you're missing the point. It's the same with cypress and e2e tests. Here are a few examples I think about right now:

Of course some of these points may be listed in the best practices, but I see that as a good reminder before finishing the workshop.

bahmutov commented 5 years ago

great notes @euZebe I appreciate the feedback, and yes, these are good questions. I think using good selectors is a good subtopic. Testing feature X only once goes really well into the "App actions" section (read the blog post, if you haven't already).

I would be interested if you make a pull request with a few tests in https://github.com/cypress-io/testing-workshop-cypress/blob/master/cypress/integration/05-xhr/spec.js#L59 changed to fail. Would you replace all comments with commands without arguments?