forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlayout.default.html
More file actions
78 lines (64 loc) · 2.67 KB
/
layout.default.html
File metadata and controls
78 lines (64 loc) · 2.67 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" />
<script crossorigin="anonymous" src="https://unpkg.com/react@16.8.6/umd/react.production.min.js"></script>
<script crossorigin="anonymous" src="https://unpkg.com/react-dom@16.8.6/umd/react-dom.production.min.js"></script>
<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 type="module">
import { createDefaultProps } from './setup.js';
run(
async function () {
const {
React: { createElement },
ReactDOM: { render },
testHelpers: {
createStore,
token: { fetchDirectLineToken }
},
WebChat: { createDirectLine, ReactWebChat }
} = window; // Imports in UMD fashion.
const directLine = createDirectLine({ token: await fetchDirectLineToken() });
const store = createStore();
await host.windowSize(undefined, 768, document.getElementById('webchat'));
function renderWebChat(props) {
return new Promise(resolve =>
render(
createElement(ReactWebChat, { directLine, store, ...props }),
document.getElementById('webchat'),
resolve
)
);
}
const extraProps = new URLSearchParams(location.search).has('rtl') ? { locale: 'ar-EG' } : {};
const defaultProps = createDefaultProps(extraProps);
renderWebChat(defaultProps);
await pageConditions.uiConnected();
await pageObjects.sendMessageViaSendBox('normal');
await pageConditions.numActivitiesShown(2);
await pageObjects.sendMessageViaSendBox('override avatar');
await pageConditions.numActivitiesShown(4);
await pageObjects.sendMessageViaSendBox('no avatar');
await pageConditions.numActivitiesShown(6);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot('local', { skipCheckAccessibility: true });
await renderWebChat({
...defaultProps,
styleOptions: {
...defaultProps.styleOptions,
botAvatarInitials: undefined,
userAvatarInitials: undefined
}
});
await host.snapshot('local', { skipCheckAccessibility: true });
},
{ skipCheckAccessibility: true }
);
</script>
</body>
</html>