Adding verifications to the test project
Normally, each test should perform some actions and then check the result. As we already know from Chapter 2, Exploring TestCafe Under the hood, TestCafe provides us with t.expect
method to perform the assertions and verify the results of each test. So, let's add corresponding assertions to finalize user creation and log in tests.
Adding assertion for the user creation test
So, the expected result for the user creation test is the Your account has been activated. You can now log in. notification, which should be displayed:
const { Selector } = require('testcafe');const { stamp } = require('js-automation-tools');const randomDigits = stamp.getTimestamp();fixture('Redmine log in tests')Â Â Â Â .page('http://demo.redmine.org/');test('Create a new user', async (t) => {Â Â Â Â await t.click('.register');Â Â Â Â Â Â ...