@@ -34,45 +34,47 @@ test.describe( 'Hello Theme Admin Home Page', () => {
3434 const quickLinksTests = [
3535 {
3636 linkText : 'Site Name' ,
37- expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y / ,
37+ expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y . * a c t i v e - d o c u m e n t = \d + / ,
3838 expectedPageSection : '.elementor-control-section_settings-site-identity' ,
3939 } ,
4040 {
4141 linkText : 'Site Logo' ,
42- expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y / ,
42+ expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y . * a c t i v e - d o c u m e n t = \d + / ,
4343 expectedPageSection : '.elementor-control-section_settings-site-identity' ,
4444 } ,
4545 {
4646 linkText : 'Site Favicon' ,
47- expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y / ,
47+ expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = s e t t i n g s - s i t e - i d e n t i t y . * a c t i v e - d o c u m e n t = \d + / ,
4848 expectedPageSection : '.elementor-control-section_settings-site-identity' ,
4949 } ,
5050 {
5151 linkText : 'Site Colors' ,
52- expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = g l o b a l - c o l o r s / ,
52+ expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = g l o b a l - c o l o r s . * a c t i v e - d o c u m e n t = \d + / ,
5353 expectedPageSection : '.elementor-control-section_global_colors' ,
5454 } ,
5555 {
5656 linkText : 'Site Fonts' ,
57- expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = g l o b a l - t y p o g r a p h y / ,
57+ expectedUrlPattern : / p o s t \. p h p \? p o s t = \d + & a c t i o n = e l e m e n t o r .* a c t i v e - t a b = g l o b a l - t y p o g r a p h y . * a c t i v e - d o c u m e n t = \d + / ,
5858 expectedPageSection : '.elementor-control-section_text_style' ,
5959 } ,
6060 ] ;
61- for ( const linkTest of quickLinksTests ) {
62- await page . goto ( '/wp-admin/admin.php?page=hello-elementor' ) ;
63- const linkElement = page . locator ( `h6:has-text("${ linkTest . linkText } ") a` ) ;
64- await expect ( linkElement ) . toBeVisible ( ) ;
6561
66- await Promise . all ( [
67- page . waitForURL ( linkTest . expectedUrlPattern ) ,
68- linkElement . click ( ) ,
69- ] ) ;
62+ for ( const linkTest of quickLinksTests ) {
63+ await test . step ( linkTest . linkText , async ( ) => {
64+ await page . goto ( '/wp-admin/admin.php?page=hello-elementor' ) ;
65+ const linkElement = page . locator ( `h6:has-text("${ linkTest . linkText } ") a` ) ;
66+ await expect ( linkElement ) . toBeVisible ( ) ;
7067
71- expect ( page . url ( ) ) . toMatch ( linkTest . expectedUrlPattern ) ;
68+ await Promise . all ( [
69+ page . waitForURL ( linkTest . expectedUrlPattern ) ,
70+ linkElement . click ( ) ,
71+ ] ) ;
7272
73- await page . waitForSelector ( '#elementor-kit-panel' ) ;
74- const location = page . locator ( linkTest . expectedPageSection ) ;
75- await expect ( location ) . toBeVisible ( ) ;
73+ expect ( page . url ( ) ) . toMatch ( linkTest . expectedUrlPattern ) ;
74+ await page . waitForSelector ( '#elementor-kit-panel' ) ;
75+ const location = page . locator ( linkTest . expectedPageSection ) ;
76+ await expect ( location ) . toBeVisible ( ) ;
77+ } ) ;
7678 }
7779 } ) ;
7880} ) ;
0 commit comments