Should the folder structure for e2e test cases in Protractor be the same as that of the application?
Jasmine is a testing library the provides all the assertion and utility functions needed to write unit and E2E tests. Let's take a look at a simple example of an E2E test. In our Angular CLI project we have a folder named e2e . This is where our e2e tests are kept.
This depends on the folder structure of your application :-).
To use Protractor effectively you need:
The page objects likely correspond to Angular elements such as templates, so you might follow a similar folder structure.
The actual test cases navigating through the states are closer to user stories. If you use a structured story format, you might organize scenarios into narratives ("As a ... I want ... so that ...") which then come with a number of acceptance scenarios ("Given ... when ... then") grouped together.
If you want to learn more about setting up Protractor tests using state machines, you can have a look at my blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With