This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const openHomePage = async () => { | |
await openPage(`/ar`); | |
await page.evaluate(async () => { | |
window.forceLoadAssets = true; | |
}); | |
await closeSplashScreen(); | |
await page.waitForSelector('.homePage'); | |
await DOMElemByTextExists('h3')('بيع . إشتري . دردش'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const closeSplashScreen = async () => { | |
if (!await isSplashScreenExists()) { | |
return; | |
} | |
await clickDOMBySelector('#continueToSiteLink') | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const DOMElemByTextExists = elemName => async text => { | |
const dom = await getDOMByText(elemName)(text); | |
expect(!!dom).toBeTruthy(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const clickDOMByText = elemName => async text => { | |
const dom = await getDOMByText(elemName)(text); | |
await awaitFor(.1); | |
await dom.click(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const clickDOMBySelector = async selector => { | |
await page.waitForSelector(selector); | |
await page.click(selector); | |
}; |