mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-12 06:16:01 +00:00
dd3fb66258
WebdriverIO has dropped support of sync mode, hence changed to async.
Update npm packages: @wdio/*, wdio-mediawiki
because async mode needs at least @wdio v7.9.
Remove npm packages: @wdio/dot-reporter and @wdio/sync.
Bug: T293084
Change-Id: I5babbdadf21e9f951f69de93bfca5213a50965aa
(cherry picked from commit 677ce50b24
)
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require( 'assert' );
|
|
const { ArticlePage } = require( '../support/world.js' );
|
|
|
|
const theWatchstarShouldNotBeSelected = () => {
|
|
ArticlePage.watch_element.waitForExist();
|
|
assert.strictEqual( ArticlePage.watched_element.isExisting(), false,
|
|
'the watched element should not be present' );
|
|
};
|
|
|
|
const theWatchstarShouldBeSelected = async () => {
|
|
await ArticlePage.watched_element.waitForExist();
|
|
const watchstar = await ArticlePage.watched_element;
|
|
assert.strictEqual( await watchstar.isDisplayed(), true );
|
|
};
|
|
|
|
const iClickTheWatchstar = async () => {
|
|
await ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
|
await ArticlePage.watch_element.waitForExist();
|
|
await ArticlePage.watch_element.click();
|
|
};
|
|
|
|
const iClickTheUnwatchStar = () => {
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
|
ArticlePage.watched_element.waitForExist();
|
|
ArticlePage.watched_element.click();
|
|
};
|
|
|
|
module.exports = {
|
|
theWatchstarShouldNotBeSelected, theWatchstarShouldBeSelected,
|
|
iClickTheWatchstar, iClickTheUnwatchStar };
|