Disable flaky Selenium test
[lhc/web/wiklou.git] / tests / selenium / specs / rollback.js
index daf7112..086f09e 100644 (file)
@@ -1,18 +1,13 @@
-const assert = require( 'assert' ),
-       BlankPage = require( 'wdio-mediawiki/BlankPage' ),
-       HistoryPage = require( '../pageobjects/history.page' ),
-       UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
-       Util = require( 'wdio-mediawiki/Util' );
+const assert = require( 'assert' );
+const HistoryPage = require( '../pageobjects/history.page' );
+const UserLoginPage = require( 'wdio-mediawiki/LoginPage' );
+const Util = require( 'wdio-mediawiki/Util' );
 
 describe( 'Rollback with confirmation', function () {
-       var content,
-               name;
+       let content, name;
 
        before( function () {
-               // disable VisualEditor welcome dialog
-               browser.deleteCookie();
-               BlankPage.open();
-               browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
+               browser.deleteAllCookies();
 
                // Enable rollback confirmation for admin user
                // Requires user to log in again, handled by deleteCookie() call in beforeEach function
@@ -21,7 +16,7 @@ describe( 'Rollback with confirmation', function () {
        } );
 
        beforeEach( function () {
-               browser.deleteCookie();
+               browser.deleteAllCookies();
 
                content = Util.getTestString( 'beforeEach-content-' );
                name = Util.getTestString( 'BeforeEach-name-' );
@@ -35,7 +30,7 @@ describe( 'Rollback with confirmation', function () {
        it.skip( 'should offer rollback options for admin users', function () {
                assert.strictEqual( HistoryPage.rollback.getText(), 'rollback 1 edit' );
 
-               HistoryPage.rollback.click();
+               HistoryPage.rollbackLink.click();
 
                assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Please confirm:' );
                assert.strictEqual( HistoryPage.rollbackConfirmableYes.getText(), 'Rollback' );
@@ -45,7 +40,7 @@ describe( 'Rollback with confirmation', function () {
        it.skip( 'should offer a way to cancel rollbacks', function () {
                HistoryPage.rollback.click();
 
-               HistoryPage.rollbackConfirmableNo.waitForVisible( 5000 );
+               HistoryPage.rollbackConfirmableNo.waitForDisplayed( 5000 );
 
                HistoryPage.rollbackConfirmableNo.click();
 
@@ -57,7 +52,7 @@ describe( 'Rollback with confirmation', function () {
        it.skip( 'should perform rollbacks after confirming intention', function () {
                HistoryPage.rollback.click();
 
-               HistoryPage.rollbackConfirmableYes.waitForVisible( 5000 );
+               HistoryPage.rollbackConfirmableYes.waitForDisplayed( 5000 );
 
                HistoryPage.rollbackConfirmableYes.click();
 
@@ -68,7 +63,7 @@ describe( 'Rollback with confirmation', function () {
        } );
 
        it.skip( 'should verify rollbacks via GET requests are confirmed on a follow-up page', function () {
-               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               const rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
                browser.url( rollbackActionUrl );
 
                browser.waitUntil( function () {
@@ -85,14 +80,10 @@ describe( 'Rollback with confirmation', function () {
 } );
 
 describe( 'Rollback without confirmation', function () {
-       var content,
-               name;
+       let content, name;
 
        before( function () {
-               // disable VisualEditor welcome dialog
-               browser.deleteCookie();
-               BlankPage.open();
-               browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
+               browser.deleteAllCookies();
 
                // Disable rollback confirmation for admin user
                // Requires user to log in again, handled by deleteCookie() call in beforeEach function
@@ -101,7 +92,7 @@ describe( 'Rollback without confirmation', function () {
        } );
 
        beforeEach( function () {
-               browser.deleteCookie();
+               browser.deleteAllCookies();
 
                content = Util.getTestString( 'beforeEach-content-' );
                name = Util.getTestString( 'BeforeEach-name-' );
@@ -112,17 +103,17 @@ describe( 'Rollback without confirmation', function () {
                HistoryPage.open( name );
        } );
 
-       it( 'should perform rollback via POST request without asking the user to confirm', function () {
+       it.skip( 'should perform rollback via POST request without asking the user to confirm', function () {
                HistoryPage.rollback.click();
 
                // waitUntil indirectly asserts that the content we are looking for is present
                browser.waitUntil( function () {
-                       return HistoryPage.headingText === 'Action complete';
+                       return HistoryPage.heading.getText() === 'Action complete';
                }, 5000, 'Expected rollback page to appear.' );
        } );
 
        it.skip( 'should perform rollback via GET request without asking the user to confirm', function () {
-               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               const rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
                browser.url( rollbackActionUrl );
 
                browser.waitUntil( function () {