You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

webdriver-io-capture-it

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webdriver-io-capture-it

An SDK to capture it() block content in WebDriver.IO and log it as Test Case Name.

4.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

webdriver-io-capture-it

A WebDriver.IO service that captures the it() block test case names and logs them in the browser console using the browser.execute() function.

Installation

Install the package using npm:

npm install webdriver-io-capture-it

Usage

  • Add the wdio-capture-it service to your wdio.conf.js file in your WebDriver.IO project:
const WdioCaptureIt = require('webdriver-io-capture-it').default;

exports.config = {
    // ...
    services: [
        [WdioCaptureIt, {}],
        // ... other services
    ],
    // ...
};
  • Run your WebDriver.IO tests as usual. The test case names from the it() blocks will be captured and logged in the browser console at the beginning of each test.

Example

Here's an example of how the test case name will be logged in the browser console:

Test Case Name: should display the correct title

TypeScript Support

This package includes a TypeScript declaration file to support TypeScript projects. Make sure to install the @wdio/types package to use the types correctly:

npm install @wdio/types

After installing the necessary packages, you can import the WdioCaptureIt service in your TypeScript configuration file:

import WdioCaptureIt from 'webdriver-io-capture-it';

export const config: WebdriverIO.Config = {
    // ...
    services: [
        [WdioCaptureIt, {}],
        // ... other services
    ],
    // ...
};

License

MIT License

Keywords

webdriverio

FAQs

Package last updated on 04 May 2023

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