taktakpeops / jest-environment-browserstack Goto Github PK
View Code? Open in Web Editor NEWA Jest environment for using Browserstack and Browserstack-Local with Webdriver-manager
License: MIT License
A Jest environment for using Browserstack and Browserstack-Local with Webdriver-manager
License: MIT License
Issue
For every pull-requests open, the first time the tests are running they are often failing
To be done
Find a way to make the tests more stable and get a green light on all first test run (when applicable).
I followed the README.md and ran
cd examples/with-bt-local
yarn install
yarn test
and I got the following error message
>
`
$ yarn test
yarn run v1.19.0
$ npm-run-all -p -r start test:jest
$ PORT=8080 node scripts/start.js
$ jest --ci --runInBand
PASS src/App.test.js
FAIL src/__visual_testing__/App.test.js
● Test suite failed to run
● Validation Error:
Test environment browserstack cannot be found. Make sure the testEnvironment configuration option points to an existing node module.
Configuration Documentation:
https://jestjs.io/docs/configuration.html
Test environment browserstack cannot be found. Make sure the testEnvironment configuration option points to an existing node module.
Configuration Documentation:
https://jestjs.io/docs/configuration.html
Instead of using a beta version for the Selenium-webdriver 4, I am thinking on switching to this module https://github.com/w3c-webdriver/w3c-webdriver
Another idea I am having is to maybe leave up to the user the choice of the NPM module for interacting with the Selenium Web Driver (any version supporting the API V4+)
❯ yarn add --dev @jest-environment-browserstack/selenium-webdriver -W
yarn add v1.22.4
[1/4] 🔍 Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@jest-environment-browserstack%2fselenium-webdriver: Not found".
In puppeteer, I can do something like this
browser = await puppeteer.launch({
headless: HEADLESS,
dumpio: true,
executablePath: process.env.CHROME_BIN || null,
args: ['--single-process','--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-gpu', '--disable-software-rasterizer']
});
await page.setViewport({...options, height: Math.min(height, 20000)});
So when I take a screenshot, it captures everything without having to scroll to the end.
Can something similar be done with jest-environment-browserstack?
Even though I have the browserstack login credentials defined, it still says my login credential is invalid.
env | grep -i browserstack
BROWSERSTACK_USERNAME=xxxx
BROWSERSTACK_ACCESS_KEY=yyyy
question Which command would you like to run?: test:visual
$ jest --testNamePattern=VisualTest --update-snapshot
FAIL src/App.e2e.test.js
● Test suite failed to run
valid credentials for Browserstack are requierd
at new BrowserstackEnvironment (node_modules/jest-environment-browserstack/lib/index.js:28:23)
FAIL src/__visual_testing__/App.test.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.