Skip to content

Commit

Permalink
v4.0.0-rc.3
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 9, 2019
1 parent 83d459b commit 863d6bb
Show file tree
Hide file tree
Showing 25 changed files with 191 additions and 71 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@

## 4.0.0-rc.3 (2019-09-09)

#### :rocket: New Features
* `@vue/cli-service`, `@vue/cli-shared-utils`
* [#4554](https://github.com/vuejs/vue-cli/pull/4554) Support sass-loader v8 ([@sodatea](https://github.com/sodatea))
* `@vue/cli-plugin-e2e-nightwatch`
* [#4541](https://github.com/vuejs/vue-cli/pull/4541) Upgrade Nightwatch to v1.2 and update bundled config and generated tests ([@beatfactor](https://github.com/beatfactor))

#### Committers: 2
- Andrei Rusu ([@beatfactor](https://github.com/beatfactor))
- Haoqun Jiang ([@sodatea](https://github.com/sodatea))



## 4.0.0-rc.2 (2019-09-08)

#### :rocket: New Features
Expand Down
130 changes: 118 additions & 12 deletions docs/core-plugins/e2e-nightwatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,138 @@

- **`vue-cli-service test:e2e`**

run e2e tests with [NightwatchJS](http://nightwatchjs.org).
Run end-to-end tests with [Nightwatch.js](https://nightwatchjs.org).

Options:

```
--url run e2e tests against given url instead of auto-starting dev server
--config use custom nightwatch config file (overrides internals)
-e, --env specify comma-delimited browser envs to run in (default: chrome)
-t, --test specify a test to run by name
-f, --filter glob to filter tests by filename
--url run the tests against given url instead of auto-starting dev server
--config use custom nightwatch config file (overrides internals)
--headless use chrome or firefox in headless mode
--parallel enable parallel mode via test workers (only available in chromedriver)
--use-selenium use Selenium standalone server instead of chromedriver or geckodriver
-e, --env specify comma-delimited browser envs to run in (default: chrome)
-t, --test specify a test to run by name
-f, --filter glob to filter tests by filename
```

> Note: this plugin currently uses Nightwatch v0.9.x. We are waiting for Nightwatch 1.0 to stabilize before upgrading.
Additionally, all [Nightwatch CLI options](https://nightwatchjs.org/guide/running-tests/#command-line-options) are also supported.
E.g.: `--verbose`, `--retries` etc.


Additionally, [all Nightwatch CLI options are also supported](https://nightwatchjs.org/guide#command-line-options).
## Project Structure

## Configuration
The following structure will be generated when installing this plugin. There are examples for most testing concepts in Nightwatch available.

```
tests/e2e/
├── custom-assertions/
| └── elementCount.js
├── custom-commands/
| ├── customExecute.js
| ├── openHomepage.js
| └── openHomepageClass.js
├── page-objects/
| └── homepage.js
├── specs/
| ├── test.js
| └── test-with-pageobjects.js
└── globals.js
```

We've pre-configured Nightwatch to run with Chrome by default. If you wish to run e2e tests in additional browsers, you will need to add a `nightwatch.config.js` or `nightwatch.json` in your project root to configure additional browsers. The config will be merged into the [internal Nightwatch config](https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-e2e-nightwatch/nightwatch.config.js).
#### `specs`
The main location where tests are located. Can contain sub-folders which can be targeted during the run using the `--group` argument. [More info](https://nightwatchjs.org/guide/running-tests/#test-groups).

Alternatively, you can completely replace the internal config with a custom config file using the `--config` option.
#### `custom-assertions`
Files located here are loaded automatically by Nightwatch and placed onto the `.assert` and `.verify` api namespaces to extend the Nightwatch built-in assertions. See [writing custom assertions](https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions) for details.

#### `custom-commands`
Files located here are loaded automatically by Nightwatch and placed onto the main `browser` api object to extend the built-in Nightwatch commands. See [writing custom commands](https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands) for details.

Consult Nightwatch docs for [configuration options](http://nightwatchjs.org/gettingstarted#settings-file) and how to [setup browser drivers](http://nightwatchjs.org/gettingstarted#browser-drivers-setup).
#### `page objects`
Working with page objects is a popular methodology in end-to-end UI testing. Files placed in this folder are automatically loaded onto the `.page` api namespace, with the name of the file being the name of the page object. See [working with page objects](https://nightwatchjs.org/guide/working-with-page-objects/) section for details.

#### `globals.js`
The external globals file which can hold global properties or hooks. See [test globals](https://nightwatchjs.org/gettingstarted/configuration/#test-globals) section.

## Installing in an Already Created Project

``` sh
vue add e2e-nightwatch
```

## Configuration

We've pre-configured Nightwatch to run with Chrome by default. Firefox is also available via `--env firefox`. If you wish to run end-to-end tests in additional browsers (e.g. Safari, Microsoft Edge), you will need to add a `nightwatch.conf.js` or `nightwatch.json` in your project root to configure additional browsers. The config will be merged into the [internal Nightwatch config](https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-e2e-nightwatch/nightwatch.config.js).

Alternatively, you can completely replace the internal config with a custom config file using the `--config` option.

Consult Nightwatch docs for [configuration options](https://nightwatchjs.org/gettingstarted/configuration/) and how to [setup browser drivers](http://nightwatchjs.org/gettingstarted#browser-drivers-setup).

## Running Tests

By default, all tests inside the `specs` folder will be run using Chrome. If you'd like to run end-to-end tests against Chrome (or Firefox) in headless mode, simply pass the `--headless` argument.

```sh
$ vue-cli-service test:e2e
```

**Running a single test**

To run a single test supply the filename path. E.g.:

```sh
$ vue-cli-service test:e2e tests/e2e/specs/test.js
```

**Skip Dev server auto-start**

If the development server is already running and you want to skip starting it automatically, pass the `--url` argument:

```sh
$ vue-cli-service test:e2e --url http://localhost:8080/
```

**Running in Firefox**

Support for running tests in Firefox is also available by default. Simply run the following (optionally add `--headless` to run Firefox in headless mode):

```sh
$ vue-cli-service test:e2e --env firefox [--headless]
```

**Running in Firefox and Chrome simultaneously**

You can also run the tests simultaneously in both browsers by supplying both test environments separated by a comma (",") - no spaces.

```sh
$ vue-cli-service test:e2e --env firefox,chrome [--headless]
```

**Running Tests in Parallel**

For a significantly faster test run, you can enable parallel test running when there are several test suites. Concurrency is performed at the file level and is distributed automatically per available CPU core.

For now, this is only available in Chromedriver. Read more about [parallel running](https://nightwatchjs.org/guide/running-tests/#parallel-running) in the Nightwatch docs.

```sh
$ vue-cli-service test:e2e --parallel
```

**Running with Selenium**

Since `v4`, the Selenium standalone server is not included anymore in this plugin and in most cases running with Selenium is not required since Nightwatch v1.0.

It is still possible to use the Selenium server, by following these steps:

__1.__ Install `selenium-server` NPM package:

```sh
$ npm install selenium-server --save-dev
```

__2.__ Run with `--use-selenium` cli argument:

```sh
$ vue-cli-service test:e2e --use-selenium
```
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"packages": [
"packages/@vue/babel-preset-app",
"packages/@vue/cli*",
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/babel-preset-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/babel-preset-app",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "babel-preset-app for vue-cli",
"main": "index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-init/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-init",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "init addon for vue-cli",
"main": "index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-overlay",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "error overlay & dev server middleware for vue-cli",
"main": "dist/client.js",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions packages/@vue/cli-plugin-babel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-babel",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "babel plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -21,8 +21,8 @@
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
"dependencies": {
"@babel/core": "^7.4.5",
"@vue/babel-preset-app": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/babel-preset-app": "^4.0.0-rc.3",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"babel-loader": "^8.0.6",
"webpack": "^4.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-e2e-cypress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-e2e-cypress",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "e2e-cypress plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"cypress": "^3.3.1",
"eslint-plugin-cypress": "^2.2.1"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/@vue/cli-plugin-e2e-nightwatch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-e2e-nightwatch",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "e2e-nightwatch plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"deepmerge": "^3.2.0",
"execa": "^1.0.0",
"nightwatch": "^1.2.2"
Expand All @@ -35,9 +35,9 @@
},
"peerDependencies": {
"@vue/cli-service": "^3.0.0 || ^4.0.0-0",
"selenium-server": "^3.141.59",
"chromedriver": "*",
"geckodriver": "*"
"geckodriver": "*",
"selenium-server": "^3.141.59"
},
"peerDependenciesMeta": {
"selenium-server": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-eslint",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "eslint plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"eslint-loader": "^2.1.2",
"globby": "^9.2.0",
"webpack": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-pwa",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "pwa plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"webpack": "^4.0.0",
"workbox-webpack-plugin": "^4.3.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/@vue/cli-plugin-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-router",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "router plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,10 +23,10 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2"
"@vue/cli-shared-utils": "^4.0.0-rc.3"
},
"devDependencies": {
"@vue/cli-test-utils": "^4.0.0-rc.2"
"@vue/cli-test-utils": "^4.0.0-rc.3"
},
"peerDependencies": {
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-typescript",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "typescript plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"@types/webpack-env": "^1.13.9",
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"fork-ts-checker-webpack-plugin": "^1.3.4",
"globby": "^9.2.0",
"ts-loader": "^6.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-unit-jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-unit-jest",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "unit-jest plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -25,7 +25,7 @@
"dependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^24.8.0",
"jest": "^24.8.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-unit-mocha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-unit-mocha",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "mocha unit testing plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
"dependencies": {
"@vue/cli-shared-utils": "^4.0.0-rc.2",
"@vue/cli-shared-utils": "^4.0.0-rc.3",
"jsdom": "^15.1.0",
"jsdom-global": "^3.0.2",
"mocha": "^6.1.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-vuex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-vuex",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "Vuex plugin for vue-cli",
"main": "index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
"access": "public"
},
"devDependencies": {
"@vue/cli-test-utils": "^4.0.0-rc.2"
"@vue/cli-test-utils": "^4.0.0-rc.3"
},
"peerDependencies": {
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
Expand Down
Loading

0 comments on commit 863d6bb

Please sign in to comment.