Skip to content

Instantly share code, notes, and snippets.

@conanak99

conanak99/lazada-app.js

Last active Jan 30, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.