-
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.
Added required text to card action type messageBack (#3003)
* Added required text to card action type messageBack * Added required text to card action type messageBack * Add tests * Add entry * Clean up Co-authored-by: Guy Ambar <[email protected]> Co-authored-by: William Wong <[email protected]>
- Loading branch information
1 parent
ef2629b
commit 15d89bd
Showing
10 changed files
with
94 additions
and
3 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
+37.4 KB
...shots__/chrome-docker/hero-card-actions-js-hero-card-actions-im-back-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
+38.2 KB
...ero-card-actions-js-hero-card-actions-message-back-display-text-text-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
+32.8 KB
...rd-actions-js-hero-card-actions-message-back-display-text-text-value-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
+32.5 KB
...ome-docker/hero-card-actions-js-hero-card-actions-message-back-value-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
+32.5 KB
.../chrome-docker/hero-card-actions-js-hero-card-actions-post-back-json-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
+34.7 KB
...hrome-docker/hero-card-actions-js-hero-card-actions-post-back-string-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,90 @@ | ||
import { By, until } from 'selenium-webdriver'; | ||
|
||
import { imageSnapshotOptions, timeouts } from './constants.json'; | ||
|
||
import minNumActivitiesShown from './setup/conditions/minNumActivitiesShown'; | ||
import scrollToBottomCompleted from './setup/conditions/scrollToBottomCompleted'; | ||
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); | ||
jest.setTimeout(15000); | ||
|
||
describe('hero card actions', () => { | ||
let driver; | ||
|
||
async function clickHeroCardButton(nthChild) { | ||
await driver.wait( | ||
() => | ||
driver.executeScript(nthChild => { | ||
const button = document.querySelector('.ac-actionSet button:nth-of-type(' + nthChild + ')'); | ||
|
||
button && button.click(); | ||
|
||
return button; | ||
}, nthChild), | ||
timeouts.ui | ||
); | ||
} | ||
|
||
beforeEach(async () => { | ||
const setup = await setupWebDriver({ useProductionBot: true }); | ||
|
||
driver = setup.driver; | ||
|
||
await driver.wait(uiConnected(), timeouts.directLine); | ||
|
||
await setup.pageObjects.sendMessageViaSendBox('herocardactions'); | ||
await driver.wait(minNumActivitiesShown(2), timeouts.directLine); | ||
}); | ||
|
||
test('imBack', async () => { | ||
await clickHeroCardButton(1); | ||
|
||
await driver.wait(minNumActivitiesShown(4), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); | ||
|
||
test('postBack (string)', async () => { | ||
await clickHeroCardButton(2); | ||
|
||
await driver.wait(minNumActivitiesShown(3), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); | ||
|
||
test('postBack (JSON)', async () => { | ||
await clickHeroCardButton(3); | ||
|
||
await driver.wait(minNumActivitiesShown(3), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); | ||
|
||
test('messageBack (displayText + text + value)', async () => { | ||
await clickHeroCardButton(4); | ||
|
||
await driver.wait(minNumActivitiesShown(4), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); | ||
|
||
test('messageBack (displayText + text)', async () => { | ||
await clickHeroCardButton(5); | ||
|
||
await driver.wait(minNumActivitiesShown(4), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).toMatchImageSnapshot(imageSnapshotOptions); | ||
}); | ||
|
||
test('messageBack (value)', async () => { | ||
await clickHeroCardButton(6); | ||
|
||
await driver.wait(minNumActivitiesShown(3), timeouts.directLine); | ||
await driver.wait(scrollToBottomCompleted(), timeouts.scrollToBottom); | ||
expect(await driver.takeScreenshot()).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