mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/watch_steps.js
Edward Tadros b12fe5d5cc Fixed search_loggedin.js Selenium browser test
Fixed the search_loggedin.js test by updating watched watchstar methods.

Bug: T174018
Change-Id: I521279d97bc0b264062296cf318f4f56cebee2aa
2020-04-17 08:02:11 -07:00

31 lines
1 KiB
JavaScript

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;
assert.strictEqual( watchstar.isVisible(), true );
};
const iClickTheWatchstar = () => {
ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' );
ArticlePage.watch_element.waitForExist();
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 };