Reorder scenarios within test
This commit is contained in:
parent
7f2163fdd8
commit
f6a19c1430
|
@ -45,8 +45,27 @@ const runProductBrowseSearchSortTest = () => {
|
|||
await merchant.logout();
|
||||
});
|
||||
|
||||
it('should let user browse products by categories', async () => {
|
||||
await shopper.goToShop();
|
||||
|
||||
// Go to 1st product and click category name
|
||||
await shopper.goToProduct(variablePostIdValue);
|
||||
await expect(page.title()).resolves.toMatch(simpleProductName + ' 1');
|
||||
await expect(page).toClick('span.posted_in > a', {text: clothing});
|
||||
await uiUnblocked();
|
||||
|
||||
// Verify Clothing category page
|
||||
await expect(page.title()).resolves.toMatch(clothing);
|
||||
await expect(page).toMatchElement(productTitle, {text: simpleProductName + ' 1'});
|
||||
|
||||
// Verify clicking on the product
|
||||
await expect(page).toClick(productTitle, {text: simpleProductName + ' 1'});
|
||||
await uiUnblocked();
|
||||
await expect(page.title()).resolves.toMatch(simpleProductName + ' 1');
|
||||
await expect(page).toMatchElement('h1.entry-title', simpleProductName + ' 1');
|
||||
});
|
||||
|
||||
it('should let user search the store', async () => {
|
||||
await shopper.login();
|
||||
await shopper.goToShop();
|
||||
|
||||
// Search for the 1st product
|
||||
|
@ -65,24 +84,6 @@ const runProductBrowseSearchSortTest = () => {
|
|||
await expect(page).toMatchElement('h1.entry-title', simpleProductName + ' 1');
|
||||
});
|
||||
|
||||
it('should let user browse products by categories', async () => {
|
||||
// Go to 1st product and click category name
|
||||
await shopper.goToProduct(variablePostIdValue);
|
||||
await expect(page.title()).resolves.toMatch(simpleProductName + ' 1');
|
||||
await expect(page).toClick('span.posted_in > a', {text: clothing});
|
||||
await uiUnblocked();
|
||||
|
||||
// Verify Clothing category page
|
||||
await expect(page.title()).resolves.toMatch(clothing);
|
||||
await expect(page).toMatchElement(productTitle, {text: simpleProductName + ' 1'});
|
||||
|
||||
// Verify clicking on the product
|
||||
await expect(page).toClick(productTitle, {text: simpleProductName + ' 1'});
|
||||
await uiUnblocked();
|
||||
await expect(page.title()).resolves.toMatch(simpleProductName + ' 1');
|
||||
await expect(page).toMatchElement('h1.entry-title', simpleProductName + ' 1');
|
||||
});
|
||||
|
||||
it('should let user sort the products in the shop', async () => {
|
||||
await shopper.goToShop();
|
||||
|
||||
|
|
Loading…
Reference in New Issue