X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fselenium%2Fpageobjects%2Fdelete.page.js;h=754c0d2a9153b6960a814d4a89295dd06323636a;hp=ec034092de1d75cf01c6ad94c2589621f7703984;hb=70987ee4c08d0c19468f67d7482d5bd150a0ad39;hpb=2729bf4653ca87c427f696f53624217d62096a25 diff --git a/tests/selenium/pageobjects/delete.page.js b/tests/selenium/pageobjects/delete.page.js index ec034092de..754c0d2a91 100644 --- a/tests/selenium/pageobjects/delete.page.js +++ b/tests/selenium/pageobjects/delete.page.js @@ -1,34 +1,20 @@ -const Page = require( './page' ), - // https://github.com/Fannon/mwbot - MWBot = require( 'mwbot' ); +const Page = require( 'wdio-mediawiki/Page' ); class DeletePage extends Page { - get reason() { return browser.element( '#wpReason' ); } - get watch() { return browser.element( '#wpWatch' ); } - get submit() { return browser.element( '#wpConfirmB' ); } - get displayedContent() { return browser.element( '#mw-content-text' ); } + get reason() { return $( '#wpReason' ); } + get watch() { return $( '#wpWatch' ); } + get submit() { return $( '#wpConfirmB' ); } + get displayedContent() { return $( '#mw-content-text' ); } - open( name ) { - super.open( name + '&action=delete' ); + open( title ) { + super.openTitle( title, { action: 'delete' } ); } - delete( name, reason ) { - this.open( name ); + delete( title, reason ) { + this.open( title ); this.reason.setValue( reason ); this.submit.click(); } - - apiDelete( name, reason ) { - let bot = new MWBot(); - - return bot.loginGetEditToken( { - apiUrl: `${browser.options.baseUrl}/api.php`, - username: browser.options.username, - password: browser.options.password - } ).then( function () { - return bot.delete( name, reason ); - } ); - } } module.exports = new DeletePage();