X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fselenium%2Fspecs%2Frollback.js;h=086f09ecbf5ae5640bfaa373fc4b22c4e1d39753;hp=daf7112e634a375f2402e6fbf4bc5de43362a0d8;hb=96fa73b3cf7b697942826e4aeaa2778e74ebcc02;hpb=7bdfadde3fe1b14ff633ff740f77d74585b8e00a diff --git a/tests/selenium/specs/rollback.js b/tests/selenium/specs/rollback.js index daf7112e63..086f09ecbf 100644 --- a/tests/selenium/specs/rollback.js +++ b/tests/selenium/specs/rollback.js @@ -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 () {