Merge "Do not require titles on Special:ComparePages"
[lhc/web/wiklou.git] / tests / selenium / specs / page.js
index a1fd480..069a6aa 100644 (file)
@@ -10,8 +10,8 @@ describe( 'Page', function () {
        var content,
                name;
 
-       function getTestString() {
-               return Math.random().toString() + '-öäü-♠♣♥♦';
+       function getTestString( suffix = 'defaultsuffix' ) {
+               return Math.random().toString() + '-Iñtërnâtiônàlizætiøn☃-' + suffix;
        }
 
        before( function () {
@@ -22,8 +22,8 @@ describe( 'Page', function () {
 
        beforeEach( function () {
                browser.deleteCookie();
-               content = getTestString();
-               name = getTestString();
+               content = getTestString( 'beforeEach-content' );
+               name = getTestString( 'beforeEach-name' );
        } );
 
        it( 'should be creatable', function () {
@@ -31,12 +31,12 @@ 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 () {
-               let initialContent = getTestString();
+               let initialContent = getTestString( 'initialContent' );
 
                // create
                browser.call( 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 () {
@@ -63,11 +63,12 @@ describe( 'Page', function () {
                } );
 
                // edit
-               EditPage.edit( name, content );
+               let editContent = getTestString( 'editContent' );
+               EditPage.edit( name, editContent );
 
                // check
-               assert.equal( EditPage.heading.getText(), name );
-               assert.equal( EditPage.displayedContent.getText(), content );
+               assert.strictEqual( EditPage.heading.getText(), name );
+               assert.strictEqual( EditPage.displayedContent.getText(), editContent );
        } );
 
        it( 'should have history', function () {
@@ -78,7 +79,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 +95,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 +119,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.' );
        } );
 } );