wiki.techinc.nl/tests/selenium/docs/Stack/pageobjects/main.page.js
Željko Filipin 6700247fa6 selenium: Fix Main Page should have "Log in" link
Three tests with that name were by mistake going to `/Main Page` instead of `Main Page`.

Bug: T373125
Change-Id: I5936f2c944765f576ab87d899002f7f24116ef44
2024-09-11 15:59:11 +02:00

23 lines
674 B
JavaScript

// Example code for Selenium/Explanation/Stack
// https://www.mediawiki.org/wiki/Selenium/Explanation/Stack
'use strict';
const Page = require( './page' );
// baseUrl is required for our continuous integration.
// If you don't have MW_SERVER and MW_SCRIPT_PATH environment variables set
// you can probably hardcode it to something like this:
// const baseUrl = 'http://localhost:8080/wiki/';
const baseUrl = `${ process.env.MW_SERVER }${ process.env.MW_SCRIPT_PATH }/index.php?title=`;
class MainPage extends Page {
get login() {
return $( 'li#pt-login-2 a' );
}
async open() {
await super.open( `${ baseUrl }Main_Page` );
}
}
module.exports = new MainPage();