How to Test The Website Using Cypress

nisha balqis
Nov 6 · 3 min read

Warmest regards to the QA Engineers, on this occasion I will discuss about end to end testing using one of the testing software namely Cypress. Cypress is one of the free testing tools that can facilitate us in managing tests, writing tests and running tests to be reliable. Actually not only end to end test, Cypress can also do integration test and unit test.

To shorten the time we just discuss setting up the project that we will test using Cypress.

Project Settings

Before we start the testing step, first to install the Cypress, we need to creare the folder and cd to the folder that we create. To install Cypress input the command “ npm install cypress “ into the commad prompt then it will be like this :

Then you need to download and install the software below if you already had then proceed with next step :

i) Git GUI

ii) Sublime Text

Begin the testing

Step how to test the website:-

  1. Open folder that you have install the cypress and put those coding of website that you wanted to test.

2. Open the Git CMD and to open the Cypress, need to type and input the command “ node_modules/.bin/cypress open

3. Next is the appearance of Cypress that has been opened after the command been input.

4. First I create new folder and then in this test I will use the test case login and register by creating a new file named login.spec.js and register.spec.js in the cypress / integration / folder

5. Then when we opened the Cypress it will appearances like the pictures below and to start test the pages, can click either one that you want.

6. I choose to test the registration page first. If the test is successful its will automatically fill the blank and will appearances like picture below also will go straight to the login page.

7. For the login page it will appearance like the picture below and will go straight to home page of the website.

That all the steps of the automatic testing on the website.

Closing

From the tests that have been done, it can be concluded that one of the advantages of end to end tests using Cypress is that we can see the log record of the test command at every step, both successful and failed commands. Besides Cypress testing tools are also considered lightweight and easy setup.

That’s all the explanation about end to end test using Cypress. See you in the next article.

DOT Intern

Artikel dari para peserta DOT Internship

nisha balqis

Written by

DOT Intern

Artikel dari para peserta DOT Internship

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade