Testing in specific order

Nightwatch runs test files in alphabetical order. The first one in the frontend/tests/e2e/specs directory will be executed first. We can change the filename of the tests to list them in the order that is required, as follows:

specs/
0.register.e2e.js
1.login.e2e.js

In this way, registration will always happen first and then login. In future, we can add other test files after 1.login.e2e.js, such as 2.home.e2e.js. In this way, we will start the whole end-to-end test by registering a new user, and then logging in with that user to the application, followed by other operations that we will build later. As you can see, we have skipped a lot of details of the end-to-end test because of the scope of this book. In future chapters, we will only mention the commit record of the end-to-end test and will not discuss them unless it is necessary.

As usual, let's run the mvn clean install command and then commit the code once the build is successful. Here is the commit record:

Figure 10.21: Implement end-to-end tests for login and register commit
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.137.67