QA: Don't chain things that cannot be chained

Causing builds to fail on
https://integration.wikimedia.org/ci/view/Reading-Web/job/selenium-daily-beta-Minerva/58/console

Bug: T223676
Change-Id: Ia285f8bd2f61e6e59aa38cd1909b450328eb053c
This commit is contained in:
jdlrobson 2019-05-18 09:49:41 +02:00 committed by Jan Drewniak
parent c4b31067ab
commit 94c0926614
2 changed files with 19 additions and 13 deletions

View File

@ -20,11 +20,17 @@ const login = () => {
const createPages = ( pages ) => {
const summary = 'edit by selenium test';
browser.call( () => login() );
browser.call( () =>
api.batch(
browser.call( () => {
return api.batch(
pages.map( ( page ) => [ 'create' ].concat( page ).concat( [ summary ] ) )
)
);
).catch( ( err ) => {
if ( err.code === 'articleexists' ) {
return;
}
throw err;
} );
} );
};
const createPage = ( title, wikitext ) => {

View File

@ -23,13 +23,7 @@ const iAmInAWikiThatHasCategories = ( title ) => {
[ 'create', 'Category:Selenium artifacts', msg ],
[ 'create', 'Category:Test category', msg ],
[ 'create', 'Category:Selenium hidden category', '__HIDDENCAT__' ]
] )
.catch( ( err ) => {
if ( err.code === 'articleexists' ) {
return;
}
throw err;
} );
] );
// A pause is necessary to let the categories register with database before trying to use
// them in an article
@ -68,7 +62,10 @@ const iGoToAPageThatHasLanguages = () => {
[[es:Selenium language test page]]
`;
return createPage( 'Selenium language test page', wikitext ).then( () => {
browser.call( () => {
createPage( 'Selenium language test page', wikitext );
} );
browser.call( () => {
iAmOnPage( 'Selenium language test page' );
} );
};
@ -85,7 +82,10 @@ const watch = ( title ) => {
const iAmViewingAWatchedPage = () => {
const title = `I am on the "Selenium mobile watched page test ${new Date().getTime()}`;
createPage( title, 'watch test' ).then( () => {
browser.call( () => {
createPage( title, 'watch test' );
} );
browser.call( () => {
watch( title );
// navigate away from page
iAmOnPage( 'Main Page' );