Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 WebdriverIO
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,73 @@
WDIO Dot Reporter
=================
[![Build Status](https://travis-ci.org/webdriverio/wdio-dot-reporter.svg?branch=master)](https://travis-ci.org/webdriverio/wdio-dot-reporter) [![Code Climate](https://codeclimate.com/github/webdriverio/wdio-dot-reporter/badges/gpa.svg)](https://codeclimate.com/github/webdriverio/wdio-dot-reporter) [![Test Coverage](https://codeclimate.com/github/webdriverio/wdio-dot-reporter/badges/coverage.svg)](https://codeclimate.com/github/webdriverio/wdio-dot-reporter/coverage) [![dependencies Status](https://david-dm.org/webdriverio/wdio-dot-reporter/status.svg)](https://david-dm.org/webdriverio/wdio-dot-reporter)
***
> A WebdriverIO plugin to report in dot style.
![Dot Reporter](http://webdriver.io/images/dot.png "Dot Reporter")
## Installation
The easiest way is to keep `wdio-dot-reporter` as a devDependency in your `package.json`.
```json
{
"devDependencies": {
"wdio-dot-reporter": "~0.0.8"
}
}
```
You can simple do it by:
```bash
npm install wdio-dot-reporter --save-dev
```
Instructions on how to install `WebdriverIO` can be found [here](http://webdriver.io/guide/getstarted/install.html).
## Configuration
Following code shows the default wdio test runner configuration. Just add `'dot'` as reporter
to the array.
```js
// wdio.conf.js
module.exports = {
// ...
reporters: ['dot'],
// ...
};
```
## Development
All commands can be found in the package.json. The most important are:
Watch changes:
```sh
$ npm run watch
```
Run tests:
```sh
$ npm test
# run test with coverage report:
$ npm run test:cover
```
Build package:
```sh
$ npm build
```
----
For more information on WebdriverIO see the [homepage](http://webdriver.io).

View File

@ -0,0 +1,95 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _events = require('events');
var _events2 = _interopRequireDefault(_events);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Initialize a new `Dot` matrix test reporter.
*
* @param {Runner} runner
* @api public
*/
var DotReporter = function (_events$EventEmitter) {
_inherits(DotReporter, _events$EventEmitter);
function DotReporter(baseReporter, config) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
_classCallCheck(this, DotReporter);
var _this = _possibleConstructorReturn(this, (DotReporter.__proto__ || Object.getPrototypeOf(DotReporter)).call(this));
_this.baseReporter = baseReporter;
var epilogue = _this.baseReporter.epilogue;
_this.on('start', function () {
console.log();
});
_this.on('test:pending', function () {
_this.printDots('pending');
});
_this.on('test:pass', function () {
_this.printDots('green');
});
_this.on('test:fail', function () {
_this.printDots('fail');
});
_this.on('test:end', function () {
_this.printDots(null);
});
_this.on(config.watch ? 'runner:end' : 'end', function () {
epilogue.call(baseReporter);
console.log();
if (config.watch) {
baseReporter.printEpilogue = true;
baseReporter.stats.reset();
}
});
return _this;
}
_createClass(DotReporter, [{
key: 'printDots',
value: function printDots(status) {
var _baseReporter = this.baseReporter,
color = _baseReporter.color,
symbols = _baseReporter.symbols;
var symbol = status === 'fail' ? 'F' : symbols.dot;
if (!status) {
return;
}
/* istanbul ignore next */
process.stdout.write(color(status, symbol));
}
}]);
return DotReporter;
}(_events2.default.EventEmitter);
exports.default = DotReporter;
module.exports = exports['default'];

View File

@ -0,0 +1,60 @@
import events from 'events'
/**
* Initialize a new `Dot` matrix test reporter.
*
* @param {Runner} runner
* @api public
*/
class DotReporter extends events.EventEmitter {
constructor (baseReporter, config, options = {}) {
super()
this.baseReporter = baseReporter
const { epilogue } = this.baseReporter
this.on('start', () => {
console.log()
})
this.on('test:pending', () => {
this.printDots('pending')
})
this.on('test:pass', () => {
this.printDots('green')
})
this.on('test:fail', () => {
this.printDots('fail')
})
this.on('test:end', () => {
this.printDots(null)
})
this.on(config.watch ? 'runner:end' : 'end', () => {
epilogue.call(baseReporter)
console.log()
if (config.watch) {
baseReporter.printEpilogue = true
baseReporter.stats.reset()
}
})
}
printDots (status) {
const { color, symbols } = this.baseReporter
const symbol = status === 'fail' ? 'F' : symbols.dot
if (!status) {
return
}
/* istanbul ignore next */
process.stdout.write(color(status, symbol))
}
}
export default DotReporter

View File

@ -0,0 +1,109 @@
{
"_from": "wdio-dot-reporter@~0.0.8",
"_id": "wdio-dot-reporter@0.0.9",
"_inBundle": false,
"_integrity": "sha1-kpsq2v1J1rBTT9oGjocxm0fjj+U=",
"_location": "/wdio-dot-reporter",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "wdio-dot-reporter@~0.0.8",
"name": "wdio-dot-reporter",
"escapedName": "wdio-dot-reporter",
"rawSpec": "~0.0.8",
"saveSpec": null,
"fetchSpec": "~0.0.8"
},
"_requiredBy": [
"/webdriverio"
],
"_resolved": "https://registry.npmjs.org/wdio-dot-reporter/-/wdio-dot-reporter-0.0.9.tgz",
"_shasum": "929b2adafd49d6b0534fda068e87319b47e38fe5",
"_spec": "wdio-dot-reporter@~0.0.8",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/webdriverio",
"author": {
"name": "Christian Bromann",
"email": "christian@saucelabs.com"
},
"bugs": {
"url": "https://github.com/webdriverio/wdio-dot-reporter/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "George Crawford",
"email": "george.crawford@ft.com"
},
{
"name": "Christian Bromann",
"email": "github@christian-bromann.com"
},
{
"name": "christian-bromann",
"email": "mail@christian-bromann.com"
}
],
"dependencies": {},
"deprecated": false,
"description": "A WebdriverIO plugin. Report results in dot format.",
"devDependencies": {
"babel-cli": "~6.24.1",
"babel-core": "~6.25.0",
"babel-eslint": "~7.2.1",
"babel-istanbul": "~0.12.2",
"babel-plugin-add-module-exports": "~0.2.1",
"babel-preset-es2015": "~6.24.1",
"babel-preset-stage-0": "~6.24.1",
"codeclimate-test-reporter": "~0.4.1",
"eslint": "~4.4.0",
"eslint-config-standard": "~10.2.0",
"eslint-plugin-import": "~2.7.0",
"eslint-plugin-node": "~5.1.0",
"eslint-plugin-promise": "~3.5.0",
"eslint-plugin-standard": "~3.0.1",
"isparta": "~4.0.0",
"istanbul": "~0.4.5",
"mocha": "~3.5.0",
"np": "~2.16.0",
"npm-run-all": "~4.0.2",
"should": "~11.2.1",
"sinon": "~3.2.0"
},
"directories": {
"lib": "./lib"
},
"homepage": "https://github.com/webdriverio/wdio-dot-reporter#readme",
"keywords": [
"dot",
"reporter",
"webdriverio",
"wdio",
"wdio-plugin",
"wdio-reporter"
],
"license": "MIT",
"main": "build/reporter.js",
"name": "wdio-dot-reporter",
"repository": {
"type": "git",
"url": "git+https://github.com/webdriverio/wdio-dot-reporter.git"
},
"scripts": {
"build": "run-s clean compile",
"clean": "rm -rf ./build ./coverage",
"compile": "babel lib/ -d build/",
"eslint": "eslint ./lib test/",
"prepublish": "npm prune && run-s build",
"release": "np patch",
"release:major": "np major",
"release:minor": "np minor",
"release:patch": "np patch",
"test": "run-s eslint test:unit",
"test:ci": "run-s clean eslint test:cover",
"test:cover": "babel-node ./node_modules/.bin/isparta cover --include 'lib/*.js' _mocha",
"test:unit": "mocha --compilers js:babel-core/register test/*.js",
"watch": "npm run compile -- --watch"
},
"version": "0.0.9"
}

View File

@ -0,0 +1,4 @@
--colors
--require should
--reporter spec
--timeout 60000

View File

@ -0,0 +1,90 @@
import sinon from 'sinon'
import events from 'events'
import DotReporter from '../lib/reporter'
class BaseReporter extends events.EventEmitter {
get symbols () {
return {}
}
get color () {
return 'some color'
}
}
var baseReporterMock = new BaseReporter()
var reporter, printDotsMock, epilogueMock, resetMock
describe('dot reporter', () => {
beforeEach(() => {
printDotsMock = sinon.spy()
epilogueMock = sinon.spy()
resetMock = sinon.spy()
baseReporterMock.epilogue = epilogueMock
baseReporterMock.printDots = printDotsMock
baseReporterMock.stats = { reset: resetMock }
reporter = new DotReporter(baseReporterMock, {})
})
it('should print nothing when testrun starts', () => {
reporter.printDots = sinon.spy()
reporter.emit('start')
reporter.printDots.notCalled.should.be.true()
})
it('should print \\n and call baseReporters epilogue when suite ends', () => {
reporter.emit('end')
epilogueMock.called.should.be.true()
})
it('should print pending dots for pending events', () => {
reporter.printDots = sinon.spy()
reporter.emit('test:pending')
reporter.printDots.calledWith('pending').should.be.true()
})
it('should print pass dots for passing events', () => {
reporter.printDots = sinon.spy()
reporter.emit('test:pass')
reporter.printDots.calledWith('green').should.be.true()
})
it('should print fail dots for failing events', () => {
reporter.printDots = sinon.spy()
reporter.emit('test:fail')
reporter.printDots.calledWith('fail').should.be.true()
})
it('should print pending dots for pending events', () => {
reporter.printDots = sinon.spy()
reporter.emit('test:pending')
reporter.printDots.calledWith('pending').should.be.true()
})
it('should print nothing when test ends', () => {
reporter.printDots = sinon.spy()
reporter.emit('test:end')
reporter.printDots.calledWith(null).should.be.true()
})
it('printDots should return nothing if status is falsy', () => {
(reporter.printDots() === undefined).should.be.true()
})
describe('should trigger runner:end in watch mode', () => {
beforeEach(() => {
reporter = new DotReporter(baseReporterMock, { watch: true })
})
it('should call epiloge in watch mode', () => {
reporter.emit('end')
epilogueMock.called.should.not.be.true()
reporter.emit('runner:end')
epilogueMock.called.should.be.true()
resetMock.called.should.be.true()
})
})
})