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

@wdio/devtools-service

Package Overview
Dependencies
Maintainers
3
Versions
445
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/devtools-service

A WebdriverIO service that allows you to run Chrome DevTools commands in your tests

  • 8.39.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
148K
increased by14.95%
Maintainers
3
Weekly downloads
 
Created

What is @wdio/devtools-service?

@wdio/devtools-service is a WebdriverIO service that provides integration with Chrome DevTools Protocol. It allows you to use Chrome DevTools features in your WebdriverIO tests, such as capturing performance metrics, taking screenshots, and more.

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

Capturing Performance Metrics

This feature allows you to capture performance metrics such as First Meaningful Paint, DOM Content Loaded, and more. The code sample demonstrates how to capture these metrics for a given URL.

const { remote } = require('webdriverio');
const options = { capabilities: { browserName: 'chrome' } };
(async () => {
  const browser = await remote(options);
  await browser.url('https://example.com');
  const metrics = await browser.getMetrics();
  console.log(metrics);
  await browser.deleteSession();
})();

Taking Screenshots

This feature allows you to take screenshots of the current browser window. The code sample demonstrates how to navigate to a URL and take a screenshot.

const { remote } = require('webdriverio');
const options = { capabilities: { browserName: 'chrome' } };
(async () => {
  const browser = await remote(options);
  await browser.url('https://example.com');
  const screenshot = await browser.takeScreenshot();
  console.log(screenshot);
  await browser.deleteSession();
})();

Network Throttling

This feature allows you to simulate different network conditions. The code sample demonstrates how to throttle the network to simulate a slower connection.

const { remote } = require('webdriverio');
const options = { capabilities: { browserName: 'chrome' } };
(async () => {
  const browser = await remote(options);
  await browser.url('https://example.com');
  await browser.throttle({
    offline: false,
    downloadThroughput: 500 * 1024 / 8,
    uploadThroughput: 500 * 1024 / 8,
    latency: 20
  });
  await browser.deleteSession();
})();

Other packages similar to @wdio/devtools-service

Keywords

FAQs

Package last updated on 18 Jun 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