Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4160085
edit.page.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
edit.page.js
View Options
import
Page
from
'wdio-mediawiki/Page.js'
;
import
{
waitForModuleState
}
from
'wdio-mediawiki/Util.js'
;
class
EditPage
extends
Page
{
get
content
()
{
return
$
(
'#wpTextbox1'
);
}
get
conflictingContent
()
{
return
$
(
'#wpTextbox2'
);
}
get
displayedContent
()
{
return
$
(
'#mw-content-text .mw-parser-output'
);
}
get
heading
()
{
return
$
(
'#firstHeading'
);
}
get
save
()
{
return
$
(
'#wpSave'
);
}
get
previewButton
()
{
return
$
(
'#wpPreview'
);
}
get
tempUserSignUpButton
()
{
return
$
(
'.mw-temp-user-banner-buttons > #pt-createaccount'
);
}
async
openForEditing
(
title
)
{
await
super
.
openTitle
(
title
,
{
action
:
'submit'
,
vehidebetadialog
:
1
,
hidewelcomedialog
:
1
}
);
// Compatibility with CodeMirror extension (T324879)
await
waitForModuleState
(
'mediawiki.base'
);
const
hasToolbar
=
await
this
.
save
.
isExisting
()
&&
await
browser
.
execute
(
()
=>
mw
.
loader
.
getState
(
'ext.wikiEditor'
)
!==
null
);
if
(
!
hasToolbar
)
{
return
;
}
await
$
(
'#wikiEditor-ui-toolbar'
).
waitForDisplayed
();
const
cmButton
=
$
(
'.mw-editbutton-codemirror-active'
);
if
(
await
cmButton
.
isExisting
()
)
{
await
cmButton
.
click
();
await
browser
.
waitUntil
(
async
()
=>
!
(
await
cmButton
.
getAttribute
(
'class'
)
).
includes
(
'mw-editbutton-codemirror-active'
)
);
}
}
async
preview
(
name
,
content
)
{
await
this
.
openForEditing
(
name
);
await
this
.
content
.
setValue
(
content
);
await
this
.
previewButton
.
click
();
}
async
edit
(
name
,
content
)
{
await
this
.
openForEditing
(
name
);
await
this
.
content
.
setValue
(
content
);
await
this
.
save
.
click
();
}
/**
* Navigate to Special:CreateAccount via the banner links if logged in as a temporary user.
*
* @return {Promise<void>}
*/
async
openCreateAccountPageAsTempUser
()
{
await
this
.
tempUserSignUpButton
.
waitForDisplayed
();
await
this
.
tempUserSignUpButton
.
click
();
}
}
export
default
new
EditPage
();
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Aug 20 2026, 00:14 (9 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d0/00/d5be23940ddaad3a7e4c0359325a
Default Alt Text
edit.page.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment