Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6072479
popups.page.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
popups.page.js
View Options
'use strict'
;
const
fs
=
require
(
'fs'
),
Api
=
require
(
'wdio-mediawiki/Api'
),
Page
=
require
(
'wdio-mediawiki/Page'
),
Util
=
require
(
'wdio-mediawiki/Util'
),
TEST_PAGE_POPUPS_TITLE
=
'Page popups test page'
,
POPUPS_SELECTOR
=
'.mwe-popups'
,
PAGE_POPUPS_LINK_SELECTOR
=
'.mw-body-content ul a'
,
POPUPS_MODULE_NAME
=
'ext.popups.main'
;
async
function
makePage
(
title
,
path
)
{
// eslint-disable-next-line security/detect-non-literal-fs-filename
const
content
=
fs
.
readFileSync
(
path
,
'utf-8'
);
const
bot
=
await
Api
.
bot
();
await
bot
.
edit
(
title
,
content
);
}
class
PopupsPage
extends
Page
{
get
pagePopupsSelector
()
{
return
$
(
'.mwe-popups-type-page'
);
}
async
setupPagePreviews
()
{
return
browser
.
call
(
async
()
=>
{
const
path
=
`
${
__dirname
}
/../fixtures/`
;
await
makePage
(
`
${
TEST_PAGE_POPUPS_TITLE
}
2`
,
`
${
path
}
test_page_2.wikitext`
);
await
makePage
(
TEST_PAGE_POPUPS_TITLE
,
`
${
path
}
test_page.wikitext`
);
}
);
}
async
ready
()
{
await
Util
.
waitForModuleState
(
POPUPS_MODULE_NAME
);
}
async
abandonLink
()
{
return
$
(
'#content h1'
).
moveTo
();
}
async
dwellLink
(
selector
,
doesNotTriggerPreview
)
{
await
$
(
selector
).
moveTo
();
if
(
!
doesNotTriggerPreview
)
{
await
$
(
POPUPS_SELECTOR
).
waitForExist
();
}
else
{
// eslint-disable-next-line wdio/no-pause
await
browser
.
pause
(
1000
);
}
}
async
dwellPageLink
()
{
await
this
.
dwellLink
(
PAGE_POPUPS_LINK_SELECTOR
);
}
async
dwellPageFragment
()
{
await
this
.
dwellLink
(
'[href="#section"]'
,
true
);
}
async
hoverPageLink
()
{
await
$
(
PAGE_POPUPS_LINK_SELECTOR
).
moveTo
();
}
async
openPagePopupsTest
()
{
return
super
.
openTitle
(
TEST_PAGE_POPUPS_TITLE
);
}
}
module
.
exports
=
new
PopupsPage
();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 5 2026, 07:41 (6 w, 20 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f9/f4/cbe9fb8990c7e43bb35dc2345726
Default Alt Text
popups.page.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment