-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathautoScroll.withSuggestedActions.submitAdaptiveCards.html
More file actions
47 lines (39 loc) · 1.72 KB
/
autoScroll.withSuggestedActions.submitAdaptiveCards.html
File metadata and controls
47 lines (39 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
WebChat.renderWebChat(
{
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);
await pageConditions.uiConnected();
// GIVEN: A ready-to-submit Adaptive Card with suggested actions shown below
await pageObjects.sendMessageViaSendBox('card inputs', { waitForSend: true });
await pageConditions.minNumActivitiesShown(2);
await pageObjects.sendMessageViaSendBox('suggested-actions', { waitForSend: true });
await pageConditions.suggestedActionsShown();
await pageConditions.scrollToBottomCompleted();
// To submit the input form, the number field is mandatory.
document.querySelector('.ac-adaptiveCard input[type="number"]').value = '1';
// WHEN: The Adaptive Card is being submitted.
const submitButton = await document.querySelector('button.ac-pushButton:nth-of-type(2)');
await submitButton.click();
await pageConditions.minNumActivitiesShown(5);
// THEN: It should stick to the bottom.
await pageConditions.scrollToBottomCompleted();
await host.snapshot('local');
});
</script>
</body>
</html>