This automation project utilized the page object model. Here, I have Separated tests based on pages. Also, separated page objects based on pages in order to abstract the interactions with the UI elements away from the test cases.
cypress/
├── fixtures/
│ └── data.json
├── support/
│ ├── commands/
│ │ └── customCommands.js
│ ├── pageObjects/
│ │ ├── Page1/
│ │ │ └── Page1Objects.js
│ │ ├── Page2/
│ │ │ └── Page2Objects.js
│ ├── wiring/
│ │ ├── Reusables/
│ │ │ └── Reusable.js
│ │ ├── Page1/
│ │ │ └── Page1Functions.js
│ │ ├── Page2/
│ │ │ └── Page2Functions.js
├── tests/
│ ├── verifyWorkflow.js
└── screenshots/
└── videos/
Here, I encapsulated complex interactions and verifications within the page objects. this ensures code reusability and maintains a clear separation of concerns.
To install the dependencies on your pc:
npm i
To run the project:
npm test
- cypress,
- cypress-mochawesome-reporter
Please visit POM2.0.0 branch for a different approach