mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Selenium: More explicitly target reference links
The previous selector in the case of the first reference link matches two elements - one in the "Reference links" section and one in the "References" section. My hunch is this leads to the test failures we have been seeing Bug: T344072 Change-Id: Icda37b4f46add4049344f7a8c452082d7b0df5c8
This commit is contained in:
parent
0d591abfe7
commit
a11d459ef1
|
@ -84,8 +84,8 @@ class PopupsPage extends Page {
|
|||
await $( PAGE_POPUPS_LINK_SELECTOR ).moveTo();
|
||||
}
|
||||
|
||||
async dwellReferenceLink( num ) {
|
||||
await this.dwellLink( `.reference:nth-of-type(${num}) a` );
|
||||
async dwellReferenceLink( id ) {
|
||||
await this.dwellLink( `#${id} a` );
|
||||
}
|
||||
|
||||
async dwellReferenceInceptionLink() {
|
||||
|
|
|
@ -21,7 +21,7 @@ describe( 'Dwelling on a valid reference link', function () {
|
|||
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
||||
this.skip();
|
||||
}
|
||||
await page.dwellReferenceLink( 1 );
|
||||
await page.dwellReferenceLink( 'cite_ref-1' );
|
||||
assert( await page.seeReferencePreview(), 'Reference preview is shown.' );
|
||||
assert( !( await page.seeScrollableReferencePreview() ), 'Reference preview is not scrollable.' );
|
||||
assert( !( await page.seeFadeoutOnReferenceText() ), 'Reference preview has no fading effect' );
|
||||
|
@ -31,7 +31,7 @@ describe( 'Dwelling on a valid reference link', function () {
|
|||
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
||||
this.skip();
|
||||
}
|
||||
await page.dwellReferenceLink( 1 );
|
||||
await page.dwellReferenceLink( 'cite_ref-1' );
|
||||
await page.abandonLink();
|
||||
assert( await page.doNotSeeReferencePreview(), 'Reference preview is kept hidden.' );
|
||||
} );
|
||||
|
@ -41,7 +41,7 @@ describe( 'Dwelling on a valid reference link', function () {
|
|||
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
||||
this.skip();
|
||||
}
|
||||
await page.dwellReferenceLink( 2 );
|
||||
await page.dwellReferenceLink( 'cite_ref-2' );
|
||||
assert( await page.seeScrollableReferencePreview(), 'Reference preview is scrollable' );
|
||||
assert( await page.seeFadeoutOnReferenceText(), 'Reference preview has a fading effect' );
|
||||
} );
|
||||
|
@ -50,7 +50,7 @@ describe( 'Dwelling on a valid reference link', function () {
|
|||
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
||||
this.skip();
|
||||
}
|
||||
await page.dwellReferenceLink( 3 );
|
||||
await page.dwellReferenceLink( 'cite_ref-3' );
|
||||
await page.dwellReferenceInceptionLink();
|
||||
assert( await page.seeReferenceInceptionPreview(), 'The reference preview is still showing.' );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue