https://github.com/davyjoneslocker/ember-cli-test-interactions
Ember acceptance test helpers.
https://github.com/davyjoneslocker/ember-cli-test-interactions
Last synced: 8 months ago
JSON representation
Ember acceptance test helpers.
- Host: GitHub
- URL: https://github.com/davyjoneslocker/ember-cli-test-interactions
- Owner: DavyJonesLocker
- License: mit
- Created: 2015-07-31T19:55:59.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T15:44:01.000Z (almost 9 years ago)
- Last Synced: 2025-06-22T17:11:27.778Z (12 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 3
- Watchers: 7
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ember-cli-test-interactions
**[ember-cli-test-interactions is built and maintained by DockYard, contact us for expert Ember.js consulting](https://dockyard.com/ember-consulting)**.
Ember-cli Test Interactions is a library providing some convenience test
helper functions. It allows for more expressive acceptance tests and
cuts out alot of the boiler plate functions required to find elements
before acting upon them.
For example, compare filling in an HTML `input` with and without the
library:
```javascript
// with ember-cli-test-interactions
fillInByLabel('Name', 'Jane Doe');
// without
const label = find("label:contains('Jane Doe')");
const input = find(`#${label.attr('for')}`);
fillIn(input, 'Jane Doe');
```
## Install
For ember-cli >= `0.2.3`:
```shell
ember install ember-cli-test-interactions
```
For ember-cli < `0.2.3`:
```shell
ember install:addon ember-cli-test-interactions
```
## Use
Once the addon is installed, the helper functions will be available for
import via `'../tests/helpers/interactions'`.
Import the functions you need in each of your acceptance test files:
```javascript
import { module, test } from 'qunit';
import { clickLink } from '../tests/helpers/interactions';
test('clicking name transitions to route of the user', function(assert) {
visit('/');
andThen(clickLink('Jane Doe'));
andThen(() => {
assert.equal(url, '/users/jane-doe', "expected current path to be
Jane Doe's");
});
});
```
## Legal ##
[DockYard](http://dockyard.com/ember-consulting), Inc. © 2015
[@dockyard](http://twitter.com/dockyard)