-
Notifications
You must be signed in to change notification settings - Fork 242
Internal: Fix conversion banner placeholder shifting admin buttons [ED-25235] #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Ntnelbaba
merged 2 commits into
main
from
internal/ED-25235-conversion-banner-placeholder
Aug 20, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
tests/playwright/tests/conversion-banner-layout.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| import { parallelTest as test } from '../parallelTest.ts'; | ||
| import { expect } from '@playwright/test'; | ||
| import WpAdminPage from '../pages/wp-admin-page.ts'; | ||
| import { timeouts } from '../config/timeouts.ts'; | ||
|
|
||
| const emptyWelcomeAdminSettings = { | ||
| config: { | ||
| welcome: [], | ||
| config: { | ||
| nonceInstall: 'test-nonce', | ||
| slug: 'elementor', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| test.describe('Conversion banner flows [ED-25235]', () => { | ||
| test('Pages list does not mount banner when welcome config is empty', async ({ | ||
| page, | ||
| apiRequests, | ||
| }, testInfo) => { | ||
| await page.route( | ||
| '**/elementor-hello-elementor/v1/admin-settings**', | ||
| async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| contentType: 'application/json', | ||
| body: JSON.stringify(emptyWelcomeAdminSettings), | ||
| }); | ||
| }, | ||
| ); | ||
|
|
||
| const wpAdmin = new WpAdminPage(page, testInfo, apiRequests); | ||
|
|
||
| await wpAdmin.login(); | ||
|
|
||
| await page.goto('/wp-admin/edit.php?post_type=page', { | ||
| waitUntil: 'networkidle', | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| await page.waitForSelector('.wrap h1.wp-heading-inline', { | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| await page.waitForTimeout(timeouts.longAction / 5); | ||
|
|
||
| await expect(page.locator('#ehe-admin-cb')).toHaveCount(0); | ||
|
|
||
| const headingBox = await page | ||
| .locator('.wrap h1.wp-heading-inline') | ||
| .boundingBox(); | ||
| const actionBox = await page | ||
| .locator('.wrap .page-title-action') | ||
| .first() | ||
| .boundingBox(); | ||
|
|
||
| expect(headingBox).not.toBeNull(); | ||
| expect(actionBox).not.toBeNull(); | ||
|
|
||
| if (headingBox && actionBox) { | ||
| expect(actionBox.y).toBeLessThan(headingBox.y + headingBox.height + 8); | ||
| } | ||
| }); | ||
|
|
||
| test('Hello settings page still loads without conversion banner regressions', async ({ | ||
| page, | ||
| apiRequests, | ||
| }, testInfo) => { | ||
| const wpAdmin = new WpAdminPage(page, testInfo, apiRequests); | ||
|
|
||
| await wpAdmin.login(); | ||
|
|
||
| await page.goto('/wp-admin/admin.php?page=hello-elementor-settings', { | ||
| waitUntil: 'networkidle', | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| await expect(page.locator('#ehe-admin-settings')).toBeVisible({ | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| const bannerCount = await page.locator('#ehe-admin-cb').count(); | ||
|
|
||
| if (bannerCount > 0) { | ||
| const action = page.locator('.wrap .page-title-action').first(); | ||
| const banner = page.locator('#ehe-admin-cb'); | ||
|
|
||
| if ((await action.count()) > 0) { | ||
| const isAfterAction = await page.evaluate(() => { | ||
| const actionNode = document.querySelector('.wrap .page-title-action'); | ||
| const bannerNode = document.getElementById('ehe-admin-cb'); | ||
|
|
||
| return Boolean( | ||
| actionNode && | ||
| bannerNode && | ||
| actionNode.nextElementSibling === bannerNode, | ||
| ); | ||
| }); | ||
|
|
||
| expect(isAfterAction).toBe(true); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| test('Plugins page keeps native title row when banner is absent', async ({ | ||
| page, | ||
| apiRequests, | ||
| }, testInfo) => { | ||
| const wpAdmin = new WpAdminPage(page, testInfo, apiRequests); | ||
|
|
||
| await wpAdmin.login(); | ||
|
|
||
| await page.goto('/wp-admin/plugins.php', { | ||
| waitUntil: 'networkidle', | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| await page.waitForSelector('.wrap h1', { | ||
| timeout: timeouts.longAction, | ||
| }); | ||
|
|
||
| await page.waitForTimeout(timeouts.longAction / 5); | ||
|
|
||
| const banner = page.locator('#ehe-admin-cb'); | ||
| const bannerCount = await banner.count(); | ||
|
|
||
| if (bannerCount > 0) { | ||
| const heading = page.locator('.wrap h1').first(); | ||
| const action = page.locator('.wrap .page-title-action').first(); | ||
|
|
||
| if ((await action.count()) > 0) { | ||
| const isAfterAction = await page.evaluate(() => { | ||
| const actionNode = document.querySelector('.wrap .page-title-action'); | ||
| const bannerNode = document.getElementById('ehe-admin-cb'); | ||
|
|
||
| return Boolean( | ||
| actionNode && | ||
| bannerNode && | ||
| actionNode.nextElementSibling === bannerNode, | ||
| ); | ||
| }); | ||
|
|
||
| expect(isAfterAction).toBe(true); | ||
| } | ||
|
|
||
| await expect(heading).toBeVisible(); | ||
| } | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do have a ticket 25235?