Skip to content

Do not wait for X page content when clicking the BO login X link - #1103

Merged
Progi1984 merged 1 commit into
PrestaShop:mainfrom
jolelievre:fix-bo-login-x-link
Aug 20, 2026
Merged

Do not wait for X page content when clicking the BO login X link#1103
Progi1984 merged 1 commit into
PrestaShop:mainfrom
jolelievre:fix-bo-login-x-link

Conversation

@jolelievre

Copy link
Copy Markdown
Contributor

Problem

functional:BO:login is currently failing on every PR (unrelated to the PR content) on the should click on "X icon" step of functional/BO/00_login/04_checkLinks.ts:

1) BO - Login : Check links
     should click on "X icon":
   page.waitForSelector: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('body') to be visible
    24 × locator resolved to hidden <body></body>

    at LoginPage.waitForVisibleSelector (dist/pages/commonPage.js:99:16)
    at LoginPage.<anonymous> (dist/pages/commonPage.js:228:28)

Example run: https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/32339819748/job/96436929714

Cause

X (twitter) now blocks headless browsers: https://x.com/PrestaShop answers with a completely empty document. Playwright then considers body hidden (an empty body has no layout box), so the waitForVisibleSelector(newPage, 'body') done at the end of openLinkWithTargetBlank() can never resolve.

Probing the four links of the BO login footer with headless chromium confirms X is the only one affected:

Link body visible body children
https://x.com/PrestaShop false 0
https://www.facebook.com/prestashop true 70
https://github.com/PrestaShop/PrestaShop true 4
https://www.prestashop-project.org/ true 6

The page URL is still correct (https://x.com/PrestaShop), so the assertion made by the test remains relevant — only waiting for the page to render is impossible now.

Fix

Open the X link without waiting for the new page content (waitForVisible: false), which is already what clickOnSocialSharingLink() does for the FO social sharing links (src/versions/develop/pages/FO/classic/product/index.ts). Facebook, GitHub and prestashop-project.org are left untouched since they still render fine.

The older versions (8.0, 8.1, 1.7.2) extend the develop login page, so they all get the fix.

How to test

From tests/UI of a shop using this branch:

TEST_PATH='functional/BO/00_login/04*' npm run test:specific

Before:

1 passing, 5 failing (the X step fails, the following steps cascade)

After:

BO - Login : Check links
  ✔ should open the BO authentication page
  ✔ should click on the shop name on the top left corner
  ✔ should go back to login page
  ✔ should click on "[© PrestaShop™ 2007-2024 - All rights reserved"
  ✔ should close the Prestashop project page
  ✔ should click on "X icon"
  ✔ should close the twitter page
  ✔ should click on "Facebook icon"
  ✔ should close the facebook page
  ✔ should click on "Github icon"

10 passing (7s)

@jolelievre
jolelievre requested a review from a team as a code owner August 20, 2026 14:56
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Aug 20, 2026
@jolelievre

Copy link
Copy Markdown
Contributor Author

Hello @Progi1984
we have the same error on multiple UI tests (unrelated to the login page) I think maybe something changes in the way the x/twitter is opened (from their side) that is now wrongly detected This PR should fix the problem, and I think it's common to any versions so it shoud be fixed in the develop version

Once this PR is accepted I'll integrate it in the merge PR PrestaShop/PrestaShop#42384 So the whole fix will go up as we perform the merge PRs then

@Progi1984
Progi1984 merged commit 249a6a9 into PrestaShop:main Aug 20, 2026
2 checks passed
@Progi1984 Progi1984 added this to the 0.0.12 milestone Aug 20, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Merged in PR Dashboard Aug 20, 2026
@jolelievre
jolelievre deleted the fix-bo-login-x-link branch August 20, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants