Skip to content

Commit

Permalink
Fix: Change token API URL (#5249)
Browse files Browse the repository at this point in the history
* Change token API URL

* Update tests to use `conversationstart` command

* Use docker compose v2

* Fix ASE token

* Merge obsoleted tests

* Remove obsoleted screenshots

* Port to HTML tests

* Skip DLSpeech tests for now

* Port

* One pixel difference

* More error logging
  • Loading branch information
compulim authored Aug 5, 2024
1 parent f65f37e commit af6b947
Show file tree
Hide file tree
Showing 42 changed files with 283 additions and 320 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pull-request-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ jobs:

- run: npm clean-install

- name: Run docker-compose build
run: docker-compose -f docker-compose-wsl2.yml build --build-arg REGISTRY=mcr.microsoft.com/mirror/docker/library
- name: Run docker compose build
run: docker compose -f docker-compose-wsl2.yml build --build-arg REGISTRY=mcr.microsoft.com/mirror/docker/library

- name: Run docker-compose up
run: docker-compose -f docker-compose-wsl2.yml up --detach --scale chrome=2
- name: Run docker compose up
run: docker compose -f docker-compose-wsl2.yml up --detach --scale chrome=2

- name: Wait for Docker to be ready
run: |
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:

- if: always()
name: Print Docker logs
run: docker-compose -f docker-compose-wsl2.yml logs
run: docker compose -f docker-compose-wsl2.yml logs

- if: always()
name: Append ID to test result
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 0 additions & 139 deletions __tests__/fileAttachment.js

This file was deleted.

33 changes: 0 additions & 33 deletions __tests__/hooks/useReferenceGrammarId.js

This file was deleted.

Binary file added __tests__/html/assets/uploads/empty.zip
Binary file not shown.
11 changes: 5 additions & 6 deletions __tests__/html/chatAdapter.directLineAppServiceExtension.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -10,19 +10,18 @@
<main id="webchat"></main>
<script>
run(async function () {
const { domain, token } = await testHelpers.token.fetchDirectLineAppServiceExtensionToken();

WebChat.renderWebChat(
{
directLine: await WebChat.createDirectLineAppServiceExtension({
domain: 'https://webchat-mockbot3.azurewebsites.net/.bot/v3/directline',
token: await testHelpers.token.fetchDirectLineAppServiceExtensionToken()
}),
directLine: await WebChat.createDirectLineAppServiceExtension({ domain, token }),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();
await pageObjects.sendMessageViaSendBox('Hello, World!', { waitForSend: true });
await pageObjects.sendMessageViaSendBox('echo Hello, World!', { waitForSend: true });
await pageConditions.minNumActivitiesShown(3);

await host.snapshot();
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/chatAdapter.directLineSpeech.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */

describe('Direct Line Speech chat adapter', () => {
test('should connect to the MockBot.', () => runHTML('chatAdapter.directLineSpeech.html'));
test.skip('should connect to the MockBot.', () => runHTML('chatAdapter.directLineSpeech.html'));
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -14,16 +14,16 @@
WebChat.renderWebChat(
{
directLine: WebChat.createDirectLine({
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
8 changes: 4 additions & 4 deletions __tests__/html/conversationStartProperties.sendEnUs.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -17,16 +17,16 @@
conversationStartProperties: {
locale: 'en-US'
},
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -17,16 +17,16 @@
conversationStartProperties: {
locale: { invalid: true }
},
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -17,16 +17,16 @@
conversationStartProperties: {
locale: 'xx-YY'
},
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -17,16 +17,16 @@
conversationStartProperties: {
locale: '1a2b3c'
},
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
8 changes: 4 additions & 4 deletions __tests__/html/conversationStartProperties.sendZhCn.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
Expand All @@ -17,16 +17,16 @@
conversationStartProperties: {
locale: 'zh-CN'
},
token: await testHelpers.token.fetchDirectLineToken(
'https://webchat-mockbot3.azurewebsites.net/api/token/directline'
)
token: await testHelpers.token.fetchDirectLineToken()
}),
store: testHelpers.createStore()
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await pageObjects.sendMessageViaSendBox('conversationstart');
await pageConditions.minNumActivitiesShown(1);

await host.snapshot();
Expand Down
Loading

0 comments on commit af6b947

Please sign in to comment.