1.4.0 • Published 5 months ago

initiate-test v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Robot Project Initiator

An npm CLI tool for initializing RobotFramework-based automation test projects swiftly and efficiently.

Installation

npm i -g initiate-test

Quick Start

initiate-test <project-name> <project-type>
  • Replace with your preferred name.
  • Replace with one of the following choices: app, web, api

Advanced Setup

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:

initiate-test --suite 01_users_test --suite 02_productions_test --suite 03_collections_test

or

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:

initiate-test --plan path/of/plan/file.xlsx
  • -p is a shorthand for --plan.
  • Supported file formats: xlsx, csv, tsv.

Plan Structure Example

IDTEST CASESUITE
TC-01Login With Invalid Username Should FailInvalid Login
TC-02Signup Without Username Should FailInvalid Signup
TC-03Login With Valid Credintial Should SuccessValid 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 NameDescription
Create HeadersCreates headers for requests
Delete With BodyPerforms a DELETE request with a body
Delete With Body And Invalid TokenPerforms a DELETE request with a body and an invalid token
Delete With Body And No HeadersPerforms a DELETE request with a body and no headers
Delete With ParamsPerforms a DELETE request with parameters
Delete With Params And Invalid TokenPerforms a DELETE request with parameters and an invalid token
Delete With Params And No HeadersPerforms a DELETE request with parameters and no headers
Delete Without ParamsPerforms a DELETE request without parameters
Expect 500 Exception ResponseValidates a 500 status code exception response
Get Variable TypeRetrieves the type of a variable
Post Request With Invalid TokenValidates a POST request with an invalid token
Post Request Without BodyValidates a POST request without a body
Post Request Without TokenValidates a POST request without a token
Post With BodyPerforms a POST request with a body
Post With Body And Invalid TokenPerforms a POST request with a body and an invalid token
Post With Body And No HeadersPerforms a POST request with a body and no headers
Post With Body Then ValidateValidates a POST request with a body
Post With ParamsPerforms a POST request with parameters
Post With Params Then ValidateValidates a POST request with parameters
Post Without BodyPerforms a POST request without a body
Post Without Body And Invalid TokenPerforms a POST request without a body and an invalid token
Post Without Body And No HeadersPerforms a POST request without a body and no headers
Post Without Body Then ValidateValidates a POST request without a body
Put With BodyPerforms a PUT request with a body
Put With Body And Invalid TokenPerforms a PUT request with a body and an invalid token
Put With Body And No HeadersPerforms a PUT request with a body and no headers
Query Data And ValidateValidates queried data
Query With BodyPerforms a query with a body
Query With Body And Invalid TokenPerforms a query with a body and an invalid token
Query With Body And No HeadersPerforms a query with a body and no headers
Query With Body Then ValidateValidates a query with a body
Query With ParamsPerforms a query with parameters
Query With Params And Invalid TokenPerforms a query with parameters and an invalid token
Query With Params And No HeadersPerforms a query with parameters and no headers
Query With Params Then ValidateValidates a query with parameters
Query Without ParamsPerforms a query without parameters
Query Without Params And Invalid TokenQuery without parameters with an invalid token
Query Without Params And No HeadersQuery without parameters and no headers
Response Should Be 400Validates a response with a status code 400
Response Should Be SuccessValidates a successful response
Response Should Be Unauthorized 401Validates a response with a status code 401
Startup The Automation TestInitializes test automation
Text Should Be ArabicValidates text to be in Arabic characters
Text Should Be EnglishValidates 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 NameDescription
Click CoordinatesClicks on the specified coordinates within an element
Get Variable TypeRetrieves the type of a variable
Open The AppOpens the application with specified parameters
Pick Random ElementSelects a random element from a set of elements
Scroll Down Until Get ElementScrolls down until a specified element is found
Scroll Up Until Get ElementScrolls up until a specified element is found
Swipe DownPerforms a swipe gesture downwards
Swipe Left To RightPerforms a swipe gesture from left to right
Swipe Right To LeftPerforms a swipe gesture from right to left
Swipe UpPerforms a swipe gesture upwards
Text Should Be ArabicValidates text to be in Arabic characters
Text Should Be EnglishValidates text to be in English characters
Verify ${page_title} Page Is LoadedVerifies if a specified page is loaded
Waiting For Progress BarWaits until the progress bar element is visible
Waiting For Progress Bar DisappearWaits 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 NameDescription
Click CoordinatesClicks on specific coordinates within an element
Convert Time to SecondsConverts time format (HH:MM:SS) to total seconds
Create List of Text from ElementsGathers text from elements and creates a list
Create Screenshots DirectoryCreates a directory for storing screenshots
Element Should Be Invisible In The ViewportChecks if an element is not visible in the viewport
Element Should Be Visible In The ViewportChecks if an element is visible in the viewport
Ensure Element Does Not Have ClassEnsures that an element does not have a specified class
Ensure Element Has ClassEnsures that an element has a specified class
Get Child WebelementsRetrieves child elements of a specified element
Get Parent WebelementRetrieves the parent element of a specified element
Get Variable TypeRetrieves the type of a variable
Go To Website URLNavigates to a specified website URL
Log Warning If Test FailedLogs a warning message if a test fails
Open a New Session Unless Found OneOpens a new session or proceeds if a session already exists
Open Browser To Login PageOpens the browser and navigates to the login page
Pick Random ElementSelects a random element
Run Login ProcessExecutes the login process
Scroll Until Element InvisibleScrolls until a specified element becomes invisible on the screen
Scroll Until Element VisibleScrolls until a specified element becomes visible on the screen
Start Test UpInitiates the test process, including login and verification steps
Start again from beginningRestarts the process based on specific conditions
Text Should Be ArabicValidates text to be in Arabic characters
Text Should Be EnglishValidates text to be in English characters
Wait Until Element Not Found on ScreenWaits 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.

1.4.0

5 months ago

1.3.0

5 months ago

1.2.4

5 months ago

1.2.3

5 months ago

1.2.2

5 months ago

1.2.1

5 months ago

1.2.0

5 months ago

1.1.0

5 months ago

1.0.12

5 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago