Generate WebdriverIO Tests from Google Chrome DevTools Recordings.

Overview

WebdriverIO Chrome Recorder Build npm

This repo provide tools to convert JSON user flows from Google Chrome DevTools Recorder to WebdriverIO test scripts programmatically (WebdriverIO v7.24.0 or higher required).

Converts multiple recordings to WebdriverIO tests in one go (out-of-the-box glob support)
🗂 User can pass their custom path to export tests.
💃 Users can also use a dry run to see the interim output of the recordings
👨‍💻 Programmatic API which users can use in their own project to create plugins or custom scripts.

Alternatively, you can export JSON user flows as WebdriverIO test scripts straight away from Chrome DevTools with our WebdriverIO Recorder Chrome extension.

🏗 Installation

npm install -g @wdio/chrome-recorder

🚀 Usage

To quickly run the interactive CLI, run:

npx @wdio/chrome-recorder

The CLI will prompt you to enter the path of directory or file of the chrome devtool recordings that you will modify and path to write the generated WebdriverIO tests

⚡️ Transform individual recordings

npx @wdio/chrome-recorder <path to the chrome devtools recording>

⚡️ Transform multiple recordings

npx @wdio/chrome-recorder <path to the chrome devtools recording>*.json

👉 By default output will be written to webdriverio folder. If you don't have these folders, tool will create it for you or install WebdriverIO by running npm init webdriverio in your project.

You can specify different output directory, specify that via CLI:

npx @wdio/chrome-recorder <path to the chrome devtools recording> --output=<folder-name>

⚙️ CLI Options

Option Description
-d, --dry Dry run the output of the transformed recordings
-o, --output Output location of the files generated by the exporter

💻 Programmatic API

import { stringifyChromeRecording } from '@wdio/chrome-recorder';

const recordingContent = {
  title: 'recording',
  steps: [
    {
      type: 'setViewport',
      width: 1905,
      height: 223,
      deviceScaleFactor: 1,
      isMobile: false,
      hasTouch: false,
      isLandscape: false,
    },
  ],
};

const stringifiedContent = await stringifyChromeRecording(
  JSON.stringify(recordingContent),
);

console.log(stringifiedContent);
// Console Log output
//
// describe('recording', function () {
//   it('tests recording', function (browser) {
//     browser.setWindowRect({ width: 1905, height: 223 });
//   });
// });

🐛 Issues

Issues with this schematic can filed here

If you want to contribute (or have contributed in the past), feel free to add yourself to the list of contributors in the package.json before you open a PR!

👨‍💻 Development

Getting started

🛠️ Node.js and npm are required for the scripts. Make sure it's installed on your machine.

⬇️ Install the dependencies for the WebdriverIO chrome recorder tool

npm install

👷‍♂️ Build the tools using typescript compiler

npm run build

🏃 Run the tool

./bin/wdio-chrome-recorder.js

🧪 Unit Testing

Run the unit tests using mocha as a runner and test framework

npm run test

♻️ Clean build files

npm run clean

Supported Chrome Devtools Recorder Steps

We only support following steps:

  1. setViewport
  2. navigate
  3. click
  4. change
  5. keyDown
  6. keyUp
  7. scroll
  8. doubleClick
  9. hover
  10. emulateNetworkConditions
  11. waitForElement

If the step type is not mentioned above, a warning will be shown.


For more information on WebdriverIO see the homepage. The initial implementation was inspired by Nightwatch Chrome Recorder

You might also like...

基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React

基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React

English | 简体中文 基于React开发的移动web调试工具 更新日志 简单易用 功能全面 易扩展 高性能 使用cdn方式,一键接入 类Chrome devtools, 内嵌React开发者工具,支持日志,网络,元素,代理,存储,性能等, 具有更好的网络捕获能力和丰富的日志展现形式 暴露内部

Dec 25, 2022

The universal DevTools for LIFF (WebView) browser

The universal DevTools for LIFF (WebView) browser

LIFF Inspector 🔬 The universal DevTools for LIFF (WebView) browser LIFF Inspector is the official DevTools for LIFF(LNE Frontend Framework) that is i

Dec 19, 2022

API and CLI tool to fetch and query Chome DevTools heap snapshots.

Puppeteer Heap Snapshot Capture heap snapshots and query the snapshot for objects matching a set of properties. Read more about it in this blog post.

Jan 3, 2023

React-query devtools for swr

React-query devtools for swr

React-query devtools for swr

Aug 14, 2022

⚡Chrome extension allows you to create lists of Google and Github dork to open multiple tabs with one click, import "scope/out of scope" from #HackerOne #Bugcrowd #Intigriti ...

⚡Chrome extension allows you to create lists of Google and Github dork to open multiple tabs with one click, import

FastDork v0.1 This chrome extension allows you to create lists of Google and Github dork to open multiple tabs with one click, import "scope/out of sc

Dec 31, 2022

🚀 A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

🚀 A web extension starter built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and Opera..

Web Extension Starter A web extension starter, built with React, Typescript, and Tailwind CSS. Build once, and run on multiple browsers: Google Chrome

Dec 28, 2022

auto-vote-topgg automates voting for bots on top.gg using google chrome!

auto-vote-topgg auto-vote-topgg automates voting for bots on top.gg using google chrome! uses your account thats already logged into top.gg you must b

Jan 29, 2022

Firebase SDK 9 + Google Sign In + Chrome Extension Manifest Version 3 + Webpack

Firebase SDK 9 + Google Sign In + Chrome Extension Manifest Version 3 + Webpack Demo Find this Chrome Extension Setup and working demo here or on Yout

Dec 28, 2022

Based on Google Chrome recorder, implement UI interface capture and notify the result to the target mailbox

Based on Google Chrome recorder, implement UI interface capture and notify the result to the target mailbox

chrome-recoder-crawler README-CN Modify the .js file exported by Google Chrome recorder. By default, the innerText property of the node operated in th

Oct 18, 2022
Comments
  • Add support for text and XPath selector

    Add support for text and XPath selector

    DevTools Recorder support text and XPath selector from Chrome 108 onwards. I am wondering if there are similar selector in WebdriverIO?

    Here is the example step's json.

    {
          "type": "click",
          "target": "main",
          "selectors": [
            [
              "aria/Proceed to checkout"
            ],
            [
              "[data-test=checkout]"
            ],
            [
              "xpath///*[@data-test=\"checkout\"]"
            ],
            [
              "text/Total: $0.00"
            ]
          ]
        }
    
    Screen Shot 2022-10-16 at 9 35 19 AM
    opened by jecfish 2
  • Duration is not converted

    Duration is not converted

    When I use the duration parameter in Chrome Recorder, I'm not able to get this parameter when I convert the Json to the Webdriver script.

    Is there a solution for that?

    Regards

    opened by bevrard 1
Releases(0.5.0)
Owner
WebdriverIO
Next-gen browser and mobile automation test framework for Node.js
WebdriverIO
Running webdriverio in docker containers so you can easily add tests to your CI.

WebDriverIO tests in Docker Running WebdriverIO tests in a docker container allows you to easily add tests to your CI. About This project uses the aut

Promenade 6 Dec 3, 2022
An ongoing curated list of frameworks, books, articles, talks, screencasts, recordings, libraries, learning tutorials and shiny resources about Javascript Development.

Javascript Frameworks Development Welcome to the world of Javascript Frameworks. An ongoing curated list of frameworks, books, articles, talks, screen

Paul Veillard 3 Jul 31, 2022
A website of pkupiano, allowing members upload their own recordings

SoundLib: A Music Recording Library SoundLib (abbreviation of sound library), provides a site for users to upload their own music recordings. Todo Lis

null 2 Jun 16, 2022
Chrome extension to generate tests for solidjs.

Solid Test Recorder Automated Chrome extension to generate unit/integration tests for solidjs Features Generates UI tests which relay on vitest and ms

Chris Czopp 14 Dec 16, 2022
Boilerplate project to run MOBILE Test Automation with WebdriverIO v7, Mocha, Appium, Allure reporting and Momentum Suite cloud device farm support

WebdriverIO Mocha Appium Momentumsuite WebdriverIO Integration with local or Momentum Suite real mobile farm devices Supports Native or Hybrid Android

Momentum Suite 21 Dec 5, 2022
Repo with a project structure using TS + Appium + WebdriverIO

Structure for mobile ui tests using ts + appium + webdriverio Para acessar a versão em Português do Brasil, basta clicar aqui! ???? This structure is

Maximiliano Alves 14 Sep 13, 2022
SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

SAP Samples 8 Oct 24, 2022
⏱ A Google Chrome extension for keeping track of who is talking during Google Meets

Am I Talking A Lot? ⏱ A Google Chrome extension for keeping track of who is talking during Google Meets Features Tracks talking time for each particip

Sean McPherson 8 Oct 5, 2022
Google-Drive-Directory-Index | Combining the power of Cloudflare Workers and Google Drive API will allow you to index your Google Drive files on the browser.

?? Google-Drive-Directory-Index Combining the power of Cloudflare Workers and Google Drive will allow you to index your Google Drive files on the brow

Aicirou 127 Jan 2, 2023