An open API service indexing awesome lists of open source software.

https://github.com/codekie/browserstack-status-update-sample


https://github.com/codekie/browserstack-status-update-sample

Last synced: 5 months ago
JSON representation

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`