aboutsummaryrefslogtreecommitdiffstats
path: root/tests/selenium/docs/Stack/pageobjects/main.page.js
blob: 77b05ef6cefb8011083d5276a11a470a8b2a98e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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();