File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,17 @@ const closeOverlay = async (customCloseButtonId?: string) => {
4545 await closeButton . waitForDisplayed ( { timeout : 22000 } ) ;
4646 await closeButton . click ( ) ;
4747} ;
48+
49+ const closeModalOverlay = async ( customCloseButtonId ?: string ) => {
50+ const buttonId = browser . isAndroid ? `~Close` : customCloseButtonId || `~intercom modal close button` ;
51+
52+ const closeButton = await $ ( buttonId ) ;
53+ await closeButton . waitForDisplayed ( { timeout : 22000 } ) ;
54+ await closeButton . click ( ) ;
55+ } ;
56+
4857browser . addCommand ( 'closeOverlay' , closeOverlay ) ;
58+ browser . addCommand ( 'closeModalOverlay' , closeModalOverlay ) ;
4959
5060const closeArticleOverlay = async ( ) => {
5161 if ( browser . isAndroid ) {
@@ -55,7 +65,7 @@ const closeArticleOverlay = async () => {
5565 await closeButton . waitForDisplayed ( { timeout : 22000 } ) ;
5666 await closeButton . click ( ) ;
5767 } else {
58- await closeOverlay ( ) ;
68+ await closeModalOverlay ( ) ;
5969 }
6070} ;
6171browser . addCommand ( 'closeArticleOverlay' , closeArticleOverlay ) ;
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ describe('Intercom E2E', () => {
7070 it ( 'Should display carousel' , async ( ) => {
7171 await driver . scrollToElementByAccessibilityLabel ( 'display-carousel' ) ;
7272 await ( await $ ( '~display-carousel' ) ) . click ( ) ;
73- await driver . closeOverlay ( ) ;
73+ await driver . closeModalOverlay ( ) ;
7474 } ) ;
7575
7676 it ( 'Should get unread messages count' , async ( ) => {
You can’t perform that action at this time.
0 commit comments