Skip to content

Instantly share code, notes, and snippets.

@conanak99
Last active January 30, 2018 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conanak99/7900e0fdd2b113dee21fd9cf292ad729 to your computer and use it in GitHub Desktop.
Save conanak99/7900e0fdd2b113dee21fd9cf292ad729 to your computer and use it in GitHub Desktop.
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