Fix E2E search string for Cart block shipping tests (#46720)
* Fix E2E search string for Cart block shipping tests * add changelog * update to uppercase * fix test * fix test one last time * fix lint
This commit is contained in:
parent
80133578be
commit
af53de9aaa
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Fix e2e tests
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { test, expect } = require( '@playwright/test' );
|
const { test, expect } = require( '@playwright/test' );
|
||||||
const { admin } = require( '../../test-data/data' );
|
|
||||||
const { disableWelcomeModal } = require( '../../utils/editor' );
|
const { disableWelcomeModal } = require( '../../utils/editor' );
|
||||||
const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
|
const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
|
||||||
|
|
||||||
|
@ -166,6 +165,7 @@ test.describe( 'Cart Block Calculate Shipping', () => {
|
||||||
await context.clearCookies();
|
await context.clearCookies();
|
||||||
|
|
||||||
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
||||||
|
// eslint-disable-next-line playwright/no-networkidle
|
||||||
await page.waitForLoadState( 'networkidle' );
|
await page.waitForLoadState( 'networkidle' );
|
||||||
|
|
||||||
await page.goto( cartBlockPageSlug );
|
await page.goto( cartBlockPageSlug );
|
||||||
|
@ -187,9 +187,9 @@ test.describe( 'Cart Block Calculate Shipping', () => {
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
page.locator(
|
page.locator(
|
||||||
'.wc-block-components-radio-control__description > .wc-block-components-formatted-money-amount'
|
'.wc-block-components-radio-control__description > .wc-block-components-shipping-rates-control__package__description--free'
|
||||||
)
|
)
|
||||||
).toContainText( '$0.00' );
|
).toContainText( 'Free' );
|
||||||
await expect(
|
await expect(
|
||||||
page.locator(
|
page.locator(
|
||||||
'.wc-block-components-totals-footer-item > .wc-block-components-totals-item__value'
|
'.wc-block-components-totals-footer-item > .wc-block-components-totals-item__value'
|
||||||
|
@ -204,6 +204,7 @@ test.describe( 'Cart Block Calculate Shipping', () => {
|
||||||
await context.clearCookies();
|
await context.clearCookies();
|
||||||
|
|
||||||
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
||||||
|
// eslint-disable-next-line playwright/no-networkidle
|
||||||
await page.waitForLoadState( 'networkidle' );
|
await page.waitForLoadState( 'networkidle' );
|
||||||
|
|
||||||
await page.goto( cartBlockPageSlug );
|
await page.goto( cartBlockPageSlug );
|
||||||
|
@ -265,6 +266,7 @@ test.describe( 'Cart Block Calculate Shipping', () => {
|
||||||
await context.clearCookies();
|
await context.clearCookies();
|
||||||
|
|
||||||
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
||||||
|
// eslint-disable-next-line playwright/no-networkidle
|
||||||
await page.waitForLoadState( 'networkidle' );
|
await page.waitForLoadState( 'networkidle' );
|
||||||
|
|
||||||
await page.goto( cartBlockPageSlug );
|
await page.goto( cartBlockPageSlug );
|
||||||
|
@ -307,9 +309,11 @@ test.describe( 'Cart Block Calculate Shipping', () => {
|
||||||
await context.clearCookies();
|
await context.clearCookies();
|
||||||
|
|
||||||
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
await page.goto( `/shop/?add-to-cart=${ product1Id }` );
|
||||||
|
// eslint-disable-next-line playwright/no-networkidle
|
||||||
await page.waitForLoadState( 'networkidle' );
|
await page.waitForLoadState( 'networkidle' );
|
||||||
|
|
||||||
await page.goto( `/shop/?add-to-cart=${ product2Id }` );
|
await page.goto( `/shop/?add-to-cart=${ product2Id }` );
|
||||||
|
// eslint-disable-next-line playwright/no-networkidle
|
||||||
await page.waitForLoadState( 'networkidle' );
|
await page.waitForLoadState( 'networkidle' );
|
||||||
|
|
||||||
await page.goto( cartBlockPageSlug );
|
await page.goto( cartBlockPageSlug );
|
||||||
|
|
Loading…
Reference in New Issue