@aofl/unit-testing-plugin
Aofl unit testing plugin uses [WebdriverIO](https://webdriver.io/) to run unit tests in the browser.
Last updated 12 days ago by ariankhosravi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @aofl/unit-testing-plugin 
SYNC missed versions from official npm registry.

@aofl/unit-testing-plugin

Aofl unit testing plugin uses WebdriverIO to run unit tests in the browser.

Note: for automated browser testing refer to @aofl/wdio

Installation

npm i -D @aofl/unit-testing-plugin

If you plan on generating coverage report babel-plugin-istanbul is needed to instrument transpiled code. We recommend using babel-plugin-istanbul

Usage

const UnitTesting = require('@aofl/unit-testing-plugin');

module.export = {
  entry: {
    'custom-elements-es5-adapter': 'path/to/custom-e...',
    'init-polyfill-service': 'path/to/...'
  }.
  plugins: [
    new UnitTesting({
      root: process.cwd(), // project root
      output: '__build_tests',  // output directory of compiled test files.
      host: 'localhost',
      port: 3035,
      config: path.join(root, '.wct.config.js'),
      debug: false,
      nycArgs: [ // cli arguments passed to nyc to generate coverage report
        'report',
        '--reporter=lcov',
        '--reporter=text-summary',
        '--report-dir=./logs/coverage'
      ]
    })
  ]
}

WebdriverIO Configuration

For ease of use @aofl/unit-testing comes preconfigured with common WebdriverIO recipes. You can provide your own file based on https://webdriver.io/docs/configurationfile.html. However, in most cases you should only need to configure the capabilities field.

Local

// .wct.config.js
module.exports.config = {
  capabilities: [
    {
      "maxInstances": 5,
      "browserName": 'chrome',
      'goog:chromeOptions': {
        // to run chrome headless the following flags are required
        // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
        args: ['--headless', '--disable-gpu'],
      }
    },
    {
      "maxInstances": 5,
      "browserName": 'firefox',
      'moz:firefoxOptions': {
        // flag to activate Firefox headless mode (see https://github.com/mozilla/geckodriver/blob/master/README.md#firefox-capabilities for more details about moz:firefoxOptions)
        args: ['-headless']
      },
    },
    // {
    //   "maxInstances": 10,
    //   "browserName": 'safari'
    // }
  ]
};

SauceLabs

Set SAUCE_USERNAME and SAUCE_ACCESS_KEY as environment variables.

// .wct-sauce.config.js
const sharedSettings = {
  recordLogs: true,
  recordVideo: true,
  recordScreenshots: false,
  timeout: 300,
  idleTimeout: 1000,
  commandTimeout: 600,
  webdriverRemoteQuietExceptions: false,
  videoUploadOnPass: false,
  tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER || null // if using travis refer to https://docs.travis-ci.com/user/sauce-connect/
};

const config = {
  preset: 'sauce',
  specFileRetries: 1,
  sauceConnect: true,
  capabilities: [
    {
      ...sharedSettings,
      "browserName": "Safari",
      "appiumVersion": "1.15.0",
      "deviceName": "iPhone X Simulator",
      "platformVersion": "13.0",
      "platformName": "iOS"
    },
    ...
  ]
};

Current Tags

  • 3.9.0-alpha.0                                ...           alpha (15 days ago)
  • 3.5.0-beta.22                                ...           beta (3 months ago)
  • 3.9.0                                ...           latest (12 days ago)
  • 2.1.0-alpha.13.1                                ...           next (8 months ago)
  • 3.0.0-alpha.14                                ...           next-alpha (8 months ago)

129 Versions

  • 3.9.0                                ...           12 days ago
  • 3.8.1                                ...           15 days ago
  • 3.9.0-alpha.0                                ...           15 days ago
  • 3.8.0                                ...           15 days ago
  • 3.6.1                                ...           3 months ago
  • 3.5.0                                ...           3 months ago
  • 3.5.0-beta.22                                ...           3 months ago
  • 3.5.0-beta.21                                ...           3 months ago
  • 3.5.0-beta.20                                ...           3 months ago
  • 3.5.0-beta.19                                ...           3 months ago
  • 3.5.0-beta.18                                ...           3 months ago
  • 3.5.0-beta.17                                ...           3 months ago
  • 3.5.0-beta.16                                ...           3 months ago
  • 3.5.0-beta.15                                ...           3 months ago
  • 3.5.0-beta.14                                ...           3 months ago
  • 3.5.0-beta.13                                ...           3 months ago
  • 3.5.0-beta.12                                ...           3 months ago
  • 3.5.0-beta.11                                ...           3 months ago
  • 3.5.0-beta.10                                ...           3 months ago
  • 3.5.0-beta.9                                ...           3 months ago
  • 3.5.0-beta.8                                ...           3 months ago
  • 3.5.0-beta.7                                ...           3 months ago
  • 3.5.0-beta.6                                ...           3 months ago
  • 3.5.0-beta.5                                ...           3 months ago
  • 3.5.0-beta.4                                ...           3 months ago
  • 3.5.0-beta.3                                ...           3 months ago
  • 3.5.0-beta.2                                ...           3 months ago
  • 3.5.0-beta.1                                ...           3 months ago
  • 3.5.0-beta.0                                ...           3 months ago
  • 3.3.0                                ...           4 months ago
  • 3.2.2-alpha.3                                ...           4 months ago
  • 3.0.0                                ...           6 months ago
  • 3.0.0-beta.48                                ...           6 months ago
  • 3.0.0-beta.42                                ...           7 months ago
  • 3.0.0-beta.41                                ...           7 months ago
  • 3.0.0-beta.37                                ...           7 months ago
  • 3.0.0-beta.36                                ...           7 months ago
  • 3.0.0-beta.35                                ...           7 months ago
  • 3.0.0-beta.32                                ...           7 months ago
  • 3.0.0-beta.30                                ...           8 months ago
  • 3.0.0-beta.28                                ...           8 months ago
  • 3.0.0-beta.27                                ...           8 months ago
  • 3.0.0-beta.26                                ...           8 months ago
  • 3.0.0-beta.25                                ...           8 months ago
  • 3.0.0-beta.24                                ...           8 months ago
  • 3.0.0-beta.23                                ...           8 months ago
  • 3.0.0-beta.15                                ...           8 months ago
  • 3.0.0-beta.14                                ...           8 months ago
  • 3.0.0-beta.13                                ...           8 months ago
  • 3.0.0-beta.10                                ...           8 months ago
  • 3.0.0-beta.6                                ...           8 months ago
  • 3.0.0-beta.3                                ...           8 months ago
  • 3.0.0-beta.2                                ...           8 months ago
  • 3.0.0-beta.1                                ...           8 months ago
  • 3.0.0-alpha.14                                ...           8 months ago
  • 3.0.0-alpha.13                                ...           8 months ago
  • 3.0.0-alpha.12                                ...           8 months ago
  • 3.0.0-alpha.11                                ...           8 months ago
  • 3.0.0-alpha.10                                ...           8 months ago
  • 3.0.0-alpha.9                                ...           8 months ago
  • 3.0.0-alpha.8                                ...           8 months ago
  • 3.0.0-alpha.7                                ...           8 months ago
  • 3.0.0-alpha.6                                ...           8 months ago
  • 3.0.0-alpha.5                                ...           8 months ago
  • 3.0.0-alpha.4                                ...           8 months ago
  • 3.0.0-alpha.3                                ...           8 months ago
  • 3.0.0-alpha.2                                ...           8 months ago
  • 3.0.0-alpha.1                                ...           8 months ago
  • 3.0.0-alpha.0                                ...           8 months ago
  • 3.0.0-0                                ...           8 months ago
  • 2.1.0-3.0.0-alpha.0                                ...           8 months ago
  • 2.1.0-alpha.13.1                                ...           8 months ago
  • 2.1.0-alpha.13.0                                ...           8 months ago
  • 2.1.0-alpha.12.7                                ...           8 months ago
  • 2.1.0-alpha.12.5                                ...           8 months ago
  • 2.1.0-alpha.12.4                                ...           8 months ago
  • 2.1.0-alpha.12.3                                ...           8 months ago
  • 2.1.0-alpha.12.2                                ...           8 months ago
  • 2.1.0-alpha.10                                ...           9 months ago
  • 2.1.0-alpha.8                                ...           9 months ago
  • 2.1.0-alpha.6                                ...           9 months ago
  • 2.1.0-alpha.4                                ...           10 months ago
  • 2.1.0-alpha.3                                ...           10 months ago
  • 2.1.0-alpha.2                                ...           10 months ago
  • 2.1.0-alpha.1                                ...           10 months ago
  • 2.1.0-alpha.0                                ...           10 months ago
  • 2.0.8                                ...           a year ago
  • 2.0.7                                ...           a year ago
  • 2.0.6                                ...           a year ago
  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           a year ago
  • 2.0.4-alpha.1                                ...           a year ago
  • 2.0.4-alpha.0                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 2.0.0-alpha.19                                ...           a year ago
  • 2.0.0-alpha.18                                ...           a year ago
  • 2.0.0-alpha.17                                ...           a year ago
  • 2.0.0-alpha.16                                ...           a year ago
  • 2.0.0-alpha.14                                ...           a year ago
  • 2.0.0-alpha.13                                ...           a year ago
  • 2.0.0-alpha.12                                ...           a year ago
  • 2.0.0-alpha.8                                ...           a year ago
  • 2.0.0-alpha.7                                ...           a year ago
  • 2.0.0-alpha.6                                ...           a year ago
  • 2.0.0-alpha.5                                ...           a year ago
  • 2.0.0-alpha.4                                ...           a year ago
  • 2.0.0-alpha.3                                ...           a year ago
  • 2.0.0-alpha.2                                ...           a year ago
  • 2.0.0-alpha.1                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.3.0-pre.1                                ...           a year ago
  • 1.2.3                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0-beta.28.1                                ...           2 years ago
  • 1.0.0-beta.27                                ...           2 years ago
  • 1.0.0-beta.26                                ...           2 years ago
  • 1.0.0-beta.25                                ...           2 years ago
  • 1.0.0-beta.24                                ...           2 years ago
  • 1.0.0-beta.23                                ...           2 years ago
  • 1.0.0-beta.22                                ...           2 years ago
  • 1.0.0-beta.21                                ...           2 years ago
Downloads
Today 0
This Week 1
This Month 343
Last Day 0
Last Week 1
Last Month 4
Dependencies (19)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |