Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add messageBack support to suggested actions (#1581)
* Add messageBack support for Web Chat * Add integration test for suggested-actions command on Mockbot * Test framework fixes * Update Web Chat with DL changes * Bump botframework-directlinejs * Update Changelog.md * PR Fixes * Re-iterate on PR fixes
- Loading branch information
Corina
committed
Jan 16, 2019
1 parent
cbfa0b6
commit 77b466e
Showing
33 changed files
with
313 additions
and
88 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 added
BIN
+27.6 KB
...ommand-should-show-response-from-bot-and-no-text-from-user-on-imback-1-snap.png
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
+24.3 KB
...d-should-show-response-from-bot-and-no-text-from-user-on-messageback-1-snap.png
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
+22.9 KB
...mand-should-show-response-from-bot-and-no-text-from-user-on-postback-1-snap.png
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
+24.3 KB
...mand-should-show-response-from-bot-and-text-from-user-on-messageback-1-snap.png
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
+18.7 KB
...command-should-show-response-from-bot-and-text-from-user-on-postback-1-snap.png
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,6 @@ | ||
{ | ||
"imageSnapshotOptions": { | ||
"failureThreshold": 10, | ||
"failureThresholdType": "pixel" | ||
} | ||
} |
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
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,123 @@ | ||
import { By, Key } from 'selenium-webdriver'; | ||
import { imageSnapshotOptions } from './constants.json'; | ||
|
||
function sleep(ms = 1000) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
describe('suggested-actions command', async () => { | ||
|
||
test('should show response from bot and no text from user on imback', async () => { | ||
const { driver } = await setupWebDriver(); | ||
|
||
await sleep(2000); | ||
|
||
const input = await driver.findElement(By.tagName('input[type="text"]')); | ||
|
||
await input.sendKeys('suggested-actions', Key.RETURN); | ||
await sleep(2000); | ||
|
||
const buttons = await driver.findElements(By.tagName('button')); | ||
|
||
const imBackButton = buttons[1]; | ||
|
||
await imBackButton.click(); | ||
await sleep(2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('should show response from bot and no text from user on postback', async () => { | ||
const { driver } = await setupWebDriver(); | ||
|
||
await sleep(2000); | ||
|
||
const input = await driver.findElement(By.tagName('input[type="text"]')); | ||
|
||
await input.sendKeys('suggested-actions', Key.RETURN); | ||
await sleep(2000); | ||
|
||
const buttons = await driver.findElements(By.tagName('button')); | ||
|
||
const postBackStringButton = buttons[2]; | ||
|
||
await postBackStringButton.click(); | ||
await sleep(2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('should show response from bot and text from user on postback', async () => { | ||
const { driver } = await setupWebDriver(); | ||
|
||
await sleep(2000); | ||
|
||
const input = await driver.findElement(By.tagName('input[type="text"]')); | ||
|
||
await input.sendKeys('suggested-actions', Key.RETURN); | ||
await sleep(2000); | ||
|
||
const buttons = await driver.findElements(By.tagName('button')); | ||
|
||
const postBackStringButton = buttons[3]; | ||
|
||
await postBackStringButton.click(); | ||
await sleep(2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
|
||
test('should show response from bot and no text from user on messageback', async () => { | ||
const { driver } = await setupWebDriver(); | ||
|
||
await sleep(2000); | ||
|
||
const input = await driver.findElement(By.tagName('input[type="text"]')); | ||
|
||
await input.sendKeys('suggested-actions', Key.RETURN); | ||
await sleep(2000); | ||
|
||
const buttons = await driver.findElements(By.tagName('button')); | ||
|
||
const postBackStringButton = buttons[4]; | ||
|
||
await postBackStringButton.click(); | ||
await sleep(2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
|
||
test('should show response from bot and text from user on messageback', async () => { | ||
const { driver } = await setupWebDriver(); | ||
|
||
await sleep(2000); | ||
|
||
const input = await driver.findElement(By.tagName('input[type="text"]')); | ||
|
||
await input.sendKeys('suggested-actions', Key.RETURN); | ||
await sleep(2000); | ||
|
||
const buttons = await driver.findElements(By.tagName('button')); | ||
|
||
const postBackStringButton = buttons[4]; | ||
|
||
await postBackStringButton.click(); | ||
await sleep(2000); | ||
|
||
const base64PNG = await driver.takeScreenshot(); | ||
|
||
expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); | ||
}, 60000); | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.