-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathonSend.html
More file actions
40 lines (34 loc) · 1.43 KB
/
onSend.html
File metadata and controls
40 lines (34 loc) · 1.43 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
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<link href="focus-indicator.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 () {
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() });
const store = testHelpers.createStore();
WebChat.renderWebChat(
{ directLine, store, styleOptions: { sendAttachmentOn: 'send' } },
document.getElementById('webchat')
);
await pageConditions.uiConnected();
// WHEN: Upload button is clicked and a JPEG file is selected.
await host.upload(pageElements.uploadButton(), 'seaofthieves.jpg');
// THEN: A checkmark should show next to the "upload button".
await host.snapshot();
// WHEN: Send button is clicked.
await host.click(pageElements.sendButton());
// THEN: A thumbnail with the bot reply should show.
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
</body>
</html>