| 1 | 'use strict'; |
| 2 | |
| 3 | const assert = require( 'assert' ); |
| 4 | const { ArticlePage } = require( '../support/world.js' ); |
| 5 | |
| 6 | const theWatchstarShouldNotBeSelected = () => { |
| 7 | ArticlePage.watch_element.waitForExist(); |
| 8 | assert.strictEqual( ArticlePage.watched_element.isExisting(), false, |
| 9 | 'the watched element should not be present' ); |
| 10 | }; |
| 11 | |
| 12 | const theWatchstarShouldBeSelected = async () => { |
| 13 | await ArticlePage.watched_element.waitForExist(); |
| 14 | const watchstar = await ArticlePage.watched_element; |
| 15 | assert.strictEqual( await watchstar.isDisplayed(), true ); |
| 16 | }; |
| 17 | |
| 18 | const iClickTheWatchstar = async () => { |
| 19 | await ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' ); |
| 20 | await ArticlePage.watch_element.waitForExist(); |
| 21 | await ArticlePage.watch_element.click(); |
| 22 | }; |
| 23 | |
| 24 | const iClickTheUnwatchStar = () => { |
| 25 | ArticlePage.waitUntilResourceLoaderModuleReady( 'skins.minerva.scripts' ); |
| 26 | ArticlePage.watched_element.waitForExist(); |
| 27 | ArticlePage.watched_element.click(); |
| 28 | }; |
| 29 | |
| 30 | module.exports = { |
| 31 | theWatchstarShouldNotBeSelected, theWatchstarShouldBeSelected, |
| 32 | iClickTheWatchstar, iClickTheUnwatchStar }; |