-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
344 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/@babel/[email protected]/babel.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.development.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.development.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="text/babel" data-presets="env,stage-3,react"> | ||
const { | ||
React: { useMemo }, | ||
WebChat: { | ||
hooks: { useDirection } | ||
} | ||
} = window; | ||
|
||
run(async function () { | ||
WebChat.renderWebChat( | ||
{ | ||
directLine: await testHelpers.createDirectLineWithTranscript([ | ||
{ | ||
from:{ | ||
role: "bot" | ||
}, | ||
id: "a-00000", | ||
timestamp: 0, | ||
type: "message", | ||
text: "This is compleded feedback action example.", | ||
entities: [ | ||
{ | ||
'@context': 'https://schema.org', | ||
'@id': '', | ||
'@type': 'Message', | ||
type: 'https://schema.org/Message', | ||
keywords: ['AIGeneratedContent', 'AllowCopy'], | ||
potentialAction: [ | ||
{ | ||
"@type": "LikeAction", | ||
actionStatus: "CompletedActionStatus", | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=like" | ||
} | ||
}, | ||
{ | ||
"@type": "DislikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
result: { | ||
"@type": "Review", | ||
reviewBody: "I don't like it.", | ||
"reviewBody-input": { | ||
"@type": "PropertyValueSpecification", | ||
valueMinLength: 3, | ||
valueName: "reason" | ||
} | ||
}, | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
from:{ | ||
role: "bot" | ||
}, | ||
id: "a-00002", | ||
timestamp: 0, | ||
type: "message", | ||
text: "Hi! I'm *Cody*, the devbot. How can I help?", | ||
entities: [ | ||
{ | ||
'@context': 'https://schema.org', | ||
'@id': '', | ||
'@type': 'Message', | ||
type: 'https://schema.org/Message', | ||
keywords: [], | ||
potentialAction: [ | ||
{ | ||
"@type": "LikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=like" | ||
} | ||
}, | ||
{ | ||
"@type": "DislikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
result: { | ||
"@type": "Review", | ||
reviewBody: "I don't like it.", | ||
"reviewBody-input": { | ||
"@type": "PropertyValueSpecification", | ||
valueMinLength: 3, | ||
valueName: "reason" | ||
} | ||
}, | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]), | ||
styleOptions: { | ||
feedbackActionsPlacement: 'activity-actions' | ||
}, | ||
store: testHelpers.createStore(), | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await host.snapshot('local'); | ||
|
||
pageElements.sendBoxTextBox().focus(); | ||
await host.sendShiftTab(3); | ||
|
||
await host.sendKeys('ENTER'); | ||
await host.snapshot('local'); | ||
await host.sendKeys('ENTER'); | ||
await host.snapshot('local'); | ||
await host.sendKeys('TAB'); | ||
await host.snapshot('local'); | ||
await host.sendKeys('ENTER'); | ||
await host.snapshot('local'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/@babel/[email protected]/babel.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.development.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.development.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="text/babel" data-presets="env,stage-3,react"> | ||
const { | ||
React: { useMemo }, | ||
WebChat: { | ||
hooks: { useDirection } | ||
} | ||
} = window; | ||
|
||
run(async function () { | ||
WebChat.renderWebChat( | ||
{ | ||
directLine: await testHelpers.createDirectLineWithTranscript([ | ||
{ | ||
from:{ | ||
role: "bot" | ||
}, | ||
id: "a-00000", | ||
timestamp: 0, | ||
type: "message", | ||
text: "This is compleded feedback action example.", | ||
entities: [ | ||
{ | ||
'@context': 'https://schema.org', | ||
'@id': '', | ||
'@type': 'Message', | ||
type: 'https://schema.org/Message', | ||
keywords: ['AIGeneratedContent', 'AllowCopy'], | ||
potentialAction: [ | ||
{ | ||
"@type": "LikeAction", | ||
actionStatus: "CompletedActionStatus", | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=like" | ||
} | ||
}, | ||
{ | ||
"@type": "DislikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
result: { | ||
"@type": "Review", | ||
reviewBody: "I don't like it.", | ||
"reviewBody-input": { | ||
"@type": "PropertyValueSpecification", | ||
valueMinLength: 3, | ||
valueName: "reason" | ||
} | ||
}, | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
from: { | ||
role: 'user' | ||
}, | ||
id: "a-00001", | ||
timestamp: 0, | ||
type: "message", | ||
text: "Test", | ||
}, | ||
{ | ||
from:{ | ||
role: "bot" | ||
}, | ||
id: "a-00002", | ||
timestamp: 0, | ||
type: "message", | ||
text: "Hi! I'm *Cody*, the devbot. How can I help?", | ||
entities: [ | ||
{ | ||
'@context': 'https://schema.org', | ||
'@id': '', | ||
'@type': 'Message', | ||
type: 'https://schema.org/Message', | ||
keywords: [], | ||
potentialAction: [ | ||
{ | ||
"@type": "LikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=like" | ||
} | ||
}, | ||
{ | ||
"@type": "DislikeAction", | ||
actionStatus: "PotentialActionStatus", | ||
result: { | ||
"@type": "Review", | ||
reviewBody: "I don't like it.", | ||
"reviewBody-input": { | ||
"@type": "PropertyValueSpecification", | ||
valueMinLength: 3, | ||
valueName: "reason" | ||
} | ||
}, | ||
target: { | ||
"@type": "EntryPoint", | ||
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]), | ||
store: testHelpers.createStore(), | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await host.snapshot('local'); | ||
|
||
const [,, activityStatus] = pageElements.activityStatuses(); | ||
const buttons = activityStatus.querySelectorAll('button'); | ||
|
||
pageElements.sendBoxTextBox().focus(); | ||
|
||
await host.sendShiftTab(3); | ||
await host.sendKeys('ENTER'); | ||
await expect(document.activeElement).toBe(buttons[0]); | ||
await host.snapshot('local'); | ||
|
||
await host.sendTab(); | ||
await expect(document.activeElement).toBe(buttons[1]); | ||
await host.snapshot('local'); | ||
|
||
await host.sendTab(); | ||
await expect(document.activeElement).toBe(buttons[0]); | ||
await host.snapshot('local'); | ||
|
||
await host.sendKeys('ENTER'); | ||
await host.snapshot('local'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.