X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fselenium%2Fspecs%2Frollback.js;h=d85b27bd5eb47ab15c86f49916228d20d8db4720;hb=96fa73b3cf7b697942826e4aeaa2778e74ebcc02;hp=5a0f603fca0229876efa65340178d7ed4cd6f02e;hpb=933a00217017bf56eb5de3e5d42e1611389f1f54;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/selenium/specs/rollback.js b/tests/selenium/specs/rollback.js index 5a0f603fca..086f09ecbf 100644 --- a/tests/selenium/specs/rollback.js +++ b/tests/selenium/specs/rollback.js @@ -1,17 +1,13 @@ -const assert = require( 'assert' ), - 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(); - UserLoginPage.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 @@ -20,7 +16,7 @@ describe( 'Rollback with confirmation', function () { } ); beforeEach( function () { - browser.deleteCookie(); + browser.deleteAllCookies(); content = Util.getTestString( 'beforeEach-content-' ); name = Util.getTestString( 'BeforeEach-name-' ); @@ -31,10 +27,10 @@ describe( 'Rollback with confirmation', function () { HistoryPage.open( name ); } ); - it( 'should offer rollback options for admin users', 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' ); @@ -44,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(); @@ -56,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(); @@ -67,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 () { @@ -84,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(); - UserLoginPage.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 @@ -100,7 +92,7 @@ describe( 'Rollback without confirmation', function () { } ); beforeEach( function () { - browser.deleteCookie(); + browser.deleteAllCookies(); content = Util.getTestString( 'beforeEach-content-' ); name = Util.getTestString( 'BeforeEach-name-' ); @@ -111,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 () {