Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wdio/browserstack-service

Package Overview
Dependencies
Maintainers
3
Versions
465
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/browserstack-service

WebdriverIO service for better Browserstack integration

  • 9.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132K
increased by5.55%
Maintainers
3
Weekly downloads
 
Created

What is @wdio/browserstack-service?

@wdio/browserstack-service is a WebdriverIO service that provides integration with BrowserStack, a cloud-based cross-browser testing platform. This service allows you to run your WebdriverIO tests on BrowserStack's infrastructure, enabling you to test your web applications across a wide range of browsers and devices.

What are @wdio/browserstack-service's main functionalities?

BrowserStack Local Testing

This feature allows you to test your local applications on BrowserStack by establishing a secure connection between your local machine and BrowserStack's infrastructure.

const { remote } = require('webdriverio');
const browserstack = require('@wdio/browserstack-service');

const options = {
  user: 'YOUR_BROWSERSTACK_USERNAME',
  key: 'YOUR_BROWSERSTACK_ACCESS_KEY',
  services: ['browserstack'],
  capabilities: {
    'bstack:options': {
      os: 'Windows',
      osVersion: '10',
      local: true,
      seleniumVersion: '3.141.59'
    },
    browserName: 'chrome',
    browserVersion: 'latest'
  }
};

(async () => {
  const browser = await remote(options);
  await browser.url('http://localhost:3000');
  console.log(await browser.getTitle());
  await browser.deleteSession();
})();

Parallel Testing

This feature allows you to run tests in parallel across multiple browsers and operating systems, significantly reducing the time required for test execution.

const { remote } = require('webdriverio');
const browserstack = require('@wdio/browserstack-service');

const options = {
  user: 'YOUR_BROWSERSTACK_USERNAME',
  key: 'YOUR_BROWSERSTACK_ACCESS_KEY',
  services: ['browserstack'],
  capabilities: [
    {
      'bstack:options': {
        os: 'Windows',
        osVersion: '10',
        seleniumVersion: '3.141.59'
      },
      browserName: 'chrome',
      browserVersion: 'latest'
    },
    {
      'bstack:options': {
        os: 'OS X',
        osVersion: 'Big Sur',
        seleniumVersion: '3.141.59'
      },
      browserName: 'safari',
      browserVersion: 'latest'
    }
  ]
};

(async () => {
  const browser1 = await remote(options.capabilities[0]);
  const browser2 = await remote(options.capabilities[1]);
  await browser1.url('https://www.example.com');
  await browser2.url('https://www.example.com');
  console.log(await browser1.getTitle());
  console.log(await browser2.getTitle());
  await browser1.deleteSession();
  await browser2.deleteSession();
})();

Automated Screenshots

This feature allows you to take automated screenshots of your web application during test execution, which can be useful for visual regression testing and debugging.

const { remote } = require('webdriverio');
const browserstack = require('@wdio/browserstack-service');

const options = {
  user: 'YOUR_BROWSERSTACK_USERNAME',
  key: 'YOUR_BROWSERSTACK_ACCESS_KEY',
  services: ['browserstack'],
  capabilities: {
    'bstack:options': {
      os: 'Windows',
      osVersion: '10',
      seleniumVersion: '3.141.59'
    },
    browserName: 'chrome',
    browserVersion: 'latest'
  }
};

(async () => {
  const browser = await remote(options);
  await browser.url('https://www.example.com');
  await browser.saveScreenshot('./screenshot.png');
  await browser.deleteSession();
})();

Other packages similar to @wdio/browserstack-service

Keywords

FAQs

Package last updated on 21 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc