Merge "rdbms: cleanup runMasterPostTrxCallbacks() transaction check"
[lhc/web/wiklou.git] / tests / selenium / pageobjects / delete.page.js
index bb095bb..d43cb9f 100644 (file)
@@ -18,5 +18,22 @@ class DeletePage extends Page {
                this.submit.click();
        }
 
+       apiDelete( name, reason ) {
+
+               const MWBot = require( 'mwbot' ), // https://github.com/Fannon/mwbot
+                       Promise = require( 'bluebird' );
+               let bot = new MWBot();
+
+               return Promise.coroutine( function* () {
+                       yield bot.loginGetEditToken( {
+                               apiUrl: `${browser.options.baseUrl}/api.php`,
+                               username: browser.options.username,
+                               password: browser.options.password
+                       } );
+                       yield bot.delete( name, reason );
+               } ).call( this );
+
+       }
+
 }
 module.exports = new DeletePage();