# selenium-side-converter

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

Latest version **1.3.1** (published 2020-12-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install selenium-side-converter
pnpm add selenium-side-converter
yarn add selenium-side-converter
bun add selenium-side-converter
```

Provides the command `selenium-side-converter`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2020-12-05 |
| First published | 2019-11-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 217.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | syarig |
| Maintainers | syarig |
| Keywords | CLI, selenium |

## Links

- npm: https://www.npmjs.com/package/selenium-side-converter
- Repository: https://github.com/syarig/selenium-side-converter
- Issues: https://github.com/syarig/selenium-side-converter/issues
- npm.io page: https://npm.io/package/selenium-side-converter

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [log4js](https://npm.io/package/log4js.md) ^6.1.0
- [commander](https://npm.io/package/commander.md) ^6.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2020-12-05
- 1.3.0 — 2020-10-23
- 1.2.1 — 2020-10-23
- 1.2.0 — 2020-10-23
- 1.1.4 — 2020-10-21
- 1.1.3 — 2020-10-18
- 1.1.2 — 2019-12-11
- 1.1.1 — 2019-12-09
- 1.1.0 — 2019-12-01
- 1.0.5 — 2019-11-29
- 1.0.4 — 2019-11-27
- 1.0.3 — 2019-11-25
- 1.0.2 — 2019-11-24
- 1.0.0 — 2019-11-24

## 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*
```json
{
    "id": "e506b2b3-6901-4cfa-a3bb-301352e1e6f0",
    "comment": "",
    "command": "assertText",
    "target": "{xpath:MESSAGE_XPATH}",
    "targets": [],
    "value": "{text:MESSAGE_TEXT}"
}
```
  
*settings/xpath.json*
```json
{
    "target": {
        "MESSAGE_XPATH": "//p[@id='message-xpath']"
    }
}
```
  
*settings/text.json*
```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*
```json
{
    "test-page": {
        "target": {
            "test_picture": "example-input-picture.jpg"
        }
    }
}
```
  
*outputs/test_page/target.side*
```json
{
    "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.

---
_Source: https://npm.io/package/selenium-side-converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
