Merge "selenium: Run most tests targeting the beta cluster"
This commit is contained in:
commit
1eea20a5fe
6 changed files with 22 additions and 25 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
"qunit": "grunt qunit",
|
"qunit": "grunt qunit",
|
||||||
"doc": "jsduck",
|
"doc": "jsduck",
|
||||||
"postdoc": "grunt copy:jsduck",
|
"postdoc": "grunt copy:jsduck",
|
||||||
"selenium-daily": "npm run selenium-test -- --suite daily --mochaOpts.grep @daily",
|
"selenium-daily": "npm run selenium-test -- --mochaOpts.grep @daily",
|
||||||
"selenium-test": "wdio ./tests/selenium/wdio.conf.js"
|
"selenium-test": "wdio ./tests/selenium/wdio.conf.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ const Page = require( 'wdio-mediawiki/Page' );
|
||||||
|
|
||||||
class RecentChangesPage extends Page {
|
class RecentChangesPage extends Page {
|
||||||
get changesList() { return $( '.mw-changeslist' ); }
|
get changesList() { return $( '.mw-changeslist' ); }
|
||||||
|
get liveUpdates() { return $( '.mw-rcfilters-ui-liveUpdateButtonWidget' ); }
|
||||||
get titles() { return this.changesList.$$( '.mw-changeslist-title' ); }
|
get titles() { return this.changesList.$$( '.mw-changeslist-title' ); }
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
super.openTitle( 'Special:RecentChanges' );
|
super.openTitle( 'Special:RecentChanges', { hidebots: 0 } );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ describe( 'Page', function () {
|
||||||
name = Util.getTestString( 'BeforeEach-name-' );
|
name = Util.getTestString( 'BeforeEach-name-' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be previewable', async function () {
|
it( 'should be previewable @daily', async function () {
|
||||||
|
await UserLoginPage.loginAdmin();
|
||||||
await EditPage.preview( name, content );
|
await EditPage.preview( name, content );
|
||||||
|
|
||||||
assert.strictEqual( await EditPage.heading.getText(), 'Creating ' + name );
|
assert.strictEqual( await EditPage.heading.getText(), 'Creating ' + name );
|
||||||
|
|
@ -38,8 +39,9 @@ describe( 'Page', function () {
|
||||||
await browser.reloadSession();
|
await browser.reloadSession();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be creatable', async function () {
|
it( 'should be creatable @daily', async function () {
|
||||||
// create
|
// create
|
||||||
|
await UserLoginPage.loginAdmin();
|
||||||
await EditPage.edit( name, content );
|
await EditPage.edit( name, content );
|
||||||
|
|
||||||
// check
|
// check
|
||||||
|
|
@ -47,7 +49,7 @@ describe( 'Page', function () {
|
||||||
assert.strictEqual( await EditPage.displayedContent.getText(), content );
|
assert.strictEqual( await EditPage.displayedContent.getText(), content );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be re-creatable', async function () {
|
it( 'should be re-creatable @daily', async function () {
|
||||||
const initialContent = Util.getTestString( 'initialContent-' );
|
const initialContent = Util.getTestString( 'initialContent-' );
|
||||||
|
|
||||||
// create and delete
|
// create and delete
|
||||||
|
|
@ -55,6 +57,7 @@ describe( 'Page', function () {
|
||||||
await bot.delete( name, 'delete prior to recreate' );
|
await bot.delete( name, 'delete prior to recreate' );
|
||||||
|
|
||||||
// re-create
|
// re-create
|
||||||
|
await UserLoginPage.loginAdmin();
|
||||||
await EditPage.edit( name, content );
|
await EditPage.edit( name, content );
|
||||||
|
|
||||||
// check
|
// check
|
||||||
|
|
@ -84,7 +87,7 @@ describe( 'Page', function () {
|
||||||
assert.strictEqual( await HistoryPage.comment.getText(), `created with "${content}"` );
|
assert.strictEqual( await HistoryPage.comment.getText(), `created with "${content}"` );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be deletable', async function () {
|
it( 'should be deletable @daily', async function () {
|
||||||
// create
|
// create
|
||||||
await bot.edit( name, content, 'create for delete' );
|
await bot.edit( name, content, 'create for delete' );
|
||||||
|
|
||||||
|
|
@ -94,13 +97,10 @@ describe( 'Page', function () {
|
||||||
await DeletePage.delete( name, 'delete reason' );
|
await DeletePage.delete( name, 'delete reason' );
|
||||||
|
|
||||||
// check
|
// check
|
||||||
assert.strictEqual(
|
assert.match( await DeletePage.displayedContent.getText(), new RegExp( `"${name}" has been deleted.` ) );
|
||||||
await DeletePage.displayedContent.getText(),
|
|
||||||
'"' + name + '" has been deleted. See deletion log for a record of recent deletions.\n\nReturn to Main Page.'
|
|
||||||
);
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be restorable', async function () {
|
it( 'should be restorable @daily', async function () {
|
||||||
// create and delete
|
// create and delete
|
||||||
await bot.edit( name, content, 'create for delete' );
|
await bot.edit( name, content, 'create for delete' );
|
||||||
await bot.delete( name, 'delete for restore' );
|
await bot.delete( name, 'delete for restore' );
|
||||||
|
|
@ -115,7 +115,7 @@ describe( 'Page', function () {
|
||||||
assert.strictEqual( await RestorePage.displayedContent.getText(), name + ' has been undeleted\n\nConsult the deletion log for a record of recent deletions and restorations.' );
|
assert.strictEqual( await RestorePage.displayedContent.getText(), name + ' has been undeleted\n\nConsult the deletion log for a record of recent deletions and restorations.' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be protectable', async function () {
|
it( 'should be protectable @daily', async function () {
|
||||||
|
|
||||||
await bot.edit( name, content, 'create for protect' );
|
await bot.edit( name, content, 'create for protect' );
|
||||||
|
|
||||||
|
|
@ -137,7 +137,7 @@ describe( 'Page', function () {
|
||||||
assert.strictEqual( await EditPage.heading.getText(), 'View source for ' + name );
|
assert.strictEqual( await EditPage.heading.getText(), 'View source for ' + name );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should be undoable', async function () {
|
it( 'should be undoable @daily', async function () {
|
||||||
|
|
||||||
// create
|
// create
|
||||||
await bot.edit( name, content, 'create to edit and undo' );
|
await bot.edit( name, content, 'create to edit and undo' );
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ describe( 'Special:RecentChanges', function () {
|
||||||
name = Util.getTestString();
|
name = Util.getTestString();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'shows page creation', async function () {
|
it( 'shows page creation @daily', async function () {
|
||||||
await bot.edit( name, content );
|
await bot.edit( name, content );
|
||||||
await browser.waitUntil( async () => {
|
await browser.waitUntil( async () => {
|
||||||
const result = await bot.request( {
|
const result = await bot.request( {
|
||||||
|
|
@ -30,7 +30,11 @@ describe( 'Special:RecentChanges', function () {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
await RecentChangesPage.open();
|
await RecentChangesPage.open();
|
||||||
|
await RecentChangesPage.liveUpdates.click();
|
||||||
|
await browser.waitUntil(
|
||||||
|
async () => ( await RecentChangesPage.titles[ 0 ].getText() ) === name,
|
||||||
|
{ timeout: 10000 }
|
||||||
|
);
|
||||||
assert.strictEqual( await RecentChangesPage.titles[ 0 ].getText(), name );
|
assert.strictEqual( await RecentChangesPage.titles[ 0 ].getText(), name );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ describe( 'Special:Watchlist', function () {
|
||||||
await LoginPage.loginAdmin();
|
await LoginPage.loginAdmin();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should show page with new edit', async function () {
|
it( 'should show page with new edit @daily', async function () {
|
||||||
const title = Util.getTestString( 'Title-' );
|
const title = Util.getTestString( 'Title-' );
|
||||||
|
|
||||||
// create
|
// create
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,5 @@ exports.config = { ...config,
|
||||||
specs: [
|
specs: [
|
||||||
'tests/selenium/specs/**/*.js',
|
'tests/selenium/specs/**/*.js',
|
||||||
'tests/selenium/wdio-mediawiki/specs/*.js'
|
'tests/selenium/wdio-mediawiki/specs/*.js'
|
||||||
],
|
]
|
||||||
|
|
||||||
suites: {
|
|
||||||
daily: [
|
|
||||||
'tests/selenium/wdio-mediawiki/specs/*.js',
|
|
||||||
'tests/selenium/specs/page.js',
|
|
||||||
'tests/selenium/specs/user.js'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue