diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ddaeea4cc..d9578fa0a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Resolves [#3205](https://github.com/microsoft/BotFramework-WebChat/issues/3205). Added Direct Line App Service Extension protocol, by [@compulim](https://github.com/compulim) in PR [#3206](https://github.com/microsoft/BotFramework-WebChat/pull/3206) + ### Fixed - Fixes [#1340](https://github.com/microsoft/BotFramework-WebChat/issues/1340). Card container should not be focusable if they do not have `tapAction`, by [@compulim](https://github.compulim) in PR [#3193](https://github.com/microsoft/BotFramework-WebChat/issues/3193) @@ -42,6 +46,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [`p-defer-es5@1.1.0`](https://npmjs.com/package/p-defer-es5) - [`web-speech-cognitive-services@7.0.0`](https://npmjs.com/package/web-speech-cognitive-services) - Updated localization strings for Estonian (Estonia) (`et-EE`), by [@LiweiMa](https://github.com/LiweiMa) in PR [#3183](https://github.com/microsoft/BotFramework-WebChat/pull/3183) +- Bumped [`botframework-directlinejs@0.12.0`](https://npmjs.com/package/botframework-directlinejs), by [@compulim](https://github.com/compulim) in PR [#3206](https://github.com/microsoft/BotFramework-WebChat/pull/3206) + +### Samples + +- Resolves [#3205](https://github.com/microsoft/BotFramework-WebChat/issues/3205). Added [Direct Line App Service Extension chat adapter](https://microsoft.github.io/BotFramework-WebChat/01.getting-started/i.protocol-direct-line-app-service-extension) sample, by [@compulim](https://github.com/compulim) in PR [#3206](https://github.com/microsoft/BotFramework-WebChat/pull/3206) ## [4.9.0] - 2020-05-11 diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-network-interruption-occurred-reconnecting-status-when-connection-is-interrupted-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-network-interruption-occurred-reconnecting-status-when-connection-is-interrupted-1-snap.png deleted file mode 100644 index 994e348e02..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-network-interruption-occurred-reconnecting-status-when-connection-is-interrupted-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-not-able-to-send-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-not-able-to-send-1-snap.png deleted file mode 100644 index 1a3ad8a5b1..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-not-able-to-send-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-sent-but-not-acknowledged-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-sent-but-not-acknowledged-1-snap.png deleted file mode 100644 index 57ada3ab80..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-send-failed-retry-when-activity-is-sent-but-not-acknowledged-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-the-connecting-connectivity-status-when-connecting-for-the-first-time-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-the-connecting-connectivity-status-when-connecting-for-the-first-time-1-snap.png deleted file mode 100644 index 23149752c6..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-display-the-connecting-connectivity-status-when-connecting-for-the-first-time-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-render-error-connectivity-status-when-a-java-script-error-is-present-in-the-code-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-render-error-connectivity-status-when-a-java-script-error-is-present-in-the-code-1-snap.png deleted file mode 100644 index df0e6f87a2..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-render-error-connectivity-status-when-a-java-script-error-is-present-in-the-code-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-1-snap.png deleted file mode 100644 index af4b745ed1..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-2-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-2-snap.png deleted file mode 100644 index ed8f2ce9d6..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-2-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-3-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-3-snap.png deleted file mode 100644 index 46764de275..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-connection-is-slow-3-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-reconnection-is-slow-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-reconnection-is-slow-1-snap.png deleted file mode 100644 index af4b745ed1..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-taking-longer-than-usual-to-connect-ui-when-reconnection-is-slow-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-unable-to-connect-ui-when-credentials-are-incorrect-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-unable-to-connect-ui-when-credentials-are-incorrect-1-snap.png deleted file mode 100644 index baaaf24ac0..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/offline-ui-js-offline-ui-should-show-unable-to-connect-ui-when-credentials-are-incorrect-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-2-snap.png b/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-2-snap.png deleted file mode 100644 index 5dc4c4f0e8..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-2-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-1-snap.png deleted file mode 100644 index 9e8805139f..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-1-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-2-snap.png b/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-2-snap.png deleted file mode 100644 index 9e8805139f..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-2-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-3-snap.png b/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-3-snap.png deleted file mode 100644 index a8213532b8..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-3-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-4-snap.png b/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-4-snap.png deleted file mode 100644 index 9e8805139f..0000000000 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-send-timeout-for-attachment-should-be-different-4-snap.png and /dev/null differ diff --git a/__tests__/__image_snapshots__/html/chat-adapter-direct-line-app-service-extension-js-direct-line-app-service-service-chat-adapter-should-connect-to-the-mock-bot-1-snap.png b/__tests__/__image_snapshots__/html/chat-adapter-direct-line-app-service-extension-js-direct-line-app-service-service-chat-adapter-should-connect-to-the-mock-bot-1-snap.png new file mode 100644 index 0000000000..a93a8949f2 Binary files /dev/null and b/__tests__/__image_snapshots__/html/chat-adapter-direct-line-app-service-extension-js-direct-line-app-service-service-chat-adapter-should-connect-to-the-mock-bot-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/speech-recognition-simple-js-speech-recognition-using-authorization-token-with-direct-line-speech-protocol-should-recognize-hello-world-1-snap.png b/__tests__/__image_snapshots__/html/speech-recognition-simple-js-speech-recognition-using-authorization-token-with-direct-line-speech-protocol-should-recognize-hello-world-1-snap.png index 5cfa1ec52a..2606098a4d 100644 Binary files a/__tests__/__image_snapshots__/html/speech-recognition-simple-js-speech-recognition-using-authorization-token-with-direct-line-speech-protocol-should-recognize-hello-world-1-snap.png and b/__tests__/__image_snapshots__/html/speech-recognition-simple-js-speech-recognition-using-authorization-token-with-direct-line-speech-protocol-should-recognize-hello-world-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-1-snap.png b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-1-snap.png new file mode 100644 index 0000000000..498592a934 Binary files /dev/null and b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-2-snap.png b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-2-snap.png new file mode 100644 index 0000000000..498592a934 Binary files /dev/null and b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-2-snap.png differ diff --git a/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-3-snap.png b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-3-snap.png new file mode 100644 index 0000000000..16ce2a8794 Binary files /dev/null and b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-4-snap.png b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-4-snap.png new file mode 100644 index 0000000000..498592a934 Binary files /dev/null and b/__tests__/__image_snapshots__/html/timestamp-attachment-send-timeout-js-timestamp-send-timeout-for-attachment-should-be-different-4-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-3-snap.png b/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-1-snap.png similarity index 100% rename from __tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-3-snap.png rename to __tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-1-snap.png diff --git a/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-2-snap.png b/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-2-snap.png new file mode 100644 index 0000000000..983c60c251 Binary files /dev/null and b/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-2-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-1-snap.png b/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-3-snap.png similarity index 96% rename from __tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-1-snap.png rename to __tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-3-snap.png index 36d65dec70..5c74f84bf0 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/timestamp-js-change-send-timeout-on-the-fly-1-snap.png and b/__tests__/__image_snapshots__/html/timestamp-change-send-timeout-js-timestamp-change-send-timeout-on-the-fly-3-snap.png differ diff --git a/__tests__/html/__jest__/WebChatEnvironment.js b/__tests__/html/__jest__/WebChatEnvironment.js index 4f753831ae..729ad27f2a 100644 --- a/__tests__/html/__jest__/WebChatEnvironment.js +++ b/__tests__/html/__jest__/WebChatEnvironment.js @@ -22,7 +22,7 @@ class WebChatEnvironment extends NodeEnvironment { this.global.abortSignal = signal; - if (this.global.docker) { + if (!this.global.docker) { const { port } = await hostServe(signal, { ...serveJSON, public: '.' diff --git a/__tests__/html/__jest__/setupRunHTMLTest.js b/__tests__/html/__jest__/setupRunHTMLTest.js index 9f3c7aa7d8..2b009352cf 100644 --- a/__tests__/html/__jest__/setupRunHTMLTest.js +++ b/__tests__/html/__jest__/setupRunHTMLTest.js @@ -26,7 +26,7 @@ global.runHTMLTest = async ( .build() : builder .forBrowser('chrome') - .usingServer('http://localhost:9515/') + .usingServer('http://localhost:9515') .setChromeOptions(chromeOptions) .build(); @@ -81,12 +81,12 @@ global.runHTMLTest = async ( } finally { // Using JSON Wire Protocol to kill Web Driver. // This is more reliable because Selenium package queue commands. - const res = await fetch(`http://localhost:4444/wd/hub/session/${sessionId}`, { method: 'DELETE' }); + const res = await fetch(`${builder.getServerUrl()}/session/${sessionId}`, { method: 'DELETE' }); if (!res.ok) { const json = await res.json(); - throw new Error(`Failed to kill WebDriver session ${sessionId}.\n\n${json && json.value && json.value.message}`); + console.warn(`Failed to kill WebDriver session ${sessionId}.\n\n${json && json.value && json.value.message}`); } } }; diff --git a/__tests__/html/chatAdapter.directLineAppServiceExtension.html b/__tests__/html/chatAdapter.directLineAppServiceExtension.html new file mode 100644 index 0000000000..d6f3e229bd --- /dev/null +++ b/__tests__/html/chatAdapter.directLineAppServiceExtension.html @@ -0,0 +1,37 @@ + + +
+ + + + + + + + diff --git a/__tests__/html/chatAdapter.directLineAppServiceExtension.js b/__tests__/html/chatAdapter.directLineAppServiceExtension.js new file mode 100644 index 0000000000..233b92bc44 --- /dev/null +++ b/__tests__/html/chatAdapter.directLineAppServiceExtension.js @@ -0,0 +1,7 @@ +/** + * @jest-environment ./__tests__/html/__jest__/WebChatEnvironment.js + */ + +describe('Direct Line App Service Service chat adapter', () => { + test('should connect to the MockBot.', () => runHTMLTest('chatAdapter.directLineAppServiceExtension.html')); +}); diff --git a/__tests__/html/offlineUI.fatalError.js b/__tests__/html/offlineUI.fatalError.js index 110ba65ac3..0dbfc4115c 100644 --- a/__tests__/html/offlineUI.fatalError.js +++ b/__tests__/html/offlineUI.fatalError.js @@ -4,5 +4,5 @@ describe('offline UI', () => { test('should show "Render error" connectivity status when a JavaScript error is present in the code.', () => - runHTMLTest('offlineUI.fatalError.html', { ignoreConsoleError: true })); + runHTMLTest('offlineUI.fatalError.html', { ignoreConsoleError: true, ignorePageError: true })); }); diff --git a/__tests__/html/offlineUI.invalidCredentials.html b/__tests__/html/offlineUI.invalidCredentials.html index 351f4f99fb..82c744e6f5 100644 --- a/__tests__/html/offlineUI.invalidCredentials.html +++ b/__tests__/html/offlineUI.invalidCredentials.html @@ -7,12 +7,37 @@ diff --git a/__tests__/html/offlineUI.invalidCredentials.js b/__tests__/html/offlineUI.invalidCredentials.js index 11f7c126a3..c2f3f563a7 100644 --- a/__tests__/html/offlineUI.invalidCredentials.js +++ b/__tests__/html/offlineUI.invalidCredentials.js @@ -4,5 +4,5 @@ describe('offline UI', () => { test('should show "unable to connect" UI when credentials are incorrect', () => - runHTMLTest('offlineUI.invalidCredentials.html')); + runHTMLTest('offlineUI.invalidCredentials.html', { ignorePageError: true })); }); diff --git a/__tests__/html/offlineUI.sendFailed.noAck.html b/__tests__/html/offlineUI.sendFailed.noAck.html index 48e81e7fd3..0b49254600 100644 --- a/__tests__/html/offlineUI.sendFailed.noAck.html +++ b/__tests__/html/offlineUI.sendFailed.noAck.html @@ -9,53 +9,57 @@ + + + + + + +