Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created December 25, 2017 09:51
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/b72e6c030722030b90ba190d6b968e40 to your computer and use it in GitHub Desktop.
Save conanak99/b72e6c030722030b90ba190d6b968e40 to your computer and use it in GitHub Desktop.
test('Search sexy underwear', async() => {
expect.assertions(1);
// Tìm khung search, gõ sexy underwear và bấm enter
const searchBox = await page.$('#q');
await searchBox.type('sexy underwear');
await searchBox.press('Enter');
// Chờ trang load xong, tìm các phần tử item và đếm nếu đủ 40
await page.waitForNavigation();
const products = await page.$$('div[data-qa-locator=product-item]');
expect(products.length).toBe(40);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment