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' );
|
|
|
|
|
|
|
|
const iClickTheSearchIcon = () => {
|
2022-02-03 20:18:02 +00:00
|
|
|
ArticlePage.search_icon_element.waitForDisplayed();
|
2019-04-08 23:45:11 +00:00
|
|
|
ArticlePage.search_icon_element.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iTypeIntoTheSearchBox = ( term ) => {
|
|
|
|
const input = ArticlePageWithOverlay.overlay_element
|
2020-06-15 14:54:05 +00:00
|
|
|
.$( 'input' );
|
2019-04-08 23:45:11 +00:00
|
|
|
input.waitForExist();
|
|
|
|
input.setValue( term );
|
|
|
|
};
|
|
|
|
|
|
|
|
const iSeeSearchResults = () => {
|
|
|
|
ArticlePageWithOverlay.overlay_element
|
2020-06-15 14:54:05 +00:00
|
|
|
.$( '.page-list' ).waitForExist( 5000 );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iClickASearchWatchstar = () => {
|
|
|
|
iSeeSearchResults();
|
|
|
|
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();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iSeeTheSearchOverlay = () => {
|
|
|
|
iSeeAnOverlay();
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
iClickTheSearchIcon,
|
|
|
|
iTypeIntoTheSearchBox,
|
|
|
|
iClickASearchWatchstar,
|
|
|
|
iSeeTheSearchOverlay
|
|
|
|
};
|