From 3fc08d48f196afd270c63ec1cf1d6f6948259ad2 Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Mon, 28 Sep 2026 11:09:41 +0200 Subject: [PATCH 1/2] fix: open one main landmark on the shop pages The layout opens div#primary and main#main. WooCommerce's default content wrapper opened both a second time, inside them, on every page it renders: product grid, product page, search, cart. Two main landmarks, and two elements sharing each id. The theme now removes that wrapper. --- app/inc/woocommerce/core.php | 8 ++++++++ bin/tests/e2e/shop.spec.ts | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/app/inc/woocommerce/core.php b/app/inc/woocommerce/core.php index a78eb79..6430381 100644 --- a/app/inc/woocommerce/core.php +++ b/app/inc/woocommerce/core.php @@ -22,3 +22,11 @@ function is_woocommerce_activated(): bool return class_exists('woocommerce'); } } + +// The layout already opens div#primary and main#main; WooCommerce's default +// wrapper opened them a second time on every shop page: two main landmarks, +// two elements with the same id. +Action::add('woocommerce_init', function () { + Action::remove('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10, 0); + Action::remove('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10, 0); +}); diff --git a/bin/tests/e2e/shop.spec.ts b/bin/tests/e2e/shop.spec.ts index 58c0f2f..535c2a1 100644 --- a/bin/tests/e2e/shop.spec.ts +++ b/bin/tests/e2e/shop.spec.ts @@ -162,3 +162,20 @@ test('a product search finds the product', async ({ page }) => { expect(errors, 'no uncaught page error').toEqual([]); }); + +test('each shop page has one main landmark', async ({ page }) => { + // The layout opens main#main; WooCommerce's default content wrapper opened a second one + // inside it, with the same id, on every page it renders. + const pages = { + 'product grid': wp('eval', `echo get_term_link(${category.id}, "product_cat");`), + 'product page': simple.permalink, + 'product search': homeUrl('/?s=E2E&post_type=product'), + cart: cartUrl, + }; + + for (const [name, url] of Object.entries(pages)) { + await page.goto(url); + await expect(page.locator('main'), `${name}: main elements`).toHaveCount(1); + await expect(page.locator('[id="main"]'), `${name}: elements with id="main"`).toHaveCount(1); + } +}); From 485047c7a0402f8cce242ac9a617f3d5c7e7b089 Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Mon, 28 Sep 2026 11:16:36 +0200 Subject: [PATCH 2/2] ci: find the harness of an aliased framework develop The framework aliases develop to 13.x-dev since #335, so composer show lists 13.x-dev before dev-develop and the develop leg tried to clone a branch named 13.x-dev. --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f0fb00..e63b662 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -289,8 +289,9 @@ jobs: - name: Fetch the framework's browser test harness working-directory: site run: | - version=$(ddev composer show pollora/framework --format=json | jq -r '.versions[0]') - ref=$([ "$version" = "dev-develop" ] && echo develop || echo "$version") + # develop is aliased (13.x-dev), so dev-develop is not always the first version listed. + ref=$(ddev composer show pollora/framework --format=json \ + | jq -r '.versions | if index("dev-develop") then "develop" else .[0] end') echo "Harness from pollora/framework@$ref" git clone --quiet --depth 1 --branch "$ref" https://github.com/Pollora/framework.git ../framework mkdir -p ../framework/tests/e2e/specs/apiary