Documentation
Cypress Tailored Commands
Thank you for using this Cypress library. I hope you find it useful
- Version: 1.0.3
- Author: @davzap1702
- Created: 23 November, 2023
- Update: N/A
Installation
Follow the steps below to install and setup the repo on your local machine:
-
Make sure you have NodeJS installed. Use
node --version
. Node v14 and above are preferred. -
If you have not yet installed Cypress use the following command
npm i -D cypress
. -
Install the package by running the following command:
npm install cypress-tailored-commands
-
Locate the commands.js file and import the library using the following import
import 'cypress-tailored-commands'
-
You can enable types by adding this line in your test files
/// <reference types="cypress-tailored-commands"/>
Our Purpose
Our purpose is to introduce a new approach to project automation for the community, leveraging the power of Cypress.io. Our purpose is to ease the process of automation, ensuring that it becomes an accessible and engaging task for all team members. By adhering to best practices, we aim to not only facilitate workflows but also elevate the overall quality of our projects automation.
Who is this for?
This project is dedicated to every QA and developer that is interested in implementing automation with cypress within their projects. This framework seeks to facilitate the tests creation by providing pre developed commands that adjust to all components, making the test coding a seamless process to everyone
Custom Methods
Each method has been carefully crafted to provide the best experience when automating test cases or components. This will be very helpful to acheive complete automation even if you don't have experience.
cy.form()
This method was developed to simplify form automation. With the help of a specific configuration, entering text into a form field, selecting an option from a dropdown, or clicking on a checkbox can be done seamlessly. For a better understanding, please refer to the options provided below.
Supported Inputs:
Input | Description | Code Example |
---|---|---|
text |
Use this for text , password ,
and email inputs. Each input configuration
must have the following params:
|
|
radio |
Use this for radio and
checkbox . Each input configuration must
have the following params:
|
|
select |
Use this to choose an option from a list or a dropdown
menu. This only supports <select> tags. If the
menu has the <input> tag, check the
dropdown option instead. Each input
configuration must have the following params:
|
|
dropdown |
Use this to choose an option from a list or a dropdown
menu. This only supports <input> tags. If the menu
has the <select> tag, check the
select option instead. Each input
configuration must have the following params:
|
|
alert |
Use this to check if an alert message is visible and
compare its text content with your own source. Each
input configuration must have the following params:
|
|
submit |
Use this to submit a form. Each input configuration must
have the following params:
onSumbit is a callback
that receives a parameter containing the information of
the request. By invoking this callback, you can access
all the data retreived with the request.
|
|
Changelog
See what's new added, changed, fixed, improved or updated in the latest versions.
Version 1.0.3 (27 Nov, 2023)
-
Added
The new
form
method.