Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
173 stars 69 forks source link

Test failure on `WC - latest | wcpay - merchant` - `payment gateways disable confirmation` #9519

Open frosso opened 2 weeks ago

frosso commented 2 weeks ago

Description

The payment gateways disable confirmation › should show the modal even after clicking the cancel button multiple times test seems to be failing in the Release - Code freeze action, but not on develop. Manual testing seems fine. It looks like the test's implementation has some issues.

Output from the test failure:

payment gateways disable confirmation › should show the modal even after clicking the cancel button multiple times

    TimeoutError: Text not found "Disable WooPayments"
    Waiting failed: 3000ms exceeded

      156 |
      157 |         // Dialog should be displayed
    > 158 |         await expect( page ).toMatchTextContent( 'Disable WooPayments' );
          |         ^
      159 |
      160 |         // Clicking "Cancel" should not disable WCPay
      161 |         await expect( page ).toClick( 'button', {

      at tests/e2e/specs/wcpay/merchant/merchant-payment-gateways-confirmation.spec.js:158:3

Additional context

This has been identified and discussed internally here: p1727705043613989-slack-CGGCLBN58

Priority

Medium-Low

Reason why this e2e test is broken

[!Important] Please, ensure when closing this issue (PR fix) that only one e2e: broken label is added and it is accurate.

  • [x] I confirmed there's only one e2e: broken label in this issue and it is accurate.
vbelolapotkov commented 1 week ago

@frosso it looks like you're the original author of the failing test :) But the scope seems to be relevant to Account Lifecycle, so marking as such for now.

@anu-rock please let me know if you think differently here. Also, @alopezari I saw you explored it a bit, could you please confirm if you have any further plans here?

alopezari commented 1 week ago

Also, @alopezari I saw you explored it a bit, could you please confirm if you have any further plans here?

Hi @vbelolapotkov!

A ran a bit out of ideas + didn't have enough time to dedicate to this prior to the meetup, this is why I asked @frosso to create this issue. My next step would be trying to run the failing E2E locally to see how it behaves.

What I can tell so far is that we're kind of treating this failing test as flaky, but a flaky test fails intermittently and this one tends to be consistent but only when running in the Code Freeze workflow. Thereby, I'm leaning towards considering it an environmental issue rather than a flaky one, but still this is just an hypothesis and we need to keep investigating it.

vbelolapotkov commented 6 days ago

I'm changing focus to checkout as discussed here in slack: p1728902131656049-slack-C02L752DS0G @alopezari if you have spare time to play with it further and help folks, feel free to do so :)