import { imagesResultsListItem , searchImagesForm } from '../selectors/images' ; import { formatFilterDropDown , formatFilterDropDownButton , formatFilterMobileButton , mobileModal , mobileModalCloseButton , worksSearchImagesInputField , } from '../selectors/search' ; import { isMobile , fillInputAction } from './common' ; export async function fillActionSearchInput ( value ) { const selector = `${ searchImagesForm } ${ worksSearchImagesInputField }` ; await fillInputAction ( selector , value ) ; } export async function pressActionEnterSearchInput ( ) { const selector = `${ searchImagesForm } ${ worksSearchImagesInputField }` ; await page . press ( selector , 'Enter' ) ; } export async function clickActionFormatDropDown ( ) { await page . click ( formatFilterDropDownButton ) ; } export async function clickActionFormatRadioCheckbox ( filterName ) { const selector = `${ isMobile ( ) ? mobileModal : formatFilterDropDown } label[aria-label="Radio checkbox ${ filterName }"]` ; await page . click ( selector ) ; } export async function clickActionModalFilterButton ( ) { const selector = `${ searchImagesForm } ${ formatFilterMobileButton }` ; await page . click ( selector ) ; } export async function clickActionCloseModalFilterButton ( ) { const selector = `${ searchImagesForm } ${ mobileModalCloseButton }` ; await page . click ( selector ) ; } export async function clickActionClickSearchResultItem ( nthChild ) { const selector = `${ imagesResultsListItem }:nth-child(${ nthChild }) a` ; await page . click ( selector ) ; }