Fix E2E shopper mini cart test (#47756)

Fix mini cart e2e test
This commit is contained in:
Veljko V 2024-05-23 20:49:44 +02:00 committed by GitHub
parent 48a2fccef0
commit d9bcf83bf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 8 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: fixing skipped mini cart test

View File

@ -16,7 +16,7 @@ const totalInclusiveTax = +singleProductSalePrice + 5 + 2.5;
let productId, countryTaxId, stateTaxId, shippingZoneId;
test.describe.skip( 'Mini Cart block page', () => {
test.describe( 'Mini Cart block page', () => {
test.use( { storageState: process.env.ADMINSTATE } );
test.beforeAll( async ( { baseURL } ) => {
@ -176,9 +176,11 @@ test.describe.skip( 'Mini Cart block page', () => {
// customize font size and weight
await page.getByLabel( 'Large', { exact: true } ).click();
await page.getByRole( 'button', { name: 'Font weight' } ).click();
await page
.getByRole( 'option', { name: 'Black', exact: true } )
.click();
// choose Light via kb press due to encountered issue with normal click
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.press( 'Enter' );
// publish created mini cart page
await page
@ -215,7 +217,7 @@ test.describe.skip( 'Mini Cart block page', () => {
);
await expect( page.locator( miniCartBlock ) ).toHaveAttribute(
'data-style',
'{"typography":{"fontWeight":"900"}}'
'{"typography":{"fontWeight":"300"}}'
);
await page.locator( miniCartButton ).click();
await expect(
@ -280,9 +282,8 @@ test.describe.skip( 'Mini Cart block page', () => {
await page.goto( miniCartPageSlug );
await page.locator( miniCartButton ).click();
await page.getByRole( 'link', { name: 'Go to checkout' } ).click();
await expect(
page.getByRole( 'heading', { name: 'Checkout', exact: true } )
).toBeVisible();
await expect( page.url() ).toContain( '/checkout' );
await expect( page.getByText( 'Place order' ) ).toBeVisible();
await expect( page.locator( miniCartButton ) ).toBeHidden();
// shopping cart is very sensitive to cookies, so be explicit