-
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
28 changed files
with
490 additions
and
311 deletions.
There are no files selected for viewing
File renamed without changes
Binary file renamed
BIN
+114 KB
...-with-custom-thumbnail-quality-1-snap.png → ...-thumbnail-quality-should-send-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+125 KB
...ure-with-custom-thumbnail-size-1-snap.png → ...tom-thumbnail-size-should-send-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+107 KB
...ker-with-custom-thumbnail-size-1-snap.png → ...tom-thumbnail-size-should-send-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+155 KB
...d-a-picture-without-web-worker-1-snap.png → ...without-web-worker-should-send-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file renamed
BIN
+159 KB
...ker/upload-js-upload-a-picture-2-snap.png → ...-picture-should-send-telemetry-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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,36 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('empty.txt'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('upload a plain text file', () => { | ||
test('should send', () => runHTML('upload/uploadPlainTextFile')); | ||
}); |
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,36 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('empty.zip'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('upload a zip file', () => { | ||
test('should send', () => runHTML('upload/uploadZipFile')); | ||
}); |
39 changes: 39 additions & 0 deletions
39
__tests__/html/upload/withWebWorker/customThumbnailQuality.html
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,39 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store, | ||
styleOptions: { | ||
uploadThumbnailQuality: 0.1 | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('seaofthieves.jpg'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
__tests__/html/upload/withWebWorker/customThumbnailQuality.js
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('with Web Worker upload a picture with custom thumbnail quality', () => { | ||
test('should send', () => runHTML('upload/withWebWorker/customThumbnailQuality')); | ||
}); |
41 changes: 41 additions & 0 deletions
41
__tests__/html/upload/withWebWorker/customThumbnailSize.html
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,41 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store, | ||
styleOptions: { | ||
uploadThumbnailContentType: 'image/png', | ||
uploadThumbnailHeight: 60, | ||
uploadThumbnailWidth: 120 | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('seaofthieves.jpg'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('with Web Worker upload a picture with custom thumbnail size', () => { | ||
test('should send', () => runHTML('upload/withWebWorker/customThumbnailSize')); | ||
}); |
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,132 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
const telemetryMeasurements = []; | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store, | ||
onTelemetry: event => { | ||
const { data, dimensions, duration, error, fatal, name, type, value } = event; | ||
|
||
telemetryMeasurements.push({ | ||
data, | ||
dimensions, | ||
duration, | ||
error, | ||
fatal, | ||
name, | ||
type, | ||
value | ||
}); | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('seaofthieves.jpg'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
const sendFileTelemetryMeasurements = telemetryMeasurements.filter(({ name }) => | ||
['init', 'sendFiles:makeThumbnail', 'submitSendBox'].includes(name) | ||
); | ||
|
||
expect(sendFileTelemetryMeasurements).toHaveProperty('length', 4); | ||
expect(sendFileTelemetryMeasurements[2]).toHaveProperty('name', 'sendFiles:makeThumbnail'); | ||
expect(sendFileTelemetryMeasurements[2]).toHaveProperty('type', 'timingend'); | ||
|
||
sendFileTelemetryMeasurements[2].duration = 1000; | ||
|
||
expect(sendFileTelemetryMeasurements).toEqual([ | ||
{ | ||
data: undefined, | ||
dimensions: { | ||
'capability:downscaleImage:workerType': 'web worker', | ||
'capability:renderer': 'html', | ||
'prop:locale': 'en-US', | ||
'prop:speechRecognition': 'false', | ||
'prop:speechSynthesis': 'false' | ||
}, | ||
duration: undefined, | ||
error: undefined, | ||
fatal: undefined, | ||
name: 'init', | ||
type: 'event', | ||
value: undefined | ||
}, | ||
{ | ||
data: undefined, | ||
dimensions: { | ||
'capability:downscaleImage:workerType': 'web worker', | ||
'capability:renderer': 'html', | ||
'prop:locale': 'en-US', | ||
'prop:speechRecognition': 'false', | ||
'prop:speechSynthesis': 'false' | ||
}, | ||
duration: undefined, | ||
error: undefined, | ||
fatal: undefined, | ||
name: 'sendFiles:makeThumbnail', | ||
type: 'timingstart', | ||
value: undefined | ||
}, | ||
{ | ||
data: undefined, | ||
dimensions: { | ||
'capability:downscaleImage:workerType': 'web worker', | ||
'capability:renderer': 'html', | ||
'prop:locale': 'en-US', | ||
'prop:speechRecognition': 'false', | ||
'prop:speechSynthesis': 'false' | ||
}, | ||
duration: 1000, | ||
error: undefined, | ||
fatal: undefined, | ||
name: 'sendFiles:makeThumbnail', | ||
type: 'timingend', | ||
value: undefined | ||
}, | ||
{ | ||
data: { | ||
numFiles: 1, | ||
sumSizeInKB: 379 | ||
}, | ||
dimensions: { | ||
'capability:downscaleImage:workerType': 'web worker', | ||
'capability:renderer': 'html', | ||
'prop:locale': 'en-US', | ||
'prop:speechRecognition': 'false', | ||
'prop:speechSynthesis': 'false' | ||
}, | ||
duration: undefined, | ||
error: undefined, | ||
fatal: undefined, | ||
name: 'submitSendBox', | ||
type: 'event', | ||
value: undefined | ||
} | ||
]); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('with Web Worker upload a picture', () => { | ||
test('should send telemetry', () => runHTML('upload/withWebWorker/withTelemetry')); | ||
}); |
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,39 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<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> | ||
run(async function () { | ||
const directLine = WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }); | ||
const store = testHelpers.createStore(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store, | ||
styleOptions: { | ||
enableUploadThumbnail: false | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await pageObjects.uploadFile('seaofthieves.jpg'); | ||
await host.click(pageElements.sendButton()); | ||
|
||
await pageConditions.minNumActivitiesShown(2); | ||
await pageConditions.allImagesLoaded(); | ||
|
||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('with Web Worker upload a picture without thumbnail', () => { | ||
test('should send', () => runHTML('upload/withWebWorker/withoutThumbnail')); | ||
}); |
Oops, something went wrong.