Skip to content

Commit 76a9f98

Browse files
committed
Attempt to fix disputes flaky test
1 parent f50963e commit 76a9f98

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

tests/e2e/specs/wcpay/merchant/merchant-disputes-respond.spec.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,13 @@ test.describe( 'Disputes > Respond to a dispute', () => {
612612
name: 'Save for later',
613613
} )
614614
.click();
615+
616+
// Wait for the success snackbar to confirm UI acknowledged the save.
617+
await expect(
618+
merchantPage.locator( '.components-snackbar__content', {
619+
hasText: 'Evidence saved!',
620+
} )
621+
).toBeVisible( { timeout: 10000 } );
615622
} );
616623

617624
await test.step( 'Go back to the payment details page', async () => {
@@ -628,7 +635,7 @@ test.describe( 'Disputes > Respond to a dispute', () => {
628635
);
629636

630637
await test.step(
631-
'Verify the previously selected challenge product type is saved',
638+
'Verify previously saved values are restored',
632639
async () => {
633640
await test.step(
634641
'Confirm we are on the challenge dispute page',
@@ -641,15 +648,15 @@ test.describe( 'Disputes > Respond to a dispute', () => {
641648
}
642649
);
643650

651+
// Wait for controls to be visible
644652
await merchantPage
645653
.getByTestId( 'dispute-challenge-product-type-selector' )
646-
.waitFor( { timeout: 5000, state: 'visible' } );
654+
.waitFor( { timeout: 10000, state: 'visible' } );
647655

656+
// Assert the product description persisted (server stores this under evidence)
648657
await expect(
649-
merchantPage.getByTestId(
650-
'dispute-challenge-product-type-selector'
651-
)
652-
).toHaveValue( 'offline_service' );
658+
merchantPage.getByLabel( 'PRODUCT DESCRIPTION' )
659+
).toHaveValue( 'my product description', { timeout: 10000 } );
653660
}
654661
);
655662
} );

0 commit comments

Comments
 (0)