-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathtapAction.html
More file actions
78 lines (66 loc) · 2.42 KB
/
tapAction.html
File metadata and controls
78 lines (66 loc) · 2.42 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<link href="/assets/focusManagement.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 = testHelpers.createDirectLineWithTranscript([
{
attachments: [
{
contentType: 'application/vnd.microsoft.card.hero',
content: {
tap: {
type: 'imBack',
value: 'Hello, World.'
},
subtitle:
'The first `imBack` is from mouse click. The second is from `ENTER` key. The third is from `SPACEBAR` key.',
title: 'Tap on this card to say, "echo Hello, World."'
}
}
],
from: {
id: 'bot',
role: 'bot'
},
id: '1',
timestamp: new Date().toISOString(),
type: 'message'
}
]);
WebChat.renderWebChat(
{
directLine,
store: testHelpers.createStore(),
styleOptions: { subtle: '#666' }
},
document.getElementById('webchat')
);
await pageConditions.uiConnected();
// When using runHookActivityMiddleware, an additional hidden activities will be rendered to run the hook function. Thus, minNumActivitiesShown must be +1.
await pageConditions.numActivitiesShown(1);
const renderer = document.querySelector('.adaptive-card-renderer');
const card = renderer.querySelector('.ac-adaptiveCard[tabindex="0"]');
expect(card).toBeTruthy();
await host.click(renderer);
await pageConditions.numActivitiesShown(2);
card.focus();
await host.sendKeys('\n');
await pageConditions.numActivitiesShown(3);
card.focus();
await host.sendKeys(' ');
await pageConditions.numActivitiesShown(4);
await pageConditions.scrollToBottomCompleted();
await host.snapshot('local');
});
</script>
</body>
</html>