You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-57Lines changed: 6 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ This probably means that `tib` is deliberately less integrated then other packag
24
24
- Safari
25
25
- IE (_untested_)
26
26
- Edge (_untested_)
27
+
- jsdom
27
28
- BrowserStack
28
29
29
30
All browser/provider specific dependencies are peer dependencies and are dynamically loaded. You only need to install the peer-dependencies you plan to use
Its a Selenium error and means the browser couldnt be started or exited immeditately after start. Try to run with `xvfb: true`
175
176
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
-
224
177
## Known issues / caveats
225
178
226
179
- If Node force exits then local running commands might keep running (eg geckodriver, chromedriver, Xvfb, browserstack-local)
227
180
-_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.
229
182
-_workaround_: use `chrome/selenium`
230
183
- with Firefox you cannot run two page functions at the same time, also not when they are async
231
184
-_workaround_: combine the functionality you need in a single page function
232
185
- 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
233
186
-_workaround_: wrap runAsyncScript calls in `try/catch` to just ignore the timeout :)
234
187
235
-
## Thanks
236
-
-[Team Nuxt.js](https://github.com/nuxt/nuxt.js/) for providing a browserstack key to test with
0 commit comments