Skip to content

Commit

Permalink
Merge pull request #106 from angrykoala/dev
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
angrykoala authored Mar 31, 2018
2 parents 012667e + 14f6817 commit 6e636f2
Show file tree
Hide file tree
Showing 65 changed files with 831 additions and 568 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ os:
- linux
node_js:
- "stable"
- "8.9.4"
- "8.0.0"
sudo: false
env:
- NO_SANDBOX=true
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.5.0 / 2018-03-31
==================

* Added optional selector to findByTextContaining
* WaitFor support for functions and xPath
* Back, forward and refresh methods
* Settings updated if changed between browser creation
* Fixed bug with error messages expect and actual values
* Support for node 8.0.0
* Remove unnecessary files from pack
* Major code refactor
* Mixwith, compositer and deep-equal dependencies added

0.4.6 / 2018-03-24
==================

Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _by @angrykoala_
[![npm version](https://badge.fury.io/js/wendigo.svg)](https://badge.fury.io/js/wendigo)
[![Build Status](https://travis-ci.org/angrykoala/wendigo.svg?branch=master)](https://travis-ci.org/angrykoala/wendigo)

> A proper monster for front-end testing
> A proper monster for front-end automated testing
**Wendigo** is a wrapper of [Puppeteer](https://github.com/GoogleChrome/puppeteer) with the purpose of making automated testing easier and simpler. Install it with `npm install --save-dev wendigo`

Expand Down Expand Up @@ -226,13 +226,17 @@ Returns the current url of the page
**wait(ms=250)**
Waits for the given milliseconds.

**waitFor(selector, timeout=500)**
**waitFor(selector, timeout=500, ...args?)**
Waits for given selector to exists and be visible, with the given timeout in milliseconds.

```js
await browser.waitFor(".popup");
```

If a function is passed instead of a selector, it will wait for that function to resolve in the browser context to true, the optional arguments are passed to the function.

> Css and Xpath selectors supported
**waitUntilNotVisible(selector, timeout=500)**
Waits until the given selector is no longer visible or doesn't exists, with the given timeout in milliseconds.

Expand All @@ -250,14 +254,16 @@ elements.length; // 1

Optionally, a selector can be passed as first argument to perform a text search on children of that element only.

**findByTextContaining(text)**
**findByTextContaining(selector?, text)**
Returns an array with all the elements with a text that contains the given text.

```js
const elements = await browser.findByTextContaining("Paragraph");
elements.length; // 2
```

Otionally, a selector can be passed as first argument to perform a text search on children of that element only.

**type(selector, text)**
Types given text in the first element matching given selector. If a value is already present, writes the new value at the beginning.

Expand Down Expand Up @@ -340,6 +346,15 @@ Will throw if no element is found.

> Css, Xpath and Dom selectors supported
**back()**
Navigates to previous page in history.

**forward()**
Navigates to next page in history.


**refresh()**
Reloads current page.

## Assert
The submodule `browser.assert` provide some out-of-the-box assertions that can be used to easily write tests that are readable without having to specifically query for elements o perform evaluations. All the assertions have a last optional parameter (msg?) to define a custom assertion message.
Expand Down
9 changes: 9 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
const path = require('path');

module.exports = {
injectionScripts: {
path: path.join(__dirname, "injection_scripts"),
files: ["selector_query.js", "wendigo_utils.js"]
}
};
16 changes: 0 additions & 16 deletions lib/assertions/utils/text_utils.js

This file was deleted.

282 changes: 0 additions & 282 deletions lib/browser/browser.js

This file was deleted.

Loading

0 comments on commit 6e636f2

Please sign in to comment.