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

healenium

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

healenium

A WebdriverIO plugin for integrating Healenium's self-healing capabilities to improve test automation stability.

  • 1.0.1
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
0
Weekly downloads
 
Created
Source

Healenium WDIO Plugin

healenium is a WebdriverIO plugin that integrates Healenium's self-healing capabilities into your automated tests. It ensures your tests remain robust even when locators change due to UI updates, by automatically healing broken selectors during runtime.

Features

  • Seamlessly integrates Healenium with WebdriverIO.
  • Automatically heals broken selectors.
  • Supports $ and $$ syntax used in WDIO7+.
  • Configurable retries and logging for healing operations.

Installation

Install the plugin via npm:

npm install healenium

Getting Started

Step 1: Configure Healenium Proxy

  1. Clone the Healenium repository and set up the Docker containers.

  2. Start the Healenium proxy server:

    docker-compose up
    

    By default, the proxy server will be available at http://localhost:8080.

Step 2: Update wdio.conf.js

Integrate the plugin into your WebdriverIO configuration:

const healeniumPlugin = require('healenium-wdio-plugin');

exports.config = {
    runner: 'local',
    hostname: 'localhost', // Healenium Proxy
    port: 8080,            // Default Healenium port
    path: '/wd/hub',
    specs: ['./test/specs/**/*.js'],
    framework: 'mocha',

    onPrepare: function (config, capabilities) {
        healeniumPlugin(global.browser, {
            hostname: 'localhost', // Proxy hostname
            port: 8080,            // Proxy port
            debug: true,           // Enable debug logs
            maxRetries: 3          // Maximum healing retries
        });
    },
};

Step 3: Write Tests

You can write your tests as usual using the $ and $$ selectors in WebdriverIO. No changes to your test code are needed.

Example test:

describe('Healenium Integration Test', () => {
    it('should heal and locate elements', async () => {
        const element = await browser.$('.non-existing-selector'); // This selector will fail initially
        await element.click(); // Healenium will attempt to heal and locate the element
    });
});

Step 4: Run Tests

Run your tests as usual using WebdriverIO:

npx wdio wdio.conf.js

Configuration Options

You can configure the plugin by passing an options object in onPrepare:

OptionTypeDefaultDescription
hostnamestringlocalhostThe hostname of the Healenium proxy.
portnumber8080The port of the Healenium proxy.
debugbooleanfalseEnable debug logs to troubleshoot issues.
maxRetriesnumber3Maximum number of retries for healing operations.

How It Works

  1. Intercepting Locators: The plugin intercepts WebdriverIO's $ and $$ methods.
  2. Healing Mechanism: When a locator fails, it communicates with the Healenium proxy server to fetch a healed locator.
  3. Retry Logic: If a healed locator is available, the plugin retries the selection process.

Troubleshooting

Common Issues

  1. Connection Errors

    • Ensure the Healenium proxy server is running and accessible at the specified hostname and port.
    • Verify your WebdriverIO configuration matches the Healenium setup.
  2. Element Not Found

    • Ensure the initial locators have been stored in the Healenium database by running the tests at least once without failures.

Contributing

We welcome contributions! Please fork the repository, create a new branch, and submit a pull request with your improvements. Feel free to raise issues or feature requests.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

FAQs

Package last updated on 27 Nov 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