mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-04 19:38:16 +00:00
89deb7ca4c
This also includes putting the backling tests in their own file due to the common setup needed. Bug: T205271 Change-Id: Ica98c31bf0fddde9eb80f9c53b3dc089cb60e30c
16 lines
652 B
JavaScript
16 lines
652 B
JavaScript
const Page = require( 'wdio-mediawiki/Page' );
|
|
|
|
class CitePage extends Page {
|
|
getReference( num ) { return browser.elements( '#mw-content-text .reference' ).value[ num - 1 ]; }
|
|
getCiteBacklink( num ) { return browser.element( '.references li:nth-of-type(' + num + ') .mw-cite-up-arrow-backlink' ); }
|
|
getCiteSubBacklink( num ) { return browser.element( '.mw-cite-backlink sup:nth-of-type(' + num + ') a' ); }
|
|
|
|
getFragmentFromLink( linkElement ) {
|
|
// the href includes the full url so slice the fragment from it
|
|
let href = linkElement.getAttribute( 'href' );
|
|
return href.slice( href.indexOf( '#' ) + 1 );
|
|
}
|
|
}
|
|
|
|
module.exports = new CitePage();
|