-
Notifications
You must be signed in to change notification settings - Fork 1
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
5 changed files
with
292 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
|
||
# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode | ||
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode | ||
|
||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# react / gatsby | ||
public/ | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode |
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,64 @@ | ||
# testcafe-reporter-custom | ||
|
||
|
||
This is the **custom** reporter plugin for [TestCafe](http://devexpress.github.io/testcafe). | ||
|
||
## Install | ||
|
||
```sh | ||
npm install testcafe-reporter-custom | ||
``` | ||
|
||
## Usage | ||
|
||
When you run tests from the command line, specify the reporter name by using the `--reporter` option: | ||
|
||
```sh | ||
testcafe chrome 'path/to/test/file.js' --reporter custom | ||
``` | ||
|
||
|
||
When you use API, pass the reporter name to the `reporter()` method: | ||
|
||
```js | ||
testCafe | ||
.createRunner() | ||
.src('path/to/test/file.js') | ||
.browsers('chrome') | ||
.reporter('custom') // <- | ||
.run(); | ||
``` | ||
|
||
|
||
After that you can define your custom logic in `reporter/index.js` file. | ||
It can be defined as an object or factory function. | ||
|
||
For example: | ||
|
||
```js | ||
module.exports = function () { | ||
return { | ||
async reportTaskStart (/* startTime, userAgents, testCount */) { | ||
throw new Error('Not implemented'); | ||
}, | ||
|
||
async reportFixtureStart (/* name, path, meta */) { | ||
throw new Error('Not implemented'); | ||
}, | ||
|
||
async reportTestStart (/* name, meta */) { | ||
// NOTE: This method is optional. | ||
}, | ||
|
||
async reportTestDone (/* name, testRunInfo, meta */) { | ||
throw new Error('Not implemented'); | ||
}, | ||
|
||
async reportTaskDone (/* endTime, passed, warnings, result */) { | ||
throw new Error('Not implemented'); | ||
} | ||
}; | ||
} | ||
``` | ||
|
||
API is completely the same as for regular reporter. |
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,13 @@ | ||
const path = require('path'); | ||
|
||
const projectRoot = process.mainModule.paths[0].split('node_modules')[0].slice(0, -1); | ||
const configFile = path.resolve(projectRoot, 'reporter/index.js'); | ||
|
||
module.exports = function () { | ||
let logic = require(configFile); | ||
if (logic instanceof Function) { | ||
logic = logic(); | ||
} | ||
|
||
return logic; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,24 @@ | ||
{ | ||
"name": "testcafe-reporter-custom", | ||
"version": "1.0.0", | ||
"description": "TestCafe reporter that allows you to provide your own logic", | ||
"main": "lib/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ocassio/testcafe-reporter-custom.git" | ||
}, | ||
"keywords": [ | ||
"testcafe", | ||
"reporter", | ||
"plugin" | ||
], | ||
"author": "Alexander Ionov", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/ocassio/testcafe-reporter-custom/issues" | ||
}, | ||
"homepage": "https://github.com/ocassio/testcafe-reporter-custom#readme", | ||
"dependencies": { | ||
"app-root-path": "^2.2.1" | ||
} | ||
} |