Skip to content

Commit 43d9b74

Browse files
committed
chore: update readme/api
1 parent 1abc6d8 commit 43d9b74

File tree

2 files changed

+8
-59
lines changed

2 files changed

+8
-59
lines changed

README.md

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This probably means that `tib` is deliberately less integrated then other packag
2424
- Safari
2525
- IE (_untested_)
2626
- Edge (_untested_)
27+
- jsdom
2728
- BrowserStack
2829

2930
All browser/provider specific dependencies are peer dependencies and are dynamically loaded. You only need to install the peer-dependencies you plan to use
@@ -173,72 +174,20 @@ describe('my e2e test', () => {
173174

174175
Its a Selenium error and means the browser couldnt be started or exited immeditately after start. Try to run with `xvfb: true`
175176

176-
#### Can I use this package directly from source?
177-
178-
Yes, but you will probably need to adapt your babel config as this package uses ES6 and dynamic imports. If you use Jest, you also need to change your Jest config.
179-
180-
##### Babel config
181-
182-
If you use this package from source or just manually import the ES6 source, you will probably need to tell Babel to also transpile this package
183-
184-
> use `babel.config.js` if Babel fails to transpile with `.babelrc.js`
185-
186-
Install the [dynamic-import-node](https://github.com/airbnb/babel-plugin-dynamic-import-node) plugin:
187-
```sh
188-
yarn add -D babel-plugin-dynamic-import-node
189-
```
190-
191-
```js
192-
module.exports = {
193-
env: {
194-
test: {
195-
exclude: /node_modules\/(?!(tib))/,
196-
plugins: ['dynamic-import-node'],
197-
presets: [
198-
[ '@babel/preset-env', {
199-
targets: { node: 'current' }
200-
}]
201-
]
202-
}
203-
},
204-
}
205-
```
206-
207-
##### Jest config
208-
209-
If you use Jest for testing, you might also need to exclude `tib` from the [`transformIgnorePatterns`](https://jestjs.io/docs/en/configuration#transformignorepatterns-array-string) config option:
210-
211-
> You could remove the `exclude` in the Babel config above if you only use this module with Jest, but you still need the `dynamic-import-node` plugin
212-
213-
```js
214-
// jest.config.js
215-
transformIgnorePatterns: [
216-
'/node_modules/(?!(tib))/'
217-
],
218-
219-
transform: {
220-
'^.+\\.js$': 'babel-jest'
221-
},
222-
```
223-
224177
## Known issues / caveats
225178

226179
- If Node force exits then local running commands might keep running (eg geckodriver, chromedriver, Xvfb, browserstack-local)
227180
- _workaround_: none unfortunately
228-
- On CircleCI puppeteer sometimes triggers `Protocol error (Runtime.callFunctionOn): Target closed` error on page.evaluate
181+
- On CircleCI puppeteer sometimes triggers `Protocol error (Runtime.callFunctionOn): Target closed` error on page.evaluate. This could be related to a version mismatch between the browser and puppeteer.
229182
- _workaround_: use `chrome/selenium`
230183
- with Firefox you cannot run two page functions at the same time, also not when they are async
231184
- _workaround_: combine the functionality you need in a single page function
232185
- with Safari you can get ScriptTimeoutError on asynchronous page function execution. Often the timeout seems false as it is in ms and the scripts are still executed
233186
- _workaround_: wrap runAsyncScript calls in `try/catch` to just ignore the timeout :)
234187

235-
## Thanks
236-
- [Team Nuxt.js](https://github.com/nuxt/nuxt.js/) for providing a browserstack key to test with
237-
238-
## TODO
239-
- validation
188+
## Todo's
240189
- local ie/edge
241-
- more platforms, which ones?
242-
- SauceLabs (unable to test as I have no key)
243-
- screenshotting
190+
- more platforms
191+
- SauceLabs (key required)
192+
- others?
244193
- increase coverage

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ This function is called after a page is opened and receives the `webpage` instan
3737
It should return or resolve to an object which is used in the [page proxy](#pageproxy)
3838

3939
### `staticServer`
40-
_object_
40+
_boolean_ / _object_
4141

42-
The configuration for the included static webserver.
42+
If an object the configuration for the included static webserver. If `true` then the default configuration will be used.
4343

4444
- `host` (_string_, default `localhost`)<br/>
4545
The hostname / ip to run the static server on. Optionally you can also set the `HOST` env variable.

0 commit comments

Comments
 (0)