npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

selenium-side-converter

v1.3.1

Published

Command line tool for converting template in selenium .side file.

Downloads

14

Readme

Selenium SIDE Converter

Installation

yarn global add selenium-side-converter

or

npm install -g selenium-side-converter

Usage

Create Project

selenium-side-converter create ./selenium-project

The following directory will be created.

selenium-project
├── files
├── inputs
├── outputs
├── settings
│   ├── file.json
│   ├── text.json
│   └── xpath.json
└── ssconfig.json

Converting template in side file

selenium-side-converter convert -i target.side -o output.side

If your side file has command like below, Replace template in setting files.

Converting require setting files. There are file.json, xpath.json, text.json in ./settings by default loaded.

inputs/target.side

{
    "id": "e506b2b3-6901-4cfa-a3bb-301352e1e6f0",
    "comment": "",
    "command": "assertText",
    "target": "{xpath:MESSAGE_XPATH}",
    "targets": [],
    "value": "{text:MESSAGE_TEXT}"
}

settings/xpath.json

{
    "target": {
        "MESSAGE_XPATH": "//p[@id='message-xpath']"
    }
}

settings/text.json

{
    "target": {
        "MESSAGE_TEXT": "message text"
    }
}

Converting side files

selenium-side-converter convert --all

Convert all files under the inputs directory. The converted file is placed under outputs in the same directory structure. It also corresponds to the json structure. For example. like below. And outputs, inputs directory etc. can be changed in the ssconfig.json.

selenium-project
├── files
│   └── example-input-picture.jpg
├── inputs
│   └── test_page
│       └── target.side
├── outputs
│   └── test_page
│       └── target.side

settings/file.json

{
    "test-page": {
        "target": {
            "test_picture": "example-input-picture.jpg"
        }
    }
}

outputs/test_page/target.side

{
    "id": "e506b2b3-6901-4cfa-a3bb-301352e1e6f0",
    "comment": "",
    "command": "type",
    "target": "//input[@id='upload-form']",
    "targets": [],
    "value": "/your_pc_absolute_path/files/example-input-picture.jpg"
}

Merging side files

selenium-side-converter merge -o merged.side file1.side file2.side file3.side

It recursively merges Source file of file2.side, file2.side into the destination file file1.side and so generated merged.side. It is tests in side file that are merged.

selenium-side-converter merge --before-each e506b2b3-6901-4cfa-a3bb-301352e1e6f0 file1.side file2.side file3.side

If you have some test you need to do repeatedly for many tests, you can use --before-each and --after-each. It merge the test of the specified ID at the each tests.

For example, --before-each <id> When id is the test contained in file1.side, It is merged to head that each test in file2, file3.