-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests for carousel and stacked layout
- Loading branch information
Showing
16 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+72.2 KB
...chrome-docker/carousel-js-carousel-with-avatar-initials-1-attachment-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...ousel-js-carousel-with-avatar-initials-1-attachment-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-32 KB
(65%)
...hrome-docker/carousel-js-carousel-with-avatar-initials-2-attachments-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92.2 KB
...usel-js-carousel-with-avatar-initials-2-attachments-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.5 KB
...ome-docker/carousel-js-carousel-without-avatar-initials-1-attachment-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+153 KB
...el-js-carousel-without-avatar-initials-1-attachment-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-38 KB
(62%)
...me-docker/carousel-js-carousel-without-avatar-initials-2-attachments-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+100 KB
...l-js-carousel-without-avatar-initials-2-attachments-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.3 KB
..._/chrome-docker/stacked-js-stacked-with-avatar-initials-1-attachment-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...tacked-js-stacked-with-avatar-initials-1-attachment-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83.7 KB
.../chrome-docker/stacked-js-stacked-with-avatar-initials-4-attachments-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.4 KB
...hrome-docker/stacked-js-stacked-without-avatar-initials-1-attachment-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+153 KB
...ked-js-stacked-without-avatar-initials-1-attachment-with-wide-screen-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+98 KB
...rome-docker/stacked-js-stacked-without-avatar-initials-4-attachments-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,135 @@ | ||
import { By, Key } from 'selenium-webdriver'; | ||
|
||
import { imageSnapshotOptions, timeouts } from './constants.json'; | ||
import directLineConnected from './setup/conditions/directLineConnected'; | ||
import minNumActivitiesReached from './setup/conditions/minNumActivitiesReached'; | ||
import webChatLoaded from './setup/conditions/webChatLoaded'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
describe('stacked without avatar initials', () => { | ||
test('4 attachments', async () => { | ||
const { driver, pageObjects } = await setupWebDriver(); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout stacked', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('1 attachment', async () => { | ||
const { driver, pageObjects } = await setupWebDriver(); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout single', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('1 attachment with wide screen', async () => { | ||
const { driver, pageObjects } = await setupWebDriver({ width: 640 }); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout single', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
}); | ||
|
||
describe('stacked with avatar initials', () => { | ||
const WEB_CHAT_PROPS = { styleOptions: { botAvatarInitials: 'BF', userAvatarInitials: 'WC' } }; | ||
|
||
test('4 attachments', async () => { | ||
const { driver, pageObjects } = await setupWebDriver({ props: WEB_CHAT_PROPS }); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout stacked', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('1 attachment', async () => { | ||
const { driver, pageObjects } = await setupWebDriver({ props: WEB_CHAT_PROPS }); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout single', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('1 attachment with wide screen', async () => { | ||
const { driver, pageObjects } = await setupWebDriver({ props: WEB_CHAT_PROPS, width: 640 }); | ||
|
||
await driver.wait(webChatLoaded(), timeouts.navigation); | ||
await driver.wait(directLineConnected(), timeouts.directLine); | ||
|
||
const input = await driver.findElement(By.css('input[type="text"]')); | ||
|
||
await input.sendKeys('layout single', Key.RETURN); | ||
await driver.wait(minNumActivitiesReached(2), timeouts.directLine); | ||
|
||
// TODO: [P2] Remove this sleep which wait for the image to be loaded | ||
await driver.sleep(1000); | ||
|
||
// Hide cursor before taking screenshot | ||
await pageObjects.hideCursor(); | ||
|
||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
}); |