2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-08 23:45:11 +00:00
|
|
|
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 = () => {
|
|
|
|
ArticlePage.watched_element.waitForExist();
|
|
|
|
const watchstar = ArticlePage.watched_element;
|
2020-06-15 14:54:05 +00:00
|
|
|
assert.strictEqual( watchstar.isDisplayed(), true );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iClickTheWatchstar = () => {
|
2019-09-18 23:07:21 +00:00
|
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
2019-04-08 23:45:11 +00:00
|
|
|
ArticlePage.watch_element.waitForExist();
|
|
|
|
ArticlePage.watch_element.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iClickTheUnwatchStar = () => {
|
2019-09-18 23:07:21 +00:00
|
|
|
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
|
2019-10-16 21:01:59 +00:00
|
|
|
ArticlePage.watched_element.waitForExist();
|
|
|
|
ArticlePage.watched_element.click();
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
theWatchstarShouldNotBeSelected, theWatchstarShouldBeSelected,
|
|
|
|
iClickTheWatchstar, iClickTheUnwatchStar };
|