Use stricter text selector on test (#50848)
* Use stricter text selector Removes text ambiguity to avoid errors like "Strict mode violation resolved to 2 elements". For instance, it might search for "Settings", and there might be a menu "Foo Settings" which would resolve to 2 elements. This changes the behavior to match the exact test, instead of a substring. * Update page-loads.spec.js * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
63f96eb5a8
commit
fa6ea00b3c
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Use stricter text selector on test
|
|
@ -206,7 +206,7 @@ for ( const currentPage of wcPages ) {
|
|||
} ) => {
|
||||
await page
|
||||
.locator(
|
||||
`li.wp-menu-open > ul.wp-submenu > li:has-text("${ currentPage.subpages[ i ].name }")`
|
||||
`li.wp-menu-open > ul.wp-submenu > li a:text-is("${ currentPage.subpages[ i ].name }")`
|
||||
)
|
||||
.click();
|
||||
|
||||
|
|
Loading…
Reference in New Issue