Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
docs: improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Mar 27, 2017
1 parent 9a9b75a commit bb2272e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -10,12 +10,16 @@
Reliable, zero configuration end-to-end testing in BDD-style.

```ts
import {browser, it, test} from 'cybernaut';
import {browser, defineElement, it, test} from 'cybernaut';

test('Check existence of "clebert/cybernaut" repository on GitHub', async t => {
test('Star repository "clebert/cybernaut" on GitHub', async t => {
await t.perform(browser.loadPage('https://github.com/clebert/cybernaut'));

await t.assert(browser.pageTitle, it.should.match(/clebert\/cybernaut/));
await t.assert(browser.pageTitle, it.should.contain('clebert/cybernaut'));

const starButton = defineElement('ul.pagehead-actions > li:nth-child(2) > a:nth-child(1)');

await t.perform(starButton.click());
});
```

Expand Down
Binary file modified example/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions example/tests/cybernaut-repo.e2e.js
@@ -1,7 +1,11 @@
const {browser, it, test} = require('cybernaut');
const {browser, defineElement, it, test} = require('cybernaut');

test('Check existence of "clebert/cybernaut" repository on GitHub', async t => {
test('Star repository "clebert/cybernaut" on GitHub', async t => {
await t.perform(browser.loadPage('https://github.com/clebert/cybernaut'));

await t.assert(browser.pageTitle, it.should.match(/clebert\/cybernaut/));
await t.assert(browser.pageTitle, it.should.contain('clebert/cybernaut'));

const starButton = defineElement('ul.pagehead-actions > li:nth-child(2) > a:nth-child(1)');

await t.perform(starButton.click());
});

0 comments on commit bb2272e

Please sign in to comment.