|
| 1 | +<!doctype html> |
| 2 | +<html lang="en-US"> |
| 3 | + <head> |
| 4 | + <link href="/assets/index.css" rel="stylesheet" type="text/css" /> |
| 5 | + <script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone/babel.min.js"></script> |
| 6 | + <script crossorigin=" anonymous" src=" https://unpkg.com/[email protected]/umd/react.production.min.js" ></script> |
| 7 | + <script crossorigin=" anonymous" src=" https://unpkg.com/[email protected]/umd/react-dom.production.min.js" ></script> |
| 8 | + <script crossorigin="anonymous" src="/test-harness.js"></script> |
| 9 | + <script crossorigin="anonymous" src="/test-page-object.js"></script> |
| 10 | + <script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> |
| 11 | + <style type="text/css"> |
| 12 | + .my-webchat { |
| 13 | + --webchat__max-width--attachment-bubble: 80%; |
| 14 | + --webchat__min-width--attachment-bubble: 80%; |
| 15 | + |
| 16 | + --webchat__max-width--message-bubble: 75%; |
| 17 | + --webchat__min-width--message-bubble: 75%; |
| 18 | + |
| 19 | + --webchat__max-height--image-bubble: initial; |
| 20 | + --webchat__min-height--image-bubble: initial; |
| 21 | + } |
| 22 | + </style> |
| 23 | + </head> |
| 24 | + <body> |
| 25 | + <main id="webchat"></main> |
| 26 | + <script type="text/babel"> |
| 27 | + run(async function () { |
| 28 | + const { |
| 29 | + React, |
| 30 | + ReactDOM: { render }, |
| 31 | + WebChat: { ReactWebChat } |
| 32 | + } = window; // Imports in UMD fashion. |
| 33 | + |
| 34 | + const { directLine, store } = testHelpers.createDirectLineEmulator(); |
| 35 | + |
| 36 | + const styleOptions = { |
| 37 | + bubbleMaxWidth: '75%', |
| 38 | + bubbleMinWidth: '75%' |
| 39 | + }; |
| 40 | + |
| 41 | + render( |
| 42 | + <ReactWebChat className="my-webchat" directLine={directLine} store={store} />, |
| 43 | + document.getElementById('webchat') |
| 44 | + ); |
| 45 | + |
| 46 | + await pageConditions.uiConnected(); |
| 47 | + |
| 48 | + await directLine.emulateIncomingActivity({ |
| 49 | + from: { role: 'bot' }, |
| 50 | + text: 'Dolore excepteur laboris.', |
| 51 | + type: 'message' |
| 52 | + }); |
| 53 | + |
| 54 | + await directLine.emulateIncomingActivity({ |
| 55 | + from: { role: 'bot' }, |
| 56 | + text: 'Reprehenderit exercitation do aliqua ad reprehenderit pariatur fugiat et deserunt mollit mollit.', |
| 57 | + type: 'message' |
| 58 | + }); |
| 59 | + |
| 60 | + await directLine.emulateIncomingActivity({ |
| 61 | + attachments: [ |
| 62 | + { |
| 63 | + contentType: 'image/png', |
| 64 | + contentUrl: |
| 65 | + 'https://raw.githubusercontent.com/microsoft/BotFramework-WebChat/main/media/BotFrameworkWebChat_header.png' |
| 66 | + }, |
| 67 | + { |
| 68 | + contentType: 'image/png', |
| 69 | + contentUrl: |
| 70 | + 'https://raw.githubusercontent.com/microsoft/BotFramework-WebChat/main/media/BotFrameworkWebChat_header.png' |
| 71 | + } |
| 72 | + ], |
| 73 | + from: { role: 'bot' }, |
| 74 | + text: 'Sunt elit ad voluptate.', |
| 75 | + type: 'message' |
| 76 | + }); |
| 77 | + |
| 78 | + await directLine.emulateIncomingActivity({ |
| 79 | + attachmentLayout: 'carousel', |
| 80 | + attachments: [ |
| 81 | + { |
| 82 | + contentType: 'image/png', |
| 83 | + contentUrl: |
| 84 | + 'https://raw.githubusercontent.com/microsoft/BotFramework-WebChat/main/media/BotFrameworkWebChat_header.png' |
| 85 | + }, |
| 86 | + { |
| 87 | + contentType: 'image/png', |
| 88 | + contentUrl: |
| 89 | + 'https://raw.githubusercontent.com/microsoft/BotFramework-WebChat/main/media/BotFrameworkWebChat_header.png' |
| 90 | + } |
| 91 | + ], |
| 92 | + from: { role: 'bot' }, |
| 93 | + text: 'Sint aliqua nisi aute aliqua.', |
| 94 | + type: 'message' |
| 95 | + }); |
| 96 | + |
| 97 | + await directLine.emulateIncomingActivity({ |
| 98 | + attachments: [ |
| 99 | + { |
| 100 | + contentType: 'image/png', |
| 101 | + thumbnailUrl: |
| 102 | + 'https://raw.githubusercontent.com/microsoft/BotFramework-WebChat/main/media/BotFrameworkWebChat_header.png' |
| 103 | + } |
| 104 | + ], |
| 105 | + from: { role: 'user' }, |
| 106 | + text: 'Ut irure irure exercitation.', |
| 107 | + type: 'message' |
| 108 | + }); |
| 109 | + |
| 110 | + await pageConditions.numActivitiesShown(5); |
| 111 | + |
| 112 | + await host.snapshot('local'); |
| 113 | + }); |
| 114 | + </script> |
| 115 | + </body> |
| 116 | +</html> |
0 commit comments