Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/admin-home/rest/admin-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private function get_elementor_editor_url( ?int $page_id, string $active_tab ):
'post' => $page_id,
'action' => 'elementor',
'active-tab' => $active_tab,
'active-document' => $active_kit_id,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have synced this with this the config from the other Hello themes.

],
admin_url( 'post.php' )
);
Expand Down
36 changes: 19 additions & 17 deletions tests/playwright/tests/admin/hello-theme-admin-home.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,47 @@ test.describe( 'Hello Theme Admin Home Page', () => {
const quickLinksTests = [
{
linkText: 'Site Name',
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity/,
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity.*active-document=\d+/,
expectedPageSection: '.elementor-control-section_settings-site-identity',
},
{
linkText: 'Site Logo',
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity/,
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity.*active-document=\d+/,
expectedPageSection: '.elementor-control-section_settings-site-identity',
},
{
linkText: 'Site Favicon',
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity/,
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=settings-site-identity.*active-document=\d+/,
expectedPageSection: '.elementor-control-section_settings-site-identity',
},
{
linkText: 'Site Colors',
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=global-colors/,
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=global-colors.*active-document=\d+/,
expectedPageSection: '.elementor-control-section_global_colors',
},
{
linkText: 'Site Fonts',
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=global-typography/,
expectedUrlPattern: /post\.php\?post=\d+&action=elementor.*active-tab=global-typography.*active-document=\d+/,
expectedPageSection: '.elementor-control-section_text_style',
},
];
for ( const linkTest of quickLinksTests ) {
await page.goto( '/wp-admin/admin.php?page=hello-elementor' );
const linkElement = page.locator( `h6:has-text("${ linkTest.linkText }") a` );
await expect( linkElement ).toBeVisible();

await Promise.all( [
page.waitForURL( linkTest.expectedUrlPattern ),
linkElement.click(),
] );
for ( const linkTest of quickLinksTests ) {
await test.step( linkTest.linkText, async () => {
await page.goto( '/wp-admin/admin.php?page=hello-elementor' );
const linkElement = page.locator( `h6:has-text("${ linkTest.linkText }") a` );
await expect( linkElement ).toBeVisible();

expect( page.url() ).toMatch( linkTest.expectedUrlPattern );
await Promise.all( [
page.waitForURL( linkTest.expectedUrlPattern ),
linkElement.click(),
] );

await page.waitForSelector( '#elementor-kit-panel' );
const location = page.locator( linkTest.expectedPageSection );
await expect( location ).toBeVisible();
expect( page.url() ).toMatch( linkTest.expectedUrlPattern );
await page.waitForSelector( '#elementor-kit-panel' );
const location = page.locator( linkTest.expectedPageSection );
await expect( location ).toBeVisible();
} );
}
} );
} );
Loading