You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ └── support/ # Support files and custom commands
21
+
├── .gitignore # Git ignore file
22
+
├── cypress.config.ts # Cypress configuration
23
+
├── cypress.env.json # Environment variables (not committed to Git)
24
+
├── package.json # Project dependencies and scripts
25
+
└── tsconfig.json# TypeScript configuration
24
26
```
25
27
28
+
## Page Object Model
29
+
30
+
The tests use the Page Object Model pattern to create a layer of abstraction between the test code and the UI. Page objects are in the `cypress/pages` directory.
31
+
26
32
## Installation
27
33
28
34
1. Clone the repository
@@ -32,28 +38,41 @@ This project contains automated tests for the SauceDemo website using Cypress wi
32
38
npm install
33
39
```
34
40
35
-
## Running Tests
41
+
3. Create a `cypress.env.json` file with the following content:
42
+
43
+
```json
44
+
{
45
+
"users": {
46
+
"standard": {
47
+
"username": "standard_user",
48
+
"password": "secret_sauce"
49
+
},
50
+
"locked": {
51
+
"username": "locked_out_user",
52
+
"password": "secret_sauce"
53
+
}
54
+
}
55
+
}
56
+
```
57
+
58
+
## Running the Tests
59
+
60
+
### Headless Mode
36
61
37
62
To run tests in headless mode:
38
63
39
64
```bash
40
65
npm run cy:run
41
66
```
42
67
43
-
To open Cypress GUI:
68
+
### Interactive Mode
69
+
70
+
To open Cypress in interactive mode:
44
71
45
72
```bash
46
73
npm run cy:open
47
74
```
48
75
49
-
## Reports
50
-
51
-
Test reports are generated in the `cypress/reports/html` directory after running tests in headless mode.
52
-
53
-
## GitHub Actions
54
-
55
-
This project uses GitHub Actions for continuous integration. The workflow installs dependencies and runs the Cypress tests automatically on push or pull request to the master branch.
56
-
57
-
## Page Object Model
76
+
## CI/CD
58
77
59
-
The tests use the Page Object Model pattern to separate test logic from page-specific selectors and actions, making the tests more maintainable and readable.
78
+
This project includes GitHub Actions workflows for continuous integration. Tests are automatically run on push to the master branch and on pull requests to the master branch.
0 commit comments