test('Install app', async() => { | |
expect.assertions(1); | |
// Tìm và click vào link | |
const appDownloadLink = await page.$x('//*[@id="topActionDownload"]'); | |
await appDownloadLink[0].click(); | |
await page.waitForNavigation(); | |
// Tìm element trên menu, lấy innerText của element đó | |
const breadCrumbHandle = await page.$x('/html/body/header/footer/div[2]/div[1]/ul/li[2]/span'); | |
const text = await page.evaluate(element => element.innerText, breadCrumbHandle[0]); | |
// Check nội dung element đó có chữ App Mobile tại Lazada | |
expect(text).toContain('App Mobile tại Lazada'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment