Skip to content

Commit

Permalink
Showing 19 changed files with 1,353 additions and 1,099 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -378,6 +378,7 @@
"mime": "^2.3.1",
"minimatch": "^3.0.2",
"optimist": "^0.6.1",
"puppeteer": "^1.9.0",
"qjobs": "^1.1.4",
"range-parser": "^1.2.0",
"rimraf": "^2.6.0",
@@ -406,8 +407,8 @@
"grunt-auto-release": "^0.0.7",
"grunt-browserify": "^5.0.0",
"grunt-bump": "^0.8.0",
"grunt-cli": "^1.1.0",
"grunt-check-clean": "^0.1.2",
"grunt-cli": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-conventional-changelog": "^6.0.1",
"grunt-conventional-github-releaser": "^1.0.0",
@@ -422,7 +423,7 @@
"karma-browserify": "^5.0.1",
"karma-browserstack-launcher": "^1.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "*",
"karma-chrome-launcher": "^2.2.0",
"karma-coffee-preprocessor": "*",
"karma-commonjs": "*",
"karma-coverage": "*",
@@ -435,7 +436,6 @@
"karma-mocha": "^1.0.1",
"karma-mocha-reporter": "^2.0.0",
"karma-ng-scenario": "*",
"karma-phantomjs-launcher": "*",
"karma-qunit": "*",
"karma-requirejs": "*",
"karma-sauce-launcher": "*",
@@ -444,7 +444,6 @@
"mkdirp": "^0.5.0",
"mocha": "^4.0.1",
"mocks": "^0.0.15",
"phantomjs-prebuilt": "^2.1.3",
"proxyquire": "^1.7.11",
"qunitjs": "^2.1.1",
"requirejs": "^2.1.20",
8 changes: 4 additions & 4 deletions test/e2e/basic.feature
Original file line number Diff line number Diff line change
@@ -3,21 +3,21 @@ Feature: Basic Testrunner
As a person who wants to write great tests
I want to be able to run tests from the command line.

Scenario: Execute a test in PhantomJS
Scenario: Execute a test in ChromeHeadless
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with:
"""
..
PhantomJS
HeadlessChrome
"""
@not-jenkins
Scenario: Execute a test in Chrome
34 changes: 17 additions & 17 deletions test/e2e/browser_console.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
@@ -44,10 +44,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
@@ -68,10 +68,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
@@ -92,10 +92,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
@@ -115,10 +115,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
@@ -128,17 +128,17 @@ Feature: Browser Console Configuration
When I start Karma
Then the file at test/e2e/console.log contains:
"""
Phantom
HeadlessChrome
"""

Scenario: Execute logging program and disabling terminal
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
@@ -150,17 +150,17 @@ Feature: Browser Console Configuration
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Execute logging program and disabling terminal
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
terminal: false
@@ -170,5 +170,5 @@ Feature: Browser Console Configuration
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
6 changes: 3 additions & 3 deletions test/e2e/custom-context.feature
Original file line number Diff line number Diff line change
@@ -7,16 +7,16 @@ Feature: Custom Context File
Given a configuration with:
"""
files = ['context/*.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
customContextFile = 'context/context2.html'
"""
When I start Karma
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
12 changes: 6 additions & 6 deletions test/e2e/displayname.feature
Original file line number Diff line number Diff line change
@@ -3,18 +3,18 @@ Feature: Custom Display-name
As a person who wants to write great tests
I want to Karma to send custom display-name.

Scenario: Execute a test in PhantomJS
Scenario: Execute a test in ChromeHeadless
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['customPhantom'];
browsers = ['customChrome'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
customLaunchers = {
customPhantom: {
base: 'PhantomJS',
customChrome: {
base: 'ChromeHeadlessNoSandbox',
displayName: '42'
}
};
@@ -24,4 +24,4 @@ Feature: Custom Display-name
"""
..
42
"""
"""
6 changes: 3 additions & 3 deletions test/e2e/error.feature
Original file line number Diff line number Diff line change
@@ -7,14 +7,14 @@ Feature: Error Display
Given a configuration with:
"""
files = ['error/test.js', 'error/under-test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it fails with:
"""
SyntaxError: Parser error
SyntaxError: Unexpected token }
"""
42 changes: 21 additions & 21 deletions test/e2e/files.feature
Original file line number Diff line number Diff line change
@@ -10,17 +10,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
'files/*.js'
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Execute a test excluding an explicitly included file
@@ -31,17 +31,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
'files/*.js'
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
@@ -56,17 +56,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: true},
{pattern: 'files/log_foo.js', included: false}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
@@ -81,17 +81,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
{pattern: 'files/{log,bug}_foo.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
@@ -106,17 +106,17 @@ Feature: Including files
{pattern: 'files/+(log|bug)_foo.js', included: false},
{pattern: 'files/*.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
@@ -131,17 +131,17 @@ Feature: Including files
{pattern: 'files/*.js', included: false},
{pattern: 'files/**', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
@@ -157,17 +157,17 @@ Feature: Including files
{pattern: 'files/{log,bug}_foo.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
6 changes: 3 additions & 3 deletions test/e2e/headers.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Custom Headers
Given a configuration with:
"""
files = ['headers/*.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
customHeaders = [{
match: 'foo.js',
@@ -22,5 +22,5 @@ Feature: Custom Headers
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
16 changes: 8 additions & 8 deletions test/e2e/load.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Basic Testrunner
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['NonExistingBrowser', 'PhantomJS'];
browsers = ['NonExistingBrowser', 'ChromeHeadless'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false
"""
@@ -28,11 +28,11 @@ Feature: Basic Testrunner
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-totally-non-existing-plugin',
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false
"""
@@ -52,11 +52,11 @@ Feature: Basic Testrunner
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
reporters = ['unreal-reporter']
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false
"""
@@ -75,12 +75,12 @@ Feature: Basic Testrunner
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['NonExistingBrowser', 'PhantomJS'];
browsers = ['NonExistingBrowser', 'ChromeHeadless'];
reporters = ['unreal-reporter']
plugins = [
'karma-totally-non-existing-plugin',
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false
"""
12 changes: 6 additions & 6 deletions test/e2e/middleware.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Middleware
Given a configuration with:
"""
files = ['middleware/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
_resolve('middleware/middleware')
];
middleware = [
@@ -21,17 +21,17 @@ Feature: Middleware
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Frameworks can add middleware
Given a configuration with:
"""
files = ['middleware/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
_resolve('middleware/middleware')
];
frameworks = ['jasmine', 'foo']
@@ -40,5 +40,5 @@ Feature: Middleware
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
14 changes: 7 additions & 7 deletions test/e2e/mocharepoter.feature
Original file line number Diff line number Diff line change
@@ -3,16 +3,16 @@ Feature: Mocha reporter
As a person who wants to write great tests
I want to be able to use the mocha reporter.

Scenario: Execute a test in PhantomJS with colors
Scenario: Execute a test in ChromeHeadless with colors
Given a configuration with:
"""
files = ['mocha/plus.js', 'mocha/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
frameworks = ['mocha', 'chai']
colors = true
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-mocha-reporter',
'karma-mocha',
'karma-chai'
@@ -25,16 +25,16 @@ Feature: Mocha reporter
2 tests completed
"""

Scenario: Execute a test in PhantomJS with no-colors
Scenario: Execute a test in ChromeHeadless with no-colors
Given a configuration with:
"""
files = ['mocha/plus.js', 'mocha/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
frameworks = ['mocha', 'chai']
colors = false
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-mocha-reporter',
'karma-mocha',
'karma-chai'
@@ -45,4 +45,4 @@ Feature: Mocha reporter
Then it passes with like:
"""
✔ 2 tests completed
"""
"""
4 changes: 2 additions & 2 deletions test/e2e/pass-opts.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Passing Options
Given a configuration with:
"""
files = ['pass-opts/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false;
"""
18 changes: 9 additions & 9 deletions test/e2e/proxy.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: Proxying
Given a configuration with:
"""
files = ['proxy/test.js', 'proxy/foo.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
proxies = {
'/foo.js': '/base/proxy/foo.js'
@@ -20,17 +20,17 @@ Feature: Proxying
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Added by a framework
Given a configuration with:
"""
files = ['proxy/test.js', 'proxy/foo.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
_resolve('proxy/plugin')
];
frameworks = ['jasmine', 'foo']
@@ -39,17 +39,17 @@ Feature: Proxying
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: URLRoot
Given a configuration with:
"""
files = ['proxy/test.js', 'proxy/foo.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
urlRoot = '/__karma__/';
proxies = {
@@ -60,5 +60,5 @@ Feature: Proxying
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
6 changes: 3 additions & 3 deletions test/e2e/reconnecting.feature
Original file line number Diff line number Diff line change
@@ -7,15 +7,15 @@ Feature: Passing Options
Given a configuration with:
"""
files = ['reconnecting/test.js', 'reconnecting/plus.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with:
"""
.....
PhantomJS
HeadlessChrome
"""
8 changes: 4 additions & 4 deletions test/e2e/runInParent.feature
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ Feature: runInParent option
As a person who wants to write great tests
I want Karma to run without iframe or opening new window

Scenario: Execute a test in PhantomJS
Scenario: Execute a test in ChromeHeadless
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
client = {
useIframe: false,
@@ -21,7 +21,7 @@ Feature: runInParent option
Then it passes with:
"""
..
PhantomJS
HeadlessChrome
"""
@not-jenkins
Scenario: Execute a test in Chrome
12 changes: 6 additions & 6 deletions test/e2e/stop.feature
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ Feature: Stop karma
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false;
"""
@@ -29,10 +29,10 @@ Feature: Stop karma
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false;
"""
@@ -48,10 +48,10 @@ Feature: Stop karma
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
singleRun = false;
logLevel = 'error';
9 changes: 6 additions & 3 deletions test/e2e/support/world.js
Original file line number Diff line number Diff line change
@@ -8,8 +8,7 @@ const cucumber = require('cucumber')

function World () {
this.proxy = require('./proxy')

this.template = _.template('module.exports = function (config) {\n config.set(\n <%= content %>\n );\n};')
this.template = _.template(`process.env.CHROME_BIN = require('puppeteer').executablePath(); module.exports = function (config) {\n config.set(\n <%= content %>\n );\n};`)

this.configFile = {
singleRun: true,
@@ -52,7 +51,11 @@ function World () {

this.generateJS = function (config) {
return this.template({
content: JSON.stringify(config)
content: JSON.stringify(Object.assign({}, config, {
customLaunchers: Object.assign({
ChromeHeadlessNoSandbox: {base: 'ChromeHeadless', flags: ['--no-sandbox']}
}, config.customLaunchers)
}))
})
}

6 changes: 3 additions & 3 deletions test/e2e/upstream-proxy.feature
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ Feature: UpstreamProxy
Given a configuration with:
"""
files = ['behind-proxy/plus.js', 'behind-proxy/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
urlRoot = '/__karma__/';
upstreamProxy = {
@@ -21,5 +21,5 @@ Feature: UpstreamProxy
Then it passes with:
"""
..
PhantomJS
HeadlessChrome
"""
2,226 changes: 1,239 additions & 987 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 0f8b2b1

Please sign in to comment.