2 const assert
= require( 'assert' ),
3 CreateAccountPage
= require( '../pageobjects/createaccount.page' ),
4 UserLoginPage
= require( '../pageobjects/userlogin.page' ),
5 UserLogoutPage
= require( '../pageobjects/userlogout.page' ),
6 PreferencesPage
= require( '../pageobjects/preferences.page' );
8 describe( 'User', function () {
13 beforeEach( function () {
14 username
= `User-${Math.random().toString()}`;
15 password
= Math
.random().toString();
18 it( 'should be able to create account', function () {
21 CreateAccountPage
.createAccount( username
, password
);
24 assert
.equal( CreateAccountPage
.heading
.getText(), `Welcome, ${username}!` );
28 it( 'should be able to log in', function () {
31 CreateAccountPage
.createAccount( username
, password
);
34 UserLogoutPage
.open();
37 UserLoginPage
.login( username
, password
);
40 assert
.equal( UserLoginPage
.userPage
.getText(), username
);
44 it( 'should be able to change preferences', function () {
46 var realName
= Math
.random().toString();
49 CreateAccountPage
.createAccount( username
, password
);
52 PreferencesPage
.changeRealName( realName
);
55 assert
.equal( PreferencesPage
.realName
.getValue(), realName
);