Skip to content

Instantly share code, notes, and snippets.

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