woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
47 stars 21 forks source link

WordPress 6.7 Compatibility: Fix the issue that E2E test can't log in to wp-admin #2668

Closed eason9487 closed 1 week ago

eason9487 commented 1 week ago

Changes proposed in this Pull Request:

With WordPress 6.7-RC3, the E2E test failed to start due to match two elements when trying to click the "Log In" button.

Trying to log-in as admin...
Admin log-in failed, Retrying... 0/5
locator.click: Error: strict mode violation: locator('text=Log In') resolved to 2 elements:
    1) <h1 class="screen-reader-text">Log In</h1> aka getByRole('heading', { name: 'Log In' })
    2) <input type="submit" id="wp-submit" value="Log In" name="wp-submit" class="button button-primary button-large"/> aka getByRole('button', { name: 'Log In' })

This PR ensures that it can locate the "Log In" button.

📌 The failed test case will be handled in a separate RP.

Detailed test instructions:

  1. View the failed run: https://github.com/woocommerce/google-listings-and-ads/actions/runs/11774628750/job/32793771070#step:10:20
  2. View the successful log-in run: https://github.com/woocommerce/google-listings-and-ads/actions/runs/11775116109/job/32794945918#step:10:18

Changelog entry

Dev - WordPress 6.7 Compatibility: Fix the issue that E2E test can't log in to wp-admin.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 62.7%. Comparing base (0383264) to head (1f90028). Report is 6 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2668/graphs/tree.svg?width=650&height=150&src=pr&token=UROWUPF1LX&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2668?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) ```diff @@ Coverage Diff @@ ## develop #2668 +/- ## ======================================= Coverage 62.7% 62.7% ======================================= Files 319 319 Lines 5074 5074 Branches 1231 1231 ======================================= Hits 3180 3180 Misses 1721 1721 Partials 173 173 ``` | [Flag](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2668/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [js-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `62.7% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#carryforward-flags-in-the-pull-request-comment) to find out more.
eason9487 commented 1 week ago

Hi @mikkamp, thanks for the review!

Just curious if some of those other tweaks are needed as well, [...]

The current login process looks good. I think we can keep it as it is.