mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
Verify that the test page was created
Make sure that we're waiting for the page creation to finish, and assert that the API request was successful. This is mostly a diagnostic improvement to help debug flaky tests. Bug: T355602 Change-Id: I398cffa724e9b6d733df46676478cc98dccd884d
This commit is contained in:
parent
723571b5d3
commit
4a6b78ac0c
|
@ -9,19 +9,20 @@ function getTestString( prefix = '' ) {
|
|||
|
||||
describe( 'Cite backlinks test', () => {
|
||||
before( () => {
|
||||
cy.visit( '/' );
|
||||
cy.visit( '/index.php' );
|
||||
|
||||
const wikiText = 'This is reference #1: <ref name="a">This is citation #1 for reference #1 and #2</ref><br> ' +
|
||||
'This is reference #2: <ref name="a" /><br>' +
|
||||
'This is reference #3: <ref>This is citation #2</ref><br>' +
|
||||
'<references />';
|
||||
|
||||
// Rely on the retry behavior of Cypress assertions to use this as a "wait" until the specified conditions are met.
|
||||
// Rely on the retry behavior of Cypress assertions to use this as a "wait"
|
||||
// until the specified conditions are met.
|
||||
cy.window().should( 'have.property', 'mw' ).and( 'have.property', 'loader' ).and( 'have.property', 'using' );
|
||||
cy.window().then( ( win ) => {
|
||||
win.mw.loader.using( 'mediawiki.api' ).then( () => {
|
||||
new win.mw.Api().create( title, {}, wikiText );
|
||||
} );
|
||||
cy.window().then( async ( win ) => {
|
||||
await win.mw.loader.using( 'mediawiki.api' );
|
||||
const response = await new win.mw.Api().create( title, {}, wikiText );
|
||||
expect( response.result ).to.equal( 'Success' );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue