You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,52 @@
1
+
## 1.1.0
2
+
3
+
Major update to CodeceptJS. **NodeJS v 8.9.1** is now minimal Node version required.
4
+
This brings native async-await support to CodeceptJS. It is recommended to start using await for tests instead of generators:
5
+
6
+
```js
7
+
async () => {
8
+
I.amOnPage('/page');
9
+
consturl=awaitI.grabTextFrom('.nextPage');
10
+
I.amOnPage(url);
11
+
}
12
+
```
13
+
14
+
Thanks to [@Apshenkin](https://github.com/apshenkin) for implementation. Also, most helpers were refactored to use async-await. This made our code simpler. We hope that this encourages more users to send pull requests!
15
+
16
+
We also introduced strict ESLint policies for our codebase. Thanks to **[@Galkin](https://github.com/galkin)** for that.
17
+
18
+
***[Puppeteer] Helper introduced**. [Learn how to run tests headlessly with Google Chrome's Puppeteer](http://codecept.io/puppeteer/).
19
+
***[SeleniumWebdriver] Helper is deprecated**, it is recommended to use Protractor with config option `angular: false` instead.
20
+
*[WebDriverIO] nested iframe support in the within block by @reubenmiller. Example:
*[WebDriverIO] Support for `~` locator to find elements by `aria-label`. This behavior is similar as it is in Appium and helps testing cross-platform React apps. Example:
32
+
33
+
```html
34
+
<TextaccessibilityLabel="foobar">
35
+
CodeceptJS is awesome
36
+
</Text>
37
+
```
38
+
↑ This element can be located with `~foobar` in WebDriverIO and Appium helpers. Thanks to @flyskywhy
39
+
40
+
* Allow providing arbitrary objects in config includes by @rlewan
41
+
*[REST] Prevent from mutating default headers by @alexashley. See [#789](https://github.com/Codeception/CodeceptJS/pull/789)
42
+
*[REST] Fixed sending empty helpers with `haveRequestHeaders` in `sendPostRequest`. By @petrisorionel
43
+
* Fixed displaying undefined args in output by @APshenkin
44
+
* Fixed NaN instead of seconds in output by @APshenkin
45
+
* Add browser name to report file for `multiple-run` by @trollr
46
+
* Mocha updated to 4.x
47
+
48
+
49
+
1
50
## 1.0.3
2
51
3
52
*[WebDriverIO][Protractor][Nightmare] method `waitUntilExists` implemented by @sabau
CodeceptJS through helpers provides user friendly API to interact with a webpage. In this section we described using WebDriverIO helper which allows to control browser through Selenium WebDriver.
Copy file name to clipboardExpand all lines: docs/angular.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
# AngularJS E2E Testing with CodeceptJS
1
+
# Protractor Testing with CodeceptJS
2
2
3
3
## Introduction
4
4
5
5
CodeceptJS is an acceptance testing framework. In diversified world of JavaScript testing libraries it aims to create a unified high level API for end-to-end testing, powered by different backends.
6
-
CodeceptJS allows you to write a test and switch in config execution drivers: will it be *wedriverio*, *selenium-webdriver*, or *protractor* depends on you.
6
+
CodeceptJS allows you to write a test and switch in config execution drivers: will it be *wedriverio*, *puppeteer*, or *protractor* depends on you.
7
7
This way you aren't be bound to implementation, and your acceptance tests will work no matter of framework running them.
8
8
9
9
As you know, [Protractor](http://www.protractortest.org/#/) is an official tool for testing AngularJS applications.
@@ -96,7 +96,7 @@ For TodoMVC application you will have following config created in `codecept.json
96
96
"Protractor": {
97
97
"url": "http://todomvc.com/examples/angularjs/",
98
98
"driver": "hosted",
99
-
"browser": "firefox",
99
+
"browser": "chrome",
100
100
"rootElement": "body"
101
101
}
102
102
},
@@ -264,6 +264,21 @@ Scenario('create todo item', (I) => {
264
264
265
265
To learn more about refactoring options in CodeceptJS read [PageObjects guide](http://codecept.io/pageobjects/).
266
266
267
+
### Testing non-Angular Applications
268
+
269
+
Sure, Protractor can be used to test applications built without AngularJS. In this case you need to disable angular synchronization feature in config:
270
+
271
+
```js
272
+
"helpers": {
273
+
"Protractor": {
274
+
"url":"http://todomvc.com/examples/angularjs/",
275
+
"driver":"hosted",
276
+
"browser":"firefox",
277
+
"angular":false
278
+
}
279
+
}
280
+
```
281
+
267
282
### Extending
268
283
269
284
What if CodeceptJS doesn't provide some of Protractor functionality you actually need? Sure its API is to general,
Copy file name to clipboardExpand all lines: docs/basics.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ I object is an **actor**, an abstraction for a testing user. I is a proxy object
19
19
"helpers": {
20
20
"WebDriverIO": {
21
21
"url": "http://localhost",
22
-
"browser": "firefox"
22
+
"browser": "chrome"
23
23
}
24
24
}
25
25
```
@@ -36,15 +36,15 @@ However, behind the scene **all actions are wrapped in promises** inside the `I`
36
36
If you want to get information from a running test you can use `yield` inside a **generator function** and special methods of helpers started with `grab` prefix.
To use it with WebDriverIO install webdriverio package globally:
18
-
19
-
```sh
20
-
[sudo] npm install -g webdriverio
21
-
```
22
-
23
-
To use it with Protractor install protractor package globally:
24
-
25
-
```sh
26
-
[sudo] npm install -g protractor
27
-
```
28
-
29
-
To use it with Nightmare install nightmare and nightmare-upload packages globally:
30
-
31
-
```sh
32
-
[sudo] npm install -g nightmare nightmare-upload
33
-
```
34
-
35
3
### Local
36
4
37
-
CodeceptJS can also be installed locally
5
+
Use NPM install CodeceptJS:
38
6
39
7
```sh
40
8
npm install --save-dev codeceptjs
@@ -64,14 +32,34 @@ To use it with Nightmare install nightmare and nightmare-upload packages:
64
32
npm install nightmare nightmare-upload --save-dev
65
33
```
66
34
35
+
To use it with Puppeteer install puppeteer package:
36
+
37
+
```sh
38
+
npm install puppeteer --save-dev
39
+
```
40
+
41
+
67
42
## Meta Packages
68
43
69
44
By default it doesn't install any backends like Webdriverio, Protractor, or Nightmare, so you need to install corresponding packages manually, or install one of the provided meta-packages:
Copy file name to clipboardExpand all lines: docs/quickstart.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# QuickStart
2
2
3
-
**NodeJS v 6.11.1** and higher required to start.
3
+
**NodeJS v 8.9** and higher required to start.
4
4
CodeceptJS is multi-backend testing framework. In this guide we will use webdriverio as backend but the same rules applies to other backends like Protractor or Nightmare.
5
5
6
6
Install **CodeceptJS** with WebDriverIO using `codeceptjs-webdriverio` meta package from NPM.
@@ -17,8 +17,9 @@ or locally
17
17
npm install codeceptjs-webdriverio --save-dev
18
18
```
19
19
20
-
* To test with Nightmare install `codeceptjs-nightmare` package
20
+
* To test with Puppeteer install `codeceptjs-puppeteer` package
21
21
* To test with Protractor install `codeceptjs-protractor` package
22
+
* To test with Nightmare install `codeceptjs-nightmare` package
22
23
* For additional options see [Installation guide](http://codecept.io/installation/).
23
24
24
25
## Setup
@@ -42,7 +43,7 @@ No matter what helper you've chosen they will be similar in use.
0 commit comments