|
| 1 | +# Cypress Framework |
| 2 | + |
| 3 | +This repository contains a Cypress framework setup for automated testing. The framework is structured as follows: |
| 4 | + |
| 5 | +## Project Folder Structure |
| 6 | + |
| 7 | +Project Folder<br> |
| 8 | +├── node_modules <br> |
| 9 | +└── cypress<br> |
| 10 | + ├── appConfig<br> |
| 11 | + ├── downloads<br> |
| 12 | + ├── e2e<br> |
| 13 | + ├── fixtures<br> |
| 14 | + ├── reports<br> |
| 15 | + ├── screenshot<br> |
| 16 | + ├── support<br> |
| 17 | + ├── video<br> |
| 18 | + |
| 19 | +├─ cypress.config.ts<br> |
| 20 | +│ .eslintrc.json<br> |
| 21 | +│ readme.md<br> |
| 22 | +│ .gitignore<br> |
| 23 | +│ package-lock.json<br> |
| 24 | +│ package.json<br> |
| 25 | +│ tsconfig.json<br> |
| 26 | +├─ .github<br> |
| 27 | +│ └── workflows<br> |
| 28 | +│ └── main.yml<br> |
| 29 | + |
| 30 | +## Description |
| 31 | + |
| 32 | +- `.gitignore`: Specifies intentionally untracked files to ignore in Git. |
| 33 | +- `package-lock.json` and `package.json`: Node.js package files specifying project dependencies. |
| 34 | +- `cypress.config.ts`: Configuration file for Playwright settings. |
| 35 | +- `tsconfig.json`: TypeScript compiler options file. |
| 36 | + |
| 37 | +### `.GitHub` |
| 38 | + |
| 39 | +- `.GitHub/workflows/main.yml`: GitLub Actions workflow file for continuous integration. |
| 40 | + |
| 41 | +### `node_modules` |
| 42 | + |
| 43 | +- Directory containing Node.js modules installed by npm. |
| 44 | + |
| 45 | +### `Cypress-report` |
| 46 | + |
| 47 | +- Directory for storing Cypress test reports. |
| 48 | + |
| 49 | +### `src` |
| 50 | + |
| 51 | +- Source code directory containing project files. |
| 52 | + |
| 53 | +#### `api` |
| 54 | + |
| 55 | +- Directory for API-related scripts. |
| 56 | + |
| 57 | +#### `config` |
| 58 | + |
| 59 | +- Directory containing environment configuration files and authentication data. |
| 60 | + |
| 61 | +#### `fixtures` |
| 62 | + |
| 63 | +- Directory for test fixtures, such as reusable functions for mock. |
| 64 | + |
| 65 | +### `test-results` |
| 66 | + |
| 67 | +- Directory for storing test execution results, including screenshots, trace files, and videos. |
| 68 | + |
| 69 | +## Usage |
| 70 | + |
| 71 | +Make sure that you have `node` and `npm` installed. |
| 72 | + |
| 73 | +Clone the repository and install dependencies using `npm install`. |
| 74 | + |
| 75 | +Create `.env` file under `tests/functional` (it is git-ignored), with contents like this: |
| 76 | + |
| 77 | +``` |
| 78 | +APP_URL=https://api-gw.dev.platform.linuxfoundation.org/ |
| 79 | +AUTH0_TOKEN_API=https://linuxfoundation-dev.auth0.com/oauth/token |
| 80 | +AUTH0_USER_NAME=[your-username] |
| 81 | +AUTH0_PASSWORD=[your-password] |
| 82 | +LFX_API_TOKEN=[token] |
| 83 | +AUTH0_CLIENT_SECRET=[client-secret] |
| 84 | +AUTH0_CLIENT_ID=[client-id] |
| 85 | +CYPRESS_ENV=dev |
| 86 | +``` |
| 87 | + |
| 88 | +You can ask for example `.env` file over slack. |
| 89 | + |
| 90 | +- Run `npx cypress install` |
| 91 | +- Run tests using cmd `npx cypress run`. |
| 92 | +- Run tests using UI `npx cypress open`. Choose **E2E testing**, select **Chrome** browser. |
| 93 | +- View test reports in the `cypress-report` directory. |
| 94 | +- Explore source code files for detailed implementation. |
| 95 | + |
| 96 | +## Contributing |
| 97 | + |
| 98 | +Contributions are welcome! Please follow the established coding style and guidelines. If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. |
| 99 | + |
| 100 | +## License |
| 101 | + |
| 102 | +This project is licensed under the [](LICENSE). |
0 commit comments