Selenium tests: Use assert.strictEqual instead of assert.equal
authorEd Sanders <esanders@wikimedia.org>
Wed, 6 Jun 2018 10:49:33 +0000 (11:49 +0100)
committerEd Sanders <esanders@wikimedia.org>
Wed, 6 Jun 2018 10:53:29 +0000 (11:53 +0100)
assert.equal is deprecated

Change-Id: I2f83d596db2ad475de5e005baa849782261d433e

tests/selenium/specs/page.js
tests/selenium/specs/user.js
tests/selenium/wdio-mediawiki/specs/BlankPage.js

index a1fd480..dfc6fa1 100644 (file)
@@ -31,8 +31,8 @@ describe( 'Page', function () {
                EditPage.edit( name, content );
 
                // check
-               assert.equal( EditPage.heading.getText(), name );
-               assert.equal( EditPage.displayedContent.getText(), content );
+               assert.strictEqual( EditPage.heading.getText(), name );
+               assert.strictEqual( EditPage.displayedContent.getText(), content );
        } );
 
        it( 'should be re-creatable', function () {
@@ -52,8 +52,8 @@ describe( 'Page', function () {
                EditPage.edit( name, content );
 
                // check
-               assert.equal( EditPage.heading.getText(), name );
-               assert.equal( EditPage.displayedContent.getText(), content );
+               assert.strictEqual( EditPage.heading.getText(), name );
+               assert.strictEqual( EditPage.displayedContent.getText(), content );
        } );
 
        it( 'should be editable', function () {
@@ -66,8 +66,8 @@ describe( 'Page', function () {
                EditPage.edit( name, content );
 
                // check
-               assert.equal( EditPage.heading.getText(), name );
-               assert.equal( EditPage.displayedContent.getText(), content );
+               assert.strictEqual( EditPage.heading.getText(), name );
+               assert.strictEqual( EditPage.displayedContent.getText(), content );
        } );
 
        it( 'should have history', function () {
@@ -78,7 +78,7 @@ describe( 'Page', function () {
 
                // check
                HistoryPage.open( name );
-               assert.equal( HistoryPage.comment.getText(), `(Created page with "${content}")` );
+               assert.strictEqual( HistoryPage.comment.getText(), `(Created page with "${content}")` );
        } );
 
        it( 'should be deletable', function () {
@@ -94,7 +94,7 @@ describe( 'Page', function () {
                DeletePage.delete( name, content + '-deletereason' );
 
                // check
-               assert.equal(
+               assert.strictEqual(
                        DeletePage.displayedContent.getText(),
                        '"' + name + '" has been deleted. See deletion log for a record of recent deletions.\nReturn to Main Page.'
                );
@@ -118,6 +118,6 @@ describe( 'Page', function () {
                RestorePage.restore( name, content + '-restorereason' );
 
                // check
-               assert.equal( RestorePage.displayedContent.getText(), name + ' has been restored\nConsult the deletion log for a record of recent deletions and restorations.' );
+               assert.strictEqual( RestorePage.displayedContent.getText(), name + ' has been restored\nConsult the deletion log for a record of recent deletions and restorations.' );
        } );
 } );
index 10bf05d..4d22645 100644 (file)
@@ -25,7 +25,7 @@ describe( 'User', function () {
                CreateAccountPage.createAccount( username, password );
 
                // check
-               assert.equal( CreateAccountPage.heading.getText(), `Welcome, ${username}!` );
+               assert.strictEqual( CreateAccountPage.heading.getText(), `Welcome, ${username}!` );
        } );
 
        it( 'should be able to log in', function () {
@@ -38,7 +38,7 @@ describe( 'User', function () {
                UserLoginPage.login( username, password );
 
                // check
-               assert.equal( UserLoginPage.userPage.getText(), username );
+               assert.strictEqual( UserLoginPage.userPage.getText(), username );
        } );
 
        it( 'should be able to change preferences', function () {
@@ -56,6 +56,6 @@ describe( 'User', function () {
                PreferencesPage.changeRealName( realName );
 
                // check
-               assert.equal( PreferencesPage.realName.getValue(), realName );
+               assert.strictEqual( PreferencesPage.realName.getValue(), realName );
        } );
 } );
index f84ae90..8cb46d4 100644 (file)
@@ -6,6 +6,6 @@ describe( 'BlankPage', function () {
                BlankPage.open();
 
                // check
-               assert.equal( BlankPage.heading.getText(), 'Blank page' );
+               assert.strictEqual( BlankPage.heading.getText(), 'Blank page' );
        } );
 } );