Cypress Folder Structure Explained

Cypress Folder Structure Explained

This article will help you knowing about the folder structure that comes with cypress e2e installation and setup. We will talk about each in brief.

Here’s the main project folder containing 2 folders and 3 files.

Inside Main project folder:

1. Package.json file: this folder contains the project related information which you setup at the time of installation.

i. Name, version, description,

ii. Git repository information

iii. Scripts commands

iv. License

v. Dev Dependencies: this will hold the modules & its versions installed and saved. Such as cypress, and other plugins

2. Package-lock.json file: This will lock the exact versions of dependencies mentioned in package.json. This file will automatically update on npm install/update any package.

3. Cypress.config.js file:?Used for intelligent code completion. This will hold cypress specific configuration required for running and executing test scripts. Some plugins also require the configurations to be set here. We can add/update the information within this such as env, timeouts, reporter information, folder configurations etc. ?

4. Node_modules folder:?This folder contains all the installed packages using npm install

5. Cypress folder:?Cypress folder is the main folder which further has 4 folders inside created by default by cypress.


Inside Cypress folder:

6. Downloads folder:?This folder is used to store temporary files which got downloaded from web during test script execution

7. E2e folder:?This is the main folder where test files has to be stored. You can create sub-folders as well. Extension of the test files would be *.cy.js (cy.ts for typescript). other types of test file extensions can be set in cypress configuration file.

8. Fixture folder: This folder has json files to save test data. You can create multiple files/fodler inside this.

9. Support folder: Support folder further contains 2 files. Those are commands.js and e2e.js.


Inside Support folder:

10. Commands.js file:?This file is used to create custom commands. Any script which we can frequently use for our tests execution by directly calling using

cy.<custom-command-name>.

11. E2e file:?This file is used for keeping the script which we want to be processed before each test file runs. Global configurations.


要查看或添加评论,请登录

Amit K Verma的更多文章

  • Cypress Runner with Failed Test Case Part - 2

    Cypress Runner with Failed Test Case Part - 2

    How to identify css locator using cypress runner: 1. In cypress runner app, click on this bullseye circled icon inside…

  • Understanding Cypress app runner

    Understanding Cypress app runner

    Pic - 1 Pic - 2 This chrome/browser window will be labeled to show you that the window/tab is being controlled by…

  • Cypress First Test Case

    Cypress First Test Case

    Writing first test case is always exciting and interesting to start with. Let’s write a hello world test case using…

  • Cypress Installation

    Cypress Installation

    Cypress comes as a node package. To install cypress we need node on the system.

  • Cypress vs Selenium - a comparison

    Cypress vs Selenium - a comparison

    This is the most common comparison selenium guys look for before they switch to cypress to know how cypress can ease…

  • Cypress Architecture

    Cypress Architecture

    Cypress architecture makes it so reliable, robust and fast than other tools in the market. To make this happen, cypress…

  • Cypress Disadvantages

    Cypress Disadvantages

    Nothing comes with benefits only, so does cypress. Cypress do have a few limitations to consider before you actually…

  • Cypress Advantages Part-2

    Cypress Advantages Part-2

    Here's the next 10 advantages of cypress for Web automation and API testing. Flake Resistance / Retries: Cypress is…

  • Cypress Advantages Part-1

    Cypress Advantages Part-1

    Lets first dive into the advantages of Cypress automation tool, which is being loved by the developers and automation…

  • Cypress Overview

    Cypress Overview

    Testing is a game of finding what others could not see or detect. This is an exciting game till you start feeling…

社区洞察

其他会员也浏览了