2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-08 23:45:11 +00:00
|
|
|
const { iSeeAnOverlay } = require( './common_steps' );
|
|
|
|
const { ArticlePage } = require( '../support/world.js' );
|
|
|
|
const ArticlePageWithOverlay = require( '../support/pages/article_page_with_overlay' );
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iClickTheSearchIcon = async () => {
|
|
|
|
await ArticlePage.search_icon_element.waitForDisplayed();
|
|
|
|
await ArticlePage.search_icon_element.click();
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iTypeIntoTheSearchBox = async ( term ) => {
|
|
|
|
const input = await ArticlePageWithOverlay.overlay_element
|
2020-06-15 14:54:05 +00:00
|
|
|
.$( 'input' );
|
2023-04-06 22:25:40 +00:00
|
|
|
await input.waitForExist();
|
|
|
|
await input.setValue( term );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iSeeSearchResults = async () => {
|
|
|
|
await ArticlePageWithOverlay.overlay_element
|
2020-06-15 14:54:05 +00:00
|
|
|
.$( '.page-list' ).waitForExist( 5000 );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iClickASearchWatchstar = async () => {
|
|
|
|
await iSeeSearchResults();
|
2019-04-08 23:45:11 +00:00
|
|
|
const watchThisArticle = ArticlePageWithOverlay.overlay_element
|
2020-06-15 14:54:05 +00:00
|
|
|
.$( '.watch-this-article' );
|
2019-04-08 23:45:11 +00:00
|
|
|
watchThisArticle.waitForExist( 5000 );
|
|
|
|
watchThisArticle.click();
|
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iSeeTheSearchOverlay = async () => {
|
|
|
|
await iSeeAnOverlay();
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
iClickTheSearchIcon,
|
|
|
|
iTypeIntoTheSearchBox,
|
|
|
|
iClickASearchWatchstar,
|
|
|
|
iSeeTheSearchOverlay
|
|
|
|
};
|