Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4108835
webdriverio.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
webdriverio.js
View Options
// Example code for Selenium/Explanation/Stack
// https://www.mediawiki.org/wiki/Selenium/Explanation/Stack
// 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=`
;
import
{
remote
}
from
'webdriverio'
;
const
browser
=
await
remote
(
{
capabilities
:
{
browserName
:
'chrome'
,
'goog:chromeOptions'
:
{
args
:
[
'--headless'
,
'--no-sandbox'
],
...(
process
.
env
.
CI
&&
{
binary
:
'/usr/bin/chromium'
}
)
},
...(
process
.
env
.
CI
&&
{
'wdio:chromedriverOptions'
:
{
binary
:
'/usr/bin/chromedriver'
}
}
),
'wdio:enforceWebDriverClassic'
:
true
}
}
);
await
browser
.
url
(
`
${
baseUrl
}
Main_Page`
);
const
displayed
=
await
browser
.
$
(
'a[title="Edit section: Getting started"]'
).
isDisplayed
();
if
(
displayed
===
false
)
{
throw
new
Error
(
'Edit link not visible'
);
}
else
{
console
.
log
(
'Edit link visible'
);
}
await
browser
.
deleteSession
();
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Aug 18, 20:45 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ca/05/252d810309809605d2e4571dd5ad
Default Alt Text
webdriverio.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment