Writing the test project log in tests
As we discussed in Chapter 1, Why TestCafe, we will need a test user to log in to the portal and perform any further tests. So, let's start with creating a new user with an email address – test_user_testcafe_poc{randomDigits}@sharklasers.com
– and password – test_user_testcafe_poc
.
Let's declare the following test to register a new user in basic-tests.js
:
const { Selector } = require('testcafe');fixture('Redmine log in tests') .page('http://demo.redmine.org/');test('Create a new user', async (t) => {
The test will perform the following actions:
- The test clicks on the Register link:
await t.click('.register')
- The test fills in the Login field:
.typeText('#user_login','test_user_testcafe_poc1234@sharklasers.com')
- The test fills...