-
Notifications
You must be signed in to change notification settings - Fork 22
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
1 parent
c493479
commit efced5c
Showing
9 changed files
with
140 additions
and
135 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
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,15 @@ | ||
### E2E Test Summary|Description 📝|Test results 🧪|Duration ⏰| | ||
|---|---|---| | ||
|Set HLS source and auto-play: dispatches sourcechange event on setting a source without autoplay|✅|0.732s| | ||
|Set HLS source and auto-play: dispatches sourcechange, play and playing events in order on setting a source with autoplay|✅|1.698s| | ||
|Set HLS source and auto-play: dispatches a seeked event after seeking|✅|1.786s| | ||
|Set HLS source and auto-play: dispatches paused, play and playing events after pausing & resuming playback|✅|0.836s| | ||
|Set mp4 source and auto-play: dispatches sourcechange event on setting a source without autoplay|✅|0.176s| | ||
|Set mp4 source and auto-play: dispatches sourcechange, play and playing events in order on setting a source with autoplay|✅|1.586s| | ||
|Set mp4 source and auto-play: dispatches a seeked event after seeking|✅|1.961s| | ||
|Set mp4 source and auto-play: dispatches paused, play and playing events after pausing & resuming playback|✅|2.042s| | ||
|Set source with ads and auto-play: dispatches sourcechange, play, playing and ad events|❌|10.171s| | ||
|Setup Conviva connector: successfully creates the connector, connects to the player, uses API, and cleans up and destroys.|✅|0.712s| | ||
|Setup Nielsen connector: successfully creates the connector, connects to the player, uses API, and cleans up and destroys.|✅|0.884s| | ||
|Setup Adobe connector: successfully creates the connector, connects to the player, uses API, and cleans up and destroys.|✅|0.916s| | ||
|Switch between presentation modes: dispatches presentationmodechange events between inline and fullscreen.|✅|1.352s| |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,118 @@ | ||
diff --git a/node_modules/cavy-cli/cavy.js b/node_modules/cavy-cli/cavy.js | ||
index da9fc72..c3d3b41 100755 | ||
--- a/node_modules/cavy-cli/cavy.js | ||
+++ b/node_modules/cavy-cli/cavy.js | ||
@@ -32,9 +32,10 @@ function test(cmd) { | ||
const entryFile = cmd.file; | ||
const skipbuild = cmd.skipbuild; | ||
const outputAsXml = cmd.xml; | ||
+ const outputAsMarkdown = cmd.md; | ||
const dev = cmd.dev; | ||
const bootTimeout = cmd.bootTimeout; | ||
- runTests(commandName, entryFile, skipbuild, dev, outputAsXml, bootTimeout, args); | ||
+ runTests(commandName, entryFile, skipbuild, dev, outputAsXml, outputAsMarkdown, bootTimeout, args); | ||
} | ||
|
||
// Stop quitting unless we want to | ||
@@ -64,6 +65,7 @@ program | ||
+ '(is ignored if used with --skipbuild, defaults to 2 minutes, requires Cavy 4.0.0)' | ||
) | ||
.option('--xml', 'Write out test results to cavy_results.xml (requires Cavy 3.3.0)') | ||
+ .option('--md', 'Write out test results to cavy_results.md') | ||
.allowUnknownOption() | ||
.action(cmd => test(cmd)); | ||
|
||
@@ -82,6 +84,7 @@ program | ||
+ '(is ignored if used with --skipbuild, defaults to 2 minutes, requires Cavy 4.0.0)' | ||
) | ||
.option('--xml', 'Write out test results to cavy_results.xml (requires Cavy 3.3.0)') | ||
+ .option('--md', 'Write out test results to cavy_results.md') | ||
.allowUnknownOption() | ||
.action(cmd => test(cmd)); | ||
|
||
diff --git a/node_modules/cavy-cli/server.js b/node_modules/cavy-cli/server.js | ||
index 64faf22..8ecf8b3 100644 | ||
--- a/node_modules/cavy-cli/server.js | ||
+++ b/node_modules/cavy-cli/server.js | ||
@@ -2,6 +2,7 @@ const http = require('http'); | ||
const WebSocket = require('ws'); | ||
const chalk = require('chalk'); | ||
const constructXML = require('./src/junitFormatter'); | ||
+const { writeFileSync } = require('fs'); | ||
|
||
// Initialize a server | ||
const server = http.createServer(); | ||
@@ -62,6 +63,18 @@ function logTestResult(testResultJson) { | ||
} | ||
}; | ||
|
||
+function constructMarkdown(results) { | ||
+ const filename = 'cavy_results.md'; | ||
+ console.log(`Writing results to ${filename}`); | ||
+ const data = | ||
+ `### E2E Test Summary\n` + | ||
+ `|Description 📝|Test results 🧪|Duration ⏰|\n` + | ||
+ `|---|---|---|\n` + | ||
+ results.testCases.map((result) => `|${result.description}|${result.passed ? `✅` : `❌`}|${result.time}s|`).join('\n'); | ||
+ | ||
+ writeFileSync(filename, data); | ||
+}; | ||
+ | ||
// Internal: Accepts a json report object, console.logs the overall result of | ||
// the test suite and quits the process with either exit code 1 or 0 depending | ||
// on whether any tests failed. | ||
@@ -81,6 +94,11 @@ function finishTesting(reportJson) { | ||
constructXML(fullResults); | ||
} | ||
|
||
+ // If requested, construct XML report. | ||
+ if (server.locals.outputAsMarkdown) { | ||
+ constructMarkdown(fullResults); | ||
+ } | ||
+ | ||
// If all tests pass, exit with code 0, else code 42. | ||
// Code 42 chosen at random so that a test failure can be distinuguished from | ||
// a build failure (in which case the React Native CLI would exit with code 1). | ||
diff --git a/node_modules/cavy-cli/src/runTests.js b/node_modules/cavy-cli/src/runTests.js | ||
index 69ef62c..9eb750e 100644 | ||
--- a/node_modules/cavy-cli/src/runTests.js | ||
+++ b/node_modules/cavy-cli/src/runTests.js | ||
@@ -57,9 +57,10 @@ function getAdbPath() { | ||
} | ||
|
||
// Start test server, listening for test results to be posted. | ||
-function runServer({ command, dev, outputAsXml, skipbuild, bootTimeout }) { | ||
+function runServer({ command, dev, outputAsXml, outputAsMarkdown, skipbuild, bootTimeout }) { | ||
server.locals.dev = dev; | ||
server.locals.outputAsXml = outputAsXml; | ||
+ server.locals.outputAsMarkdown = outputAsMarkdown; | ||
server.listen(8082, () => { | ||
if (command == 'run-android') { | ||
runAdbReverse(); | ||
@@ -93,7 +94,7 @@ function runServer({ command, dev, outputAsXml, skipbuild, bootTimeout }) { | ||
// outputAsXml: whether to write and save the results to XML file | ||
// bootTimeout: how long the CLI should wait for the RN app to boot. | ||
// args: any extra arguments the user would usually to pass to `react native run...` | ||
-function runTests(command, file, skipbuild, dev, outputAsXml, bootTimeout, args) { | ||
+function runTests(command, file, skipbuild, dev, outputAsXml, outputAsMarkdown, bootTimeout, args) { | ||
|
||
// Assume entry file is 'index.js' if user doesn't supply one. | ||
const entryFile = file || 'index.js'; | ||
@@ -134,7 +135,7 @@ function runTests(command, file, skipbuild, dev, outputAsXml, bootTimeout, args) | ||
}); | ||
|
||
if (skipbuild) { | ||
- runServer({ command, dev, outputAsXml, skipbuild, bootTimeout }); | ||
+ runServer({ command, dev, outputAsXml, outputAsMarkdown, skipbuild, bootTimeout }); | ||
} else { | ||
// Build the app, start the test server and wait for results. | ||
console.log(`cavy: Running \`npx react-native ${command}\`...`); | ||
@@ -151,7 +152,7 @@ function runTests(command, file, skipbuild, dev, outputAsXml, bootTimeout, args) | ||
if (code) { | ||
return process.exit(code); | ||
} | ||
- runServer({ command, dev, outputAsXml, skipbuild, bootTimeout }); | ||
+ runServer({ command, dev, outputAsXml, outputAsMarkdown, skipbuild, bootTimeout }); | ||
}); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.