Skip to content

Commit edf0106

Browse files
committed
added readme
1 parent c0685ad commit edf0106

File tree

2 files changed

+102
-48
lines changed

2 files changed

+102
-48
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,105 @@
11
# vue-cli-plugin-e2e-codeceptjs
22

3-
> e2e-codeceptjs plugin for vue-cli
3+
*Hey, how about some end 2 end testing for your Vue apps?* πŸ€”
44

5-
[TODO]
5+
*Let's do it together! Vue, me, [CodeceptJS](https://codecept.io) & [Puppeteer](https://pptr.dev).* πŸ€—
6+
7+
*Browser testing was never that simple. Just see it!* 😍
8+
9+
```js
10+
I.amOnPage('/');
11+
I.click('My Component Button');
12+
I.see('My Component');
13+
I.say('I am happy!');
14+
// that's right, this is a valid test!
15+
```
16+
17+
## How to try it?
18+
19+
```
20+
npm i vue-cli-plugin-codeceptjs-puppeteer --save-dev
21+
```
22+
23+
This will install CodeceptJS, CodeceptUI & Puppeteer with Chrome browser.
24+
25+
To add CodeceptJS to your project invoke installer:
26+
27+
```
28+
vue invoke vue-cli-plugin-codeceptjs-puppeteer --save-dev
29+
```
30+
31+
> Should we add a test component so you could see how to interact with elements in your tests? Agree, if you start with an empty project & you don't mind we update your App.js & main.js files to add a test component.
32+
33+
## Running Tests
34+
35+
We added npm scripts:
36+
37+
* `test:e2e` - will execute tests with browser opened. If you installed test component, and started a test server, running this command will show you a brower window passed test.
38+
* Use `--headless` option to run browser headlessly
39+
* Use `--serve` option to start a dev server before tests
40+
41+
42+
Examples:
43+
44+
```
45+
npm run test:e2e
46+
npm run test:e2e -- --headless
47+
npm run test:e2e -- --serve
48+
```
49+
50+
> This command is a wrapper for `codecept run --steps`. You can use the [Run arguments and options](https://codecept.io/commands#run) here.
51+
52+
* `test:e2e:parallel` - will execute tests headlessly in parallel processes (workers). By default runs tests in 2 workers.
53+
* Use an argument to set number of workers
54+
* Use `--serve` option to start dev server before running
55+
56+
Examples:
57+
58+
```
59+
npm run test:e2e:parallel
60+
npm run test:e2e:parallel -- 3
61+
npm run test:e2e:parallel -- 3 --serve
62+
```
63+
64+
> This command is a wrapper for `codecept run-workers 2`. You can use the [Run arguments and options](https://codecept.io/commands#run-workers) here.
65+
66+
* `test:e2e:open` - this opens interactive web test runner. So you could see, review & run your tests from a browser.
67+
68+
![](https://user-images.githubusercontent.com/220264/70399222-b7a1bc00-1a2a-11ea-8f0b-2878b0328161.gif)
69+
70+
```
71+
npm run test:e2e:open
72+
```
73+
74+
## Directory Structure
75+
76+
Generator has created these files:
77+
78+
```js
79+
codecept.conf.js πŸ‘ˆ codeceptjs config
80+
jsconfig.json πŸ‘ˆ enabling type definitons
81+
tests
82+
β”œβ”€β”€ e2e
83+
β”‚Β Β  β”œβ”€β”€ app_test.js πŸ‘ˆ demo test, edit it!
84+
β”‚Β Β  β”œβ”€β”€ output πŸ‘ˆ temp directory for screenshots, reports, etc
85+
β”‚Β Β  └── support
86+
β”‚Β Β  └── steps_file.js πŸ‘ˆ common steps
87+
└── steps.d.ts πŸ‘ˆ type definitions
88+
```
89+
90+
If you agreed to create a demo component, you will also see `TestMe` component in `src/components` folder.
91+
92+
## How to write tests?
93+
94+
* Open `tests/e2e/app_js` and see the demo test
95+
* Execute a test & use interactive pause to see how CodeceptJS works
96+
* [Learn CodeceptJS basics](https://codecept.io/basics)
97+
* [Learn how to write CodeceptJS tests with Puppeteer](https://codecept.io/puppeteer)
98+
* [See full reference for CodeceptJS Puppeteer Helper](https://codecept.io/helpers/Puppeteer)
99+
* Ask your questions in [Slack](http://bit.ly/chat-codeceptjs) & [Forum](https://codecept.discourse.group/)
100+
101+
## Enjoy testing!
102+
103+
Testing is simple & fun, enjoy it!
104+
105+
WIth ❀ [CodeceptJS Team](https://codecept.io)

β€Žui.jsβ€Ž

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
Β (0)