@@ -22,14 +22,16 @@ test.describe( 'Upsell', () => {
2222 await page . getByRole ( 'button' , { name : 'Classic Builder Step-by-step' } ) . click ( ) ;
2323 await page . waitForSelector ( 'h1:text("Visualizer")' ) ;
2424
25- expect ( await page . frameLocator ( 'iframe' ) . locator ( '.pro-upsell' ) . count ( ) ) . toBe ( 11 ) ;
25+ const frame = page . frameLocator ( 'iframe' ) ;
26+ await expect ( frame . locator ( '#type-picker' ) ) . toBeVisible ( { timeout : 10000 } ) ;
27+ await expect ( frame . locator ( '.pro-upsell' ) ) . toHaveCount ( 11 ) ;
2628
27- const proUpsellElements = await page . frameLocator ( 'iframe' ) . locator ( 'a.pro-upsell' ) . all ( ) ;
29+ const proUpsellElements = await frame . getByRole ( 'link' , { name : 'Upgrade Now' } ) . all ( ) ;
2830
2931 for ( const element of proUpsellElements ) {
3032 const href = await element . getAttribute ( 'href' ) ;
3133 const searchParams = new URLSearchParams ( href ) ;
32- expect ( searchParams . get ( 'utm_campaign' ) ) . toBe ( 'charttypes ' ) ;
34+ expect ( searchParams . get ( 'utm_campaign' ) ) . toBe ( 'procharts ' ) ;
3335 }
3436 } ) ;
3537
@@ -65,15 +67,15 @@ test.describe( 'Upsell', () => {
6567 href = await wpImportUpsell . getAttribute ( 'href' ) ;
6668 searchParams = new URLSearchParams ( href ) ;
6769 expect ( searchParams . get ( 'utm_campaign' ) ) . toBe ( 'import-wp' ) ;
68- await page . frameLocator ( 'iframe' ) . getByRole ( 'heading ' , { name : / I m p o r t f r o m W o r d P r e s s / } ) . click ( ) ;
70+ await page . frameLocator ( 'iframe' ) . getByRole ( 'button ' , { name : / I m p o r t f r o m W o r d P r e s s / } ) . click ( ) ;
6971 await expect ( page . frameLocator ( 'iframe' ) . locator ( '#vz-chart-source' ) ) . toContainText ( 'Upgrade to PRO to activate this feature!' ) ;
7072
7173 const dbImportUpsell = page . frameLocator ( 'iframe' ) . locator ( '#vz-chart-source .visualizer_source_query .only-pro-inner a' ) . last ( ) ;
7274 href = await dbImportUpsell . getAttribute ( 'href' ) ;
7375 searchParams = new URLSearchParams ( href ) ;
7476 expect ( searchParams . get ( 'utm_campaign' ) ) . toBe ( 'db-query' ) ;
7577
76- await page . frameLocator ( 'iframe' ) . getByRole ( 'heading ' , { name : / I m p o r t f r o m d a t a b a s e / } ) . click ( ) ;
78+ await page . frameLocator ( 'iframe' ) . getByRole ( 'button ' , { name : / I m p o r t f r o m d a t a b a s e / } ) . click ( ) ;
7779 await expect ( page . frameLocator ( 'iframe' ) . locator ( '#vz-db-wizard' ) ) . toContainText ( 'Upgrade to Plus plan to activate this feature!' ) ;
7880 await expect ( page . frameLocator ( 'iframe' ) . locator ( '#vz-db-wizard' ) ) . toContainText ( 'Upgrade Now' ) ;
7981
@@ -93,7 +95,7 @@ test.describe( 'Upsell', () => {
9395 href = await chartPermissionsUpsell . getAttribute ( 'href' ) ;
9496 searchParams = new URLSearchParams ( href ) ;
9597 expect ( searchParams . get ( 'utm_campaign' ) ) . toBe ( 'chart-permissions' ) ;
96- await page . frameLocator ( 'iframe' ) . getByRole ( 'heading ' , { name : / P e r m i s s i o n s / } ) . click ( ) ;
98+ await page . frameLocator ( 'iframe' ) . getByRole ( 'button ' , { name : / P e r m i s s i o n s / } ) . click ( ) ;
9799 await expect ( page . frameLocator ( 'iframe' ) . locator ( '#vz-db-wizard' ) ) . toContainText ( 'Upgrade to Plus plan to activate this feature!' ) ;
98100 await expect ( page . frameLocator ( 'iframe' ) . locator ( '#vz-db-wizard' ) ) . toContainText ( 'Upgrade Now' ) ;
99101 } ) ;
0 commit comments