@@ -699,7 +699,10 @@ export class OnboardingPage {
699699 await this . startBrowsing ( ) ;
700700 }
701701
702- async completesOrderV3WithAdBlocking ( ) {
702+ /**
703+ * @param {'ad-blocking'|'youtube-ad-blocking' } adBlockingId
704+ */
705+ async completesOrderV3WithAdBlockingEnabled ( adBlockingId ) {
703706 const { page } = this ;
704707
705708 /* Welcome */
@@ -715,22 +718,23 @@ export class OnboardingPage {
715718 await page . getByText ( 'Excellent!' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
716719 await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
717720
718- /* System settings (with ad-blocking) */
721+ /* System settings */
719722 await page . getByText ( 'Let’s get you set up!' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
720723 const dockButton = this . build . switch ( {
721724 windows : ( ) => page . getByRole ( 'button' , { name : 'Pin to Taskbar' } ) ,
722725 apple : ( ) => page . getByRole ( 'button' , { name : 'Keep in Dock' } ) ,
723726 } ) ;
724727 await dockButton . click ( ) ;
725- await page . getByRole ( 'button' , { name : 'Turn on Enhanced Ad Blocking' , exact : true } ) . click ( ) ;
728+ await page
729+ . getByRole ( 'button' , {
730+ name : adBlockingId === 'youtube-ad-blocking' ? 'Block Ads' : 'Turn on Enhanced Ad Blocking' ,
731+ exact : true ,
732+ } )
733+ . click ( ) ;
726734 await page . getByRole ( 'button' , { name : 'Import Now' , exact : true } ) . click ( ) ;
727735 await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
728736
729- /* Duckplayer */
730- await page . getByText ( 'Drowning in ads' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
731- await page . getByLabel ( 'See Without Duck Player' ) . click ( ) ;
732- await page . getByLabel ( 'See With Duck Player' ) . click ( ) ;
733- await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
737+ /* No Duck Player step as ad blocking was enabled */
734738
735739 /* Customize */
736740 await page . getByText ( 'Let’s customize a few things' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
@@ -740,8 +744,9 @@ export class OnboardingPage {
740744 await this . startBrowsing ( ) ;
741745 }
742746
743- async completesOrderV3WithYouTubeAdBlocking ( ) {
747+ async completesOrderV3WithAdBlockingDisabled ( ) {
744748 const { page } = this ;
749+
745750 /* Welcome */
746751 await page . getByText ( 'Welcome to DuckDuckGo' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
747752
@@ -755,20 +760,19 @@ export class OnboardingPage {
755760 await page . getByText ( 'Excellent!' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
756761 await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
757762
758- /* System settings (with youtube ad-blocking) */
763+ /* System settings */
759764 await page . getByText ( 'Let’s get you set up!' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
760765 const dockButton = this . build . switch ( {
761766 windows : ( ) => page . getByRole ( 'button' , { name : 'Pin to Taskbar' } ) ,
762767 apple : ( ) => page . getByRole ( 'button' , { name : 'Keep in Dock' } ) ,
763768 } ) ;
764769 await dockButton . click ( ) ;
765- await page . getByRole ( 'button' , { name : 'Block Ads ' , exact : true } ) . click ( ) ;
770+ await page . getByRole ( 'button' , { name : 'Skip ' , exact : true } ) . click ( ) ;
766771 await page . getByRole ( 'button' , { name : 'Import Now' , exact : true } ) . click ( ) ;
767772 await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
768773
769- /* Duckplayer - alternate title/subtitle */
770- await page . getByText ( 'Watch YouTube privately with Duck Player' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
771- await expect ( page . locator ( 'h2' ) ) . toContainText ( "Watching videos in Duck Player won't influence your YouTube recommendations." ) ;
774+ /* Duck Player */
775+ await page . getByText ( 'Drowning in ads' ) . nth ( 1 ) . waitFor ( { timeout : 1000 } ) ;
772776 await page . getByLabel ( 'See Without Duck Player' ) . click ( ) ;
773777 await page . getByLabel ( 'See With Duck Player' ) . click ( ) ;
774778 await page . getByRole ( 'button' , { name : 'Next' } ) . click ( ) ;
0 commit comments