{"id":24788035,"url":"https://github.com/markomilenkovic546/cypress-framework-showcase","last_synced_at":"2025-10-16T23:05:52.711Z","repository":{"id":277625815,"uuid":"928320973","full_name":"markomilenkovic546/cypress-framework-showcase","owner":"markomilenkovic546","description":"This repository showcases a Cypress-based test automation framework for API and E2E testing. It follows the Page Object Model (POM), and uses dynamic test data with Faker.js, and custom database reset logic. The framework supports selective test execution via Cypress-Grep, CI/CD integration with GitHub Actions, and multi-environment configurations.","archived":false,"fork":false,"pushed_at":"2025-02-15T01:27:49.000Z","size":8112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T02:23:36.028Z","etag":null,"topics":["cypress","test-automation","typesciprt"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markomilenkovic546.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-06T12:51:27.000Z","updated_at":"2025-02-15T01:27:34.000Z","dependencies_parsed_at":"2025-02-15T02:24:06.948Z","dependency_job_id":"d1f4edb9-883c-4b16-8b7b-9776d0a155f7","html_url":"https://github.com/markomilenkovic546/cypress-framework-showcase","commit_stats":null,"previous_names":["markomilenkovic546/cypress-framework-showcase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markomilenkovic546%2Fcypress-framework-showcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markomilenkovic546%2Fcypress-framework-showcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markomilenkovic546%2Fcypress-framework-showcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markomilenkovic546%2Fcypress-framework-showcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markomilenkovic546","download_url":"https://codeload.github.com/markomilenkovic546/cypress-framework-showcase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245258215,"owners_count":20585977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","test-automation","typesciprt"],"created_at":"2025-01-29T16:14:46.497Z","updated_at":"2025-10-16T23:05:47.662Z","avatar_url":"https://github.com/markomilenkovic546.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cypress Framework Showcase\n\n## Project Overview\n\nThis repository demonstrates a test automation framework design and automation script writing using Cypress for both API and E2E tests. The purpose of the project is to showcase a test automation framework design while utilizing various packages for extended functionality.\n\n## Project Structure\n\nThe project contains the following main components:\n\n- **Client App**: The application to be tested.\n- **Server App**: The backend API for the application.\n- **Cypress Framework**: Contains test automation scripts and the test framework.\n\n### Framework Design\n\nThe framework is designed following the **Page Object Model (POM)**, a design pattern that enhances the maintainability and scalability of test scripts by abstracting the UI elements and actions into separate page objects.\n\n## Key Features\n\n### Test Data Generation\n\n- **Faker.js**: The `DataFactory` class is used to generate dynamic test data, such as user information, etc., ensuring that the tests can run with varied data for each execution.\n\n### Database Reset\n\n- A custom logic for resetting the test database is implemented, ensuring that tests can run on a clean state, which is essential for reliable and repeatable test results.\n\n### API Helper Class\n\n- An `ApiHelper` class is created to handle API requests during the tests, providing an abstraction layer for making API calls in the tests.\n\n### Test Tagging \u0026 Selective Testing\n\n- **Cypress-Grep**: The `cypress-grep` package is integrated for test tagging and selective test execution. This allows you to run a specific subset of tests based on tags or specific names, which is helpful for focused testing.\n\n### Continuous Integration \u0026 Delivery (CI/CD)\n\n- **GitHub Actions**: The project utilizes GitHub Actions for CI/CD. The workflow is configured to run the app locally on the CI/CD server, execute tests over it, and upload test artifacts. \n\n## Test Run Reports 📊\nAfter running the tests, the `cypress-mochawesome-reporter` generates the `reports` folder with detailed HTML reports. These reports provide insights into test results, including passed, failed, and skipped tests, along with detailed logs and screenshots.\n     \n## Multi-Environment Support\n The tests are configured to run on multiple environments by using environment-specific `.env` files (e.g., `.env.staging`) and the corresponding Cypress configuration files (e.g., `staging.config.ts`). This allows the tests to be executed on different environments like QA, staging, etc.\n\n## Running Locally 🖥️\n\nTo run the tests locally, follow these steps:\n```bash\n1. Clone the project locally `git clone \u003crepo url\u003e`\n2. Run `npm install` or `yarn` to install the necessary dependencies.\n3. Set up MongoDB\n    Sign in to MongoDB Atlas and create a new cluster and database.\n    Obtain the connection string for your database.\n4. Add .env.local in the `server` dir with the following vars:\n   MONGO_URI=\"\u003cyour MongoDB connection string\u003e\"\n   JWT_SECRET=\u003cyour secure secret\u003e\n   PORT=3001\n   SEED_API_KEY=\u003cyour seed API key\u003e\n5. Add .env.local in the root dir with the following vars:\n   BASE_URL=http://localhost:3000\n   API_BASE_URL=http://localhost:3001\n   SEED_API_KEY=\u003cyour seed API key\u003e\n6. Run the application \n   `npm start` or `yarn start`\n7. Run tests\n     Run tests in UI mode:\n `npm run cy:open` or `yarn cy:open`\n     Run tests in headless mode:\n- `npm run test-local:smoke` or `yarn test-local:smoke`\n- `npm run test-local:e2e` or `yarn test-local:e2e`\n- `npm run test-local:api` or `yarn test-local:api`\n- `npm run test-local:firefox` or `yarn test-local:firefox`\n- `npm run test-local:edge` or `yarn test-local:edge`\n- `npm run test-local:mobile` or `yarn test-local:mobile`\n- `npm run test-local:tablet` or `yarn test-local:tablet`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkomilenkovic546%2Fcypress-framework-showcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkomilenkovic546%2Fcypress-framework-showcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkomilenkovic546%2Fcypress-framework-showcase/lists"}