Debian Codegraph @

tests/selenium/docs/Stack/specs/mocha.js

raw symbols SCIP
1 // Example code for Selenium/Explanation/Stack
2 // https://www.mediawiki.org/wiki/Selenium/Explanation/Stack
3
4 'use strict';
5
6 // baseUrl is required for our continuous integration.
7 // If you don't have MW_SERVER and MW_SCRIPT_PATH environment variables set
8 // you can probably hardcode it to something like this:
9 // const baseUrl = 'http://localhost:8080/wiki/';
10 const baseUrl = `${ process.env.MW_SERVER }${ process.env.MW_SCRIPT_PATH }/index.php?title=`;
11
12 describe( 'Main page', () => {
13 it( 'should have "Log in" link when using mocha', async () => {
14 await browser.url( `${ baseUrl }Main_Page` );
15 const displayed = await $( 'li#pt-login-2 a' ).isDisplayed();
16 if ( displayed === false ) {
17 throw new Error( 'Log in link not visible' );
18 } else {
19 console.log( 'Log in link visible' );
20 }
21 } );
22 } );