Skip to content

Commit b50e03e

Browse files
authored
Merge branch 'main' into bump-speech-sdk-1.23.0
2 parents 8e4a84a + 68ad442 commit b50e03e

9 files changed

+102
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2424

2525
### Changed
2626

27+
- Bumped Adaptive Cards to [`adaptivecards@2.11.1`](https://npmjs.com/package/adaptivecards), by [@compulim](https://github.com/compulim) in PR [#4424](https://github.com/microsoft/BotFramework-WebChat/pull/4424)
2728
- Bumped Microsoft Cognitive Services Speech SDK to [`microsoft-cognitiveservices-speech-sdk@1.23.0`](https://npmjs.com/package/microsoft-cognitiveservices-speech-sdk), by [@compulim](https://github.com/compulim) in PR [#4424](https://github.com/microsoft/BotFramework-WebChat/pull/4435)
2829
- Also bumped [`web-speech-cognitive-services@7.1.2`](https://npmjs.com/package/web-speech-cognitive-services)
2930
- Bumped all dependencies to the latest versions, by [@compulim](https://github.com/compulim) in PR [#4423](https://github.com/microsoft/BotFramework-WebChat/pull/4423)

__tests__/html/accessibility.adaptiveCard.disabled.focus.withShowCard.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@
146146
// WHEN: Pressing TAB key.
147147
await host.sendKeys('TAB');
148148

149-
// THEN: It should focus on the first textbox (this is done by Adaptive Cards, they set tabindex="-1" on other buttons).
150-
// We just verify whatever behavior they have.
149+
// THEN: It should focus on the "Skip" button.
150+
expect(document.activeElement).toBe(document.querySelector('button[title="Skip"]'));
151+
152+
// WHEN: Pressing TAB key again.
153+
await host.sendKeys('TAB');
154+
155+
// THEN: It should focus on the textbox.
151156
expect(document.activeElement).toBe(document.querySelector('input'));
152157

153158
// WHEN: Pressing TAB key.

__tests__/html/accessibility.adaptiveCard.disabled.inputs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
'DOWN', // What color do you want? Red
7878
'DOWN', // Green
7979
'TAB',
80+
'TAB', // AC 2.11: Checkbox group container has tabindex="0"
8081
'SPACE', // What colors do you want? Red
8182
'TAB',
8283
'SPACE', // Green

__tests__/html/accessibility.liveRegion.activityStatus.sendFailed.event.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,35 @@
2929

3030
await pageConditions.uiConnected();
3131

32-
const { flush } = pageObjects.observeLiveRegion();
32+
const { disconnect, flush } = pageObjects.observeLiveRegion();
3333

34-
const sendMessage = await directLine.emulateOutgoingActivity({ name: 'hello', type: 'event', value: 'aloha' });
34+
try {
35+
const sendMessage = await directLine.emulateOutgoingActivity({
36+
name: 'hello',
37+
type: 'event',
38+
value: 'aloha'
39+
});
3540

36-
sendMessage.rejectPostActivity(new Error('artificial error'));
41+
sendMessage.rejectPostActivity(new Error('artificial error'));
3742

38-
await directLine.emulateIncomingActivity('Aloha!');
43+
await directLine.emulateIncomingActivity('Aloha!');
3944

40-
expect(flush()).toEqual(['Bot said:\nAloha!']);
45+
await pageConditions.became(
46+
'live region narrated bot message',
47+
() => {
48+
try {
49+
expect(flush()).toEqual(['Bot said:\nAloha!']);
50+
51+
return true;
52+
} catch {
53+
return false;
54+
}
55+
},
56+
1000
57+
);
58+
} finally {
59+
disconnect();
60+
}
4161
},
4262
{ ignoreErrors: true }
4363
);

__tests__/html/accessibility.liveRegion.activityStatus.sendFailed.html

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,45 @@
2929

3030
await pageConditions.uiConnected();
3131

32-
const { flush } = pageObjects.observeLiveRegion();
32+
const { disconnect, flush } = pageObjects.observeLiveRegion();
3333

34-
const sendMessage = await directLine.emulateOutgoingActivity('Hello, World!');
34+
try {
35+
const sendMessage = await directLine.emulateOutgoingActivity('Hello, World!');
3536

36-
await directLine.emulateIncomingActivity('Aloha!');
37+
await directLine.emulateIncomingActivity('Aloha!');
3738

38-
sendMessage.rejectPostActivity(new Error('artificial error'));
39+
sendMessage.rejectPostActivity(new Error('artificial error'));
3940

40-
await pageConditions.became(
41-
'failed to send message',
42-
() => pageElements.activityStatuses()[0]?.innerText === 'Send failed. Retry.',
43-
1000
44-
);
41+
await pageConditions.became(
42+
'failed to send message',
43+
() => pageElements.activityStatuses()[0]?.innerText === 'Send failed. Retry.',
44+
1000
45+
);
46+
47+
const liveRegionText = [];
48+
49+
await pageConditions.became(
50+
'live region narrated failed to send message',
51+
() => {
52+
try {
53+
liveRegionText.push(...flush());
54+
55+
expect(liveRegionText).toEqual([
56+
'You said:\nHello, World!',
57+
'Bot said:\nAloha!',
58+
'Failed to send message.'
59+
]);
4560

46-
expect(flush()).toEqual(['You said:\nHello, World!', 'Bot said:\nAloha!', 'Failed to send message.']);
61+
return true;
62+
} catch (err) {
63+
return false;
64+
}
65+
},
66+
1000
67+
);
68+
} finally {
69+
disconnect();
70+
}
4771
},
4872
{ ignoreErrors: true }
4973
);

__tests__/html/accessibility.liveRegion.activityStatus.sendFailed.typing.html

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,31 @@
2929

3030
await pageConditions.uiConnected();
3131

32-
const { flush } = pageObjects.observeLiveRegion();
33-
34-
const sendMessage = await directLine.emulateOutgoingActivity({ type: 'typing' });
35-
36-
sendMessage.rejectPostActivity(new Error('artificial error'));
37-
38-
await directLine.emulateIncomingActivity('Aloha!');
39-
40-
expect(flush()).toEqual(['Bot said:\nAloha!']);
32+
const { disconnect, flush } = pageObjects.observeLiveRegion();
33+
34+
try {
35+
const sendMessage = await directLine.emulateOutgoingActivity({ type: 'typing' });
36+
37+
sendMessage.rejectPostActivity(new Error('artificial error'));
38+
39+
await directLine.emulateIncomingActivity('Aloha!');
40+
41+
await pageConditions.became(
42+
'live region narrated bot message',
43+
() => {
44+
try {
45+
expect(flush()).toEqual(['Bot said:\nAloha!']);
46+
47+
return true;
48+
} catch {
49+
return false;
50+
}
51+
},
52+
1000
53+
);
54+
} finally {
55+
disconnect();
56+
}
4157
},
4258
{ ignoreErrors: true }
4359
);

packages/bundle/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bundle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"dependencies": {
4949
"@babel/runtime": "7.19.0",
50-
"adaptivecards": "2.10.0",
50+
"adaptivecards": "2.11.1",
5151
"botframework-directlinejs": "0.15.1",
5252
"botframework-directlinespeech-sdk": "0.0.0-0",
5353
"botframework-webchat-api": "0.0.0-0",

packages/test/page-object/src/globals/pageObjects/observeLiveRegion.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default function observeLiveRegion() {
2222
mutationObserver.observe(liveRegionElement, { childList: true });
2323

2424
return {
25+
disconnect: () => mutationObserver.disconnect(),
2526
flush: () => liveRegionInnerTexts.splice(0),
2627
getInnerTexts: () => Object.freeze([...liveRegionInnerTexts])
2728
};

0 commit comments

Comments
 (0)