https://github.com/codekie/browserstack-status-update-sample
https://github.com/codekie/browserstack-status-update-sample
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codekie/browserstack-status-update-sample
- Owner: codekie
- Created: 2020-02-19T16:57:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:42:32.000Z (over 3 years ago)
- Last Synced: 2025-02-02T14:35:11.417Z (over 1 year ago)
- Language: JavaScript
- Size: 343 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
browserstack-status-update-sample
=================================
This repo only exists to reproduce an issue that I'm having with updating a session-status on browserstack.
The issue is that after each test-suite, a session-update will be sent to Browserstack. The request contains a status
and a reason (if the suite had at least one failing test). In this setup, it seems that the status is applied, but the
reason is ignored (or overwritten).
**UPDATE 2020-03-06**
Browserstack's support found out that Nightwatch's Browserstack-"transport module" sends a session-update after each test-suite, with a blank reason. In this case that resulted in an overwritten reason.
A pull request has been created in Nightwatch's repo: https://github.com/nightwatchjs/nightwatch/pull/2357
Requirements
------------
Required node version: `lts/dubnium`
Installation
------------
`npm install`
Configuration
-------------
Following environment-variables have to be set:
- `BROWSERSTACK_USER`: Browserstack-username
- `BROWSERSTACK_ACCESS_KEY`: Access-key for the user
Run the tests
-------------
`npm run test`
Important Files
---------------
- The function (`sendBrowserStackSessionStatus`) which sends the session-update to browserstack, is located
in `test/e2e/util/browserstack.js`
- The hook (`afterEach`) that triggers the session update (which is executed after every completed test-suite) is
located in `test/config/nightwatch-globals.js`
- Setting the artificial delay `DELAY__BROWSERSTACK_STATUS` so something like `5000`ms (may vary between a value of
`1000` and `15000` to make it work), will make the `reason` work
- The Nightwatch-configuration for Browserstack is in `test/config/nightwatch-browserstack.conf.js`
- The test-suites are in `test/e2e/scenarios`