-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// eslint-disable-next-line @typescript-eslint/triple-slash-reference | ||
/// <reference path="../../support/index.d.ts" /> | ||
|
||
describe("xApps Overlay", () => { | ||
beforeEach(() => { | ||
cy | ||
.visitWebchat() | ||
.initMockWebchat() | ||
.openWebchat() | ||
.startConversation() | ||
}) | ||
|
||
it("opens overlay automatically", () => { | ||
cy.withMessageFixture('xApps-overlay-autoOpen', () => { | ||
cy.get('.logoNameContainer').contains('XApp Title 1'); | ||
}) | ||
}) | ||
|
||
it("closes overlay on close-button click", () => { | ||
cy.withMessageFixture('xApps-overlay-autoOpen', () => { | ||
cy.get('.webchat-header-close-button').click(); | ||
}) | ||
}) | ||
|
||
it("changes title on switching apps", () => { | ||
cy.withMessageFixture('xApps-overlay-autoOpen', () => { | ||
cy.wait(1000); | ||
cy.receiveMessage(null, { | ||
"_cognigy": { | ||
"_app": { | ||
"overlaySettings": { | ||
"screenTitle": "XApp Title 2", | ||
}, | ||
"url": "https://example.com" | ||
} | ||
} | ||
}); | ||
cy.get('.logoNameContainer').contains('XApp Title 2'); | ||
}) | ||
}) | ||
|
||
it("makes xApp fullscreen when no title and no close icon", () => { | ||
cy.withMessageFixture('xApps-overlay-noClose', () => { | ||
cy.get('.webchat-header-bar').should('not.exist'); | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"text": "", | ||
"data": { | ||
"_cognigy": { | ||
"_app": { | ||
"overlaySettings": { | ||
"autoOpen": true, | ||
"closeOnSubmit": false, | ||
"feedbackMessage": "", | ||
"screenTitle": "XApp Title 1", | ||
"sendEventOnCloseIconClick": true, | ||
"showCloseIcon": true | ||
}, | ||
"url": "https://example.com" | ||
} | ||
} | ||
}, | ||
"source": "bot", | ||
"traceId": "endpoint-webchat3Client-55558b3d-e839-4fb1-8311-d418add68c11", | ||
"disableSensitiveLogging": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"text": "", | ||
"data": { | ||
"_cognigy": { | ||
"_app": { | ||
"overlaySettings": { | ||
"autoOpen": true, | ||
"closeOnSubmit": false, | ||
"feedbackMessage": "", | ||
"screenTitle": "", | ||
"sendEventOnCloseIconClick": true, | ||
"showCloseIcon": false | ||
}, | ||
"url": "https://example.com" | ||
} | ||
} | ||
}, | ||
"source": "bot", | ||
"traceId": "endpoint-webchat3Client-55558b3d-e839-4fb1-8311-d418add68c11", | ||
"disableSensitiveLogging": false | ||
} |