Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Mar 20, 2019
1 parent 6e6fdd6 commit 6e8a107
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ also check [our e2e tests](./test/e2e) for more information
```js
import { browser, commands: { Xvfb, BrowserStackLocal } } from 'tib'

describe('e2e', () => {
describe('my e2e test', () => {
let myBrowser

beforeAll(async () => {
myBrowser = browser('windows 10/chrome 71/browserstack/local/1920x1080', {
xvfb: false, // if true then Xvfb is automatically started before the browser
// and the displayNum=99 added to the process.env
myBrowser = await browser('windows 10/chrome 71/browserstack/local/1920x1080', {
xvfb: false, // if true or undefined then Xvfb is automatically started before
// the browser and the displayNum=99 added to the process.env
BrowserStackLocal: {
start: true, // default, if false then call 'const pid = await BrowserStackLocal.start()'
stop: true, // default, if false then call 'await BrowserStackLocal.stop(pid)'
Expand All @@ -63,10 +64,6 @@ describe('e2e', () => {
// IMPORTANT: if you use an (arrow) function then use
// a block'ed body due to an upstream issue
await page.runAsyncScript((path) => {
// this function is executed within the page context
// if you use features like Promises and are testing on
// older browsers make sure you have a polyfill already
// loaded
return new Promise(resolve => {
myRouter.on('navigationFinished', resolve)
window.myRouter.navigate(path)
Expand All @@ -75,11 +72,13 @@ describe('e2e', () => {
}
}
}
})
}, true) // autoStart, default True. If false you have to call browser.start()
})

afterAll(() => {
await myBrowser.close()
if (myBrowser) {
await myBrowser.close()
}
})

test('router', async () => {
Expand Down

0 comments on commit 6e8a107

Please sign in to comment.