Merge "JsonContent: Remove never-used caption styles"
[lhc/web/wiklou.git] / tests / selenium / specs / rollback.js
index c52eca1..970fb9e 100644 (file)
@@ -43,13 +43,16 @@ describe( 'Rollback with confirmation', function () {
 
                HistoryPage.rollback.click();
 
-               assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Rollback of one edit?' );
+               assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Please confirm:' );
                assert.strictEqual( HistoryPage.rollbackConfirmableYes.getText(), 'Rollback' );
                assert.strictEqual( HistoryPage.rollbackConfirmableNo.getText(), 'Cancel' );
        } );
 
-       it( 'should offer a way to cancel rollbacks', function () {
+       it.skip( 'should offer a way to cancel rollbacks', function () {
                HistoryPage.rollback.click();
+
+               browser.pause( 300 );
+
                HistoryPage.rollbackConfirmableNo.click();
 
                browser.pause( 500 );
@@ -57,8 +60,11 @@ describe( 'Rollback with confirmation', function () {
                assert.strictEqual( HistoryPage.heading.getText(), 'Revision history of "' + name + '"' );
        } );
 
-       it( 'should perform rollbacks after confirming intention', function () {
+       it.skip( 'should perform rollbacks after confirming intention', function () {
                HistoryPage.rollback.click();
+
+               browser.pause( 300 );
+
                HistoryPage.rollbackConfirmableYes.click();
 
                // waitUntil indirectly asserts that the content we are looking for is present
@@ -66,6 +72,22 @@ describe( 'Rollback with confirmation', function () {
                        return browser.getText( '#firstHeading' ) === 'Action complete';
                }, 5000, 'Expected rollback page to appear.' );
        } );
+
+       it( 'should verify rollbacks via GET requests are confirmed on a follow-up page', function () {
+               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               browser.url( rollbackActionUrl );
+
+               browser.waitUntil( function () {
+                       return HistoryPage.rollbackNonJsConfirmable.getText() === 'Revert edits to this page?';
+               }, 5000, 'Expected rollback confirmation page to appear for GET-based rollbacks.' );
+
+               HistoryPage.rollbackNonJsConfirmableYes.click();
+
+               browser.waitUntil( function () {
+                       return browser.getText( '#firstHeading' ) === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
+
 } );
 
 describe( 'Rollback without confirmation', function () {
@@ -103,7 +125,7 @@ describe( 'Rollback without confirmation', function () {
                HistoryPage.open( name );
        } );
 
-       it( 'should perform rollback without asking the user to confirm', function () {
+       it( '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
@@ -111,4 +133,13 @@ describe( 'Rollback without confirmation', function () {
                        return HistoryPage.headingText === 'Action complete';
                }, 5000, 'Expected rollback page to appear.' );
        } );
+
+       it( 'should perform rollback via GET request without asking the user to confirm', function () {
+               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               browser.url( rollbackActionUrl );
+
+               browser.waitUntil( function () {
+                       return browser.getText( '#firstHeading' ) === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
 } );