Merge "ApiCSPReport: Log user ID instead of name, and limit urls to origin"
[lhc/web/wiklou.git] / tests / selenium / specs / user.js
index 4d22645..d55ff4c 100644 (file)
@@ -2,7 +2,8 @@ const assert = require( 'assert' ),
        CreateAccountPage = require( '../pageobjects/createaccount.page' ),
        PreferencesPage = require( '../pageobjects/preferences.page' ),
        UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
-       Api = require( 'wdio-mediawiki/Api' );
+       Api = require( 'wdio-mediawiki/Api' ),
+       Util = require( 'wdio-mediawiki/Util' );
 
 describe( 'User', function () {
        var password,
@@ -16,8 +17,8 @@ describe( 'User', function () {
 
        beforeEach( function () {
                browser.deleteCookie();
-               username = `User-${Math.random().toString()}`;
-               password = Math.random().toString();
+               username = Util.getTestString( 'User-' );
+               password = Util.getTestString();
        } );
 
        it( 'should be able to create account', function () {
@@ -28,7 +29,7 @@ describe( 'User', function () {
                assert.strictEqual( CreateAccountPage.heading.getText(), `Welcome, ${username}!` );
        } );
 
-       it( 'should be able to log in', function () {
+       it( 'should be able to log in @daily', function () {
                // create
                browser.call( function () {
                        return Api.createAccount( username, password );
@@ -41,8 +42,9 @@ describe( 'User', function () {
                assert.strictEqual( UserLoginPage.userPage.getText(), username );
        } );
 
-       it( 'should be able to change preferences', function () {
-               var realName = Math.random().toString();
+       // Disabled due to flakiness (T199446)
+       it.skip( 'should be able to change preferences', function () {
+               var realName = Util.getTestString();
 
                // create
                browser.call( function () {