# initiate-test

> create framework structure directories and files of automation test project of robot-framework

Latest version **1.4.0** (published 2023-12-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install initiate-test
pnpm add initiate-test
yarn add initiate-test
bun add initiate-test
```

Provides the command `initiate-test`.

## 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.4.0 |
| Published | 2023-12-14 |
| First published | 2023-11-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 841.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Bashar Methaq |
| Maintainers | beesh |
| Keywords | cli, automation-test, robot-framework, automation, initiate-automation-test-project, regression-testing, test-project-structure, initiate-test |

## Links

- npm: https://www.npmjs.com/package/initiate-test
- Repository: https://github.com/bjh2017/initiate-automation-test-project
- Homepage: https://github.com/bjh2017/initiate-automation-test-project#readme
- Issues: https://github.com/bjh2017/initiate-automation-test-project/issues
- npm.io page: https://npm.io/package/initiate-test

## Dependencies (6)

- [xlsx](https://npm.io/package/xlsx.md) ^0.18.5
- [boxen](https://npm.io/package/boxen.md) ^5.1.2
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [enquirer](https://npm.io/package/enquirer.md) ^2.4.1
- [csv-parser](https://npm.io/package/csv-parser.md) ^3.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.4.0 (latest) — 2023-12-14
- 1.3.0 — 2023-12-12
- 1.2.4 — 2023-12-06
- 1.2.3 — 2023-12-06
- 1.2.2 — 2023-12-06
- 1.2.1 — 2023-12-05
- 1.2.0 — 2023-12-05
- 1.1.0 — 2023-11-30
- 1.0.12 — 2023-11-27
- 1.0.11 — 2023-11-23
- 1.0.10 — 2023-11-22
- 1.0.9 — 2023-11-16
- 1.0.8 — 2023-11-13
- 1.0.7 — 2023-11-13
- 1.0.6 — 2023-11-12

## README

# Robot Project Initiator

An npm CLI tool for initializing RobotFramework-based automation test projects swiftly and efficiently.

## Installation

```bash
npm i -g initiate-test
```

---

## Quick Start

```bash
initiate-test <project-name> <project-type>
```

- Replace <project-name> with your preferred name.
- Replace <project-type> with one of the following choices: [app, web, api]

---

## Advanced Setup

```bash
initiate-test
```

Answer a few questions:

- Project name
- Project type (app, web, or api)
- Author name
- Environments (e.g., env1 env2, env3, separated by spaces)
- Credentials needed? (yes/no)

---

## Creating Test Suites

Post-initiation, generate multiple suite files within the tests directory effortlessly. Execute one of these commands:

```bash
initiate-test --suite 01_users_test --suite 02_productions_test --suite 03_collections_test
```

or

```bash
initiate-test --suite "01_users_test 02_productions_test 03_collections_test"
```

- `-s` serves as a shorthand for `--suite`.

The command generates suite files in the tests directory, each initialized with template content. README.md is updated to include these suites and their respective tags.

---

## Automated Testing Plan Importer

Seamlessly import a testing plan, converting it into suites and test cases within each suite:

```bash
initiate-test --plan path/of/plan/file.xlsx
```

- `-p` is a shorthand for `--plan`.
- Supported file formats: xlsx, csv, tsv.

### Plan Structure Example

| ID    | TEST CASE                                  | SUITE          |
| ----- | ------------------------------------------ | -------------- |
| TC-01 | Login With Invalid Username Should Fail    | Invalid Login  |
| TC-02 | Signup Without Username Should Fail        | Invalid Signup |
| TC-03 | Login With Valid Credintial Should Success | Valid Login    |

- **Notice that header of table should be UPPERCASE.**
- **Suite values could be path like "./tests/login/invalid login". The path and file will be created togather.**

---

## Updating the README File

To incorporate new suites, tags, and additional elements manually, utilize the command `initiate-test -u` or `initiate-test --update`. This command efficiently updates the README, seamlessly adding all recently included directories, suites, and tags. It also integrates essential information such as author details, email, repository, and project name, ensuring a comprehensive update to the documentation.

---

## Built Common Keywords

This section includes various keyword sets categorized by project type: API, App, and Web. Each set contains keywords performing specific actions or validations tailored for respective project types.

### API Project Keywords

The API project keywords cover a range of functionalities from making HTTP requests with various configurations to validating responses and text patterns.

| Keyword Name                           | Description                                                    |
| -------------------------------------- | -------------------------------------------------------------- |
| Create Headers                         | Creates headers for requests                                   |
| Delete With Body                       | Performs a DELETE request with a body                          |
| Delete With Body And Invalid Token     | Performs a DELETE request with a body and an invalid token     |
| Delete With Body And No Headers        | Performs a DELETE request with a body and no headers           |
| Delete With Params                     | Performs a DELETE request with parameters                      |
| Delete With Params And Invalid Token   | Performs a DELETE request with parameters and an invalid token |
| Delete With Params And No Headers      | Performs a DELETE request with parameters and no headers       |
| Delete Without Params                  | Performs a DELETE request without parameters                   |
| Expect 500 Exception Response          | Validates a 500 status code exception response                 |
| Get Variable Type                      | Retrieves the type of a variable                               |
| Post Request With Invalid Token        | Validates a POST request with an invalid token                 |
| Post Request Without Body              | Validates a POST request without a body                        |
| Post Request Without Token             | Validates a POST request without a token                       |
| Post With Body                         | Performs a POST request with a body                            |
| Post With Body And Invalid Token       | Performs a POST request with a body and an invalid token       |
| Post With Body And No Headers          | Performs a POST request with a body and no headers             |
| Post With Body Then Validate           | Validates a POST request with a body                           |
| Post With Params                       | Performs a POST request with parameters                        |
| Post With Params Then Validate         | Validates a POST request with parameters                       |
| Post Without Body                      | Performs a POST request without a body                         |
| Post Without Body And Invalid Token    | Performs a POST request without a body and an invalid token    |
| Post Without Body And No Headers       | Performs a POST request without a body and no headers          |
| Post Without Body Then Validate        | Validates a POST request without a body                        |
| Put With Body                          | Performs a PUT request with a body                             |
| Put With Body And Invalid Token        | Performs a PUT request with a body and an invalid token        |
| Put With Body And No Headers           | Performs a PUT request with a body and no headers              |
| Query Data And Validate                | Validates queried data                                         |
| Query With Body                        | Performs a query with a body                                   |
| Query With Body And Invalid Token      | Performs a query with a body and an invalid token              |
| Query With Body And No Headers         | Performs a query with a body and no headers                    |
| Query With Body Then Validate          | Validates a query with a body                                  |
| Query With Params                      | Performs a query with parameters                               |
| Query With Params And Invalid Token    | Performs a query with parameters and an invalid token          |
| Query With Params And No Headers       | Performs a query with parameters and no headers                |
| Query With Params Then Validate        | Validates a query with parameters                              |
| Query Without Params                   | Performs a query without parameters                            |
| Query Without Params And Invalid Token | Query without parameters with an invalid token                 |
| Query Without Params And No Headers    | Query without parameters and no headers                        |
| Response Should Be 400                 | Validates a response with a status code 400                    |
| Response Should Be Success             | Validates a successful response                                |
| Response Should Be Unauthorized 401    | Validates a response with a status code 401                    |
| Startup The Automation Test            | Initializes test automation                                    |
| Text Should Be Arabic                  | Validates text to be in Arabic characters                      |
| Text Should Be English                 | Validates text to be in English characters                     |

### App Project Keywords

Keywords in the App project encompass interactions with mobile applications, such as swiping gestures, element verification, waiting for progress bars, and text validation.

| Keyword Name                        | Description                                           |
| ----------------------------------- | ----------------------------------------------------- |
| Click Coordinates                   | Clicks on the specified coordinates within an element |
| Get Variable Type                   | Retrieves the type of a variable                      |
| Open The App                        | Opens the application with specified parameters       |
| Pick Random Element                 | Selects a random element from a set of elements       |
| Scroll Down Until Get Element       | Scrolls down until a specified element is found       |
| Scroll Up Until Get Element         | Scrolls up until a specified element is found         |
| Swipe Down                          | Performs a swipe gesture downwards                    |
| Swipe Left To Right                 | Performs a swipe gesture from left to right           |
| Swipe Right To Left                 | Performs a swipe gesture from right to left           |
| Swipe Up                            | Performs a swipe gesture upwards                      |
| Text Should Be Arabic               | Validates text to be in Arabic characters             |
| Text Should Be English              | Validates text to be in English characters            |
| Verify ${page_title} Page Is Loaded | Verifies if a specified page is loaded                |
| Waiting For Progress Bar            | Waits until the progress bar element is visible       |
| Waiting For Progress Bar Disappear  | Waits until the progress bar element disappears       |

### Web Project Keywords

Keywords for web projects facilitate actions like navigating to web pages, handling sessions, scrolling until specific elements become visible or invisible, verifying elements' classes, and more.

| Keyword Name                                | Description                                                        |
| ------------------------------------------- | ------------------------------------------------------------------ |
| Click Coordinates                           | Clicks on specific coordinates within an element                   |
| Convert Time to Seconds                     | Converts time format (HH:MM:SS) to total seconds                   |
| Create List of Text from Elements           | Gathers text from elements and creates a list                      |
| Create Screenshots Directory                | Creates a directory for storing screenshots                        |
| Element Should Be Invisible In The Viewport | Checks if an element is not visible in the viewport                |
| Element Should Be Visible In The Viewport   | Checks if an element is visible in the viewport                    |
| Ensure Element Does Not Have Class          | Ensures that an element does not have a specified class            |
| Ensure Element Has Class                    | Ensures that an element has a specified class                      |
| Get Child Webelements                       | Retrieves child elements of a specified element                    |
| Get Parent Webelement                       | Retrieves the parent element of a specified element                |
| Get Variable Type                           | Retrieves the type of a variable                                   |
| Go To Website URL                           | Navigates to a specified website URL                               |
| Log Warning If Test Failed                  | Logs a warning message if a test fails                             |
| Open a New Session Unless Found One         | Opens a new session or proceeds if a session already exists        |
| Open Browser To Login Page                  | Opens the browser and navigates to the login page                  |
| Pick Random Element                         | Selects a random element                                           |
| Run Login Process                           | Executes the login process                                         |
| Scroll Until Element Invisible              | Scrolls until a specified element becomes invisible on the screen  |
| Scroll Until Element Visible                | Scrolls until a specified element becomes visible on the screen    |
| Start Test Up                               | Initiates the test process, including login and verification steps |
| Start again from beginning                  | Restarts the process based on specific conditions                  |
| Text Should Be Arabic                       | Validates text to be in Arabic characters                          |
| Text Should Be English                      | Validates text to be in English characters                         |
| Wait Until Element Not Found on Screen      | Waits until a specified element is not found on the screen         |

---

These keywords are designed to streamline automation efforts across different project types and can be updated or enhanced to accommodate specific project requirements.

---

## Future Release

Expect a feature to generate test cases, eliminating the need for manual creation. Stay tuned for updates and enhancements.

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