-
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.
* Clean up test * Update entry
- Loading branch information
Showing
6 changed files
with
44 additions
and
25 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
Binary file removed
BIN
-18.1 KB
...ker/basic-js-sendbox-ux-should-have-a-yellow-background-when-focused-1-snap.png
Binary file not shown.
Binary file added
BIN
+16.5 KB
...-docker/send-box-js-should-focus-send-box-when-message-is-being-sent-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,41 @@ | ||
import { imageSnapshotOptions, timeouts } from './constants.json'; | ||
|
||
import minNumActivitiesShown from './setup/conditions/minNumActivitiesShown'; | ||
import uiConnected from './setup/conditions/uiConnected'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('should focus send box when message is being sent', async () => { | ||
const { driver, pageObjects } = await setupWebDriver({ | ||
createStyleSet: styleOptions => { | ||
const styleSet = window.WebChat.createStyleSet(styleOptions); | ||
|
||
return Object.assign( | ||
{}, | ||
styleSet, | ||
{ | ||
sendBox: Object.assign( | ||
{}, | ||
styleSet.sendBox, | ||
{ | ||
'& > .main > form > input:focus': { | ||
backgroundColor: 'Yellow' | ||
} | ||
} | ||
) | ||
} | ||
); | ||
} | ||
}); | ||
|
||
await driver.wait(uiConnected(), timeouts.directLine); | ||
await pageObjects.sendMessageViaSendBox('Hello, World!'); | ||
await driver.wait(minNumActivitiesShown(1), 2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); |
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