{"id":29874486,"url":"https://github.com/dependencytrack/hyades-e2e","last_synced_at":"2025-07-31T00:13:56.892Z","repository":{"id":305675501,"uuid":"984771314","full_name":"DependencyTrack/hyades-e2e","owner":"DependencyTrack","description":"End-to-end tests for OWASP Dependency-Track","archived":false,"fork":false,"pushed_at":"2025-07-21T12:57:54.000Z","size":235,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T13:17:29.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dependencytrack.org","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DependencyTrack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://owasp.org/donate/?reponame=www-project-dependency-track\u0026title=OWASP+Dependency-Track"]}},"created_at":"2025-05-16T13:33:16.000Z","updated_at":"2025-07-21T12:30:45.000Z","dependencies_parsed_at":"2025-07-21T13:19:14.437Z","dependency_job_id":"6011e10e-1be0-4a94-8aca-18b3428573f9","html_url":"https://github.com/DependencyTrack/hyades-e2e","commit_stats":null,"previous_names":["dependencytrack/hyades-e2e"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/DependencyTrack/hyades-e2e","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DependencyTrack%2Fhyades-e2e","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DependencyTrack%2Fhyades-e2e/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DependencyTrack%2Fhyades-e2e/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DependencyTrack%2Fhyades-e2e/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DependencyTrack","download_url":"https://codeload.github.com/DependencyTrack/hyades-e2e/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DependencyTrack%2Fhyades-e2e/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267963745,"owners_count":24172904,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-07-31T00:13:51.012Z","updated_at":"2025-07-31T00:13:56.874Z","avatar_url":"https://github.com/DependencyTrack.png","language":"TypeScript","funding_links":["https://owasp.org/donate/?reponame=www-project-dependency-track\u0026title=OWASP+Dependency-Track"],"categories":[],"sub_categories":[],"readme":"[![Playwright E2E Tests](https://github.com/elAlmani/hyades-e2e/actions/workflows/e2e-playwright-allure_report.yml/badge.svg)](https://github.com/elAlmani/hyades-e2e/actions/workflows/e2e-playwright-allure_report.yml)\n[![pages-build-deployment](https://github.com/elAlmani/hyades-e2e/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/elAlmani/hyades-e2e/actions/workflows/pages/pages-build-deployment)\n\n# hyades-e2e\nEnd-to-end tests for OWASP Dependency-Track\n\n## 📚 Table of Contents\n\n- 🚀 [Getting Started](#-getting-started)\n- 🧪 [Testing](#-testing)\n- 📊 [Test Report](#-test-report)\n- 🚑 [Troubleshooting](#-troubleshooting)\n- ✅ [Current Coverage](#-current-coverage)\n- 🎭 [Updating Dependencies](#-updating-dependencies)\n\n---\n\n## 🚀 Getting Started\n### Playwright Minimum Requirements (as of March 2025) 🔧\n\nTo install and execute Playwright tests, ensure you meet the following minimum requirements:\n\n- Latest version of Node.js 18, 20, or 22.\n- Supported Operating Systems:\n    - Windows 10+, Windows Server 2016+, or Windows Subsystem for Linux (WSL).\n    - macOS 13 Ventura or later.\n    - Debian 12, Ubuntu 22.04, Ubuntu 24.04 (x86-64 and arm64 architecture).\n\n### 📦 Installation\n\nTo set up Playwright, run the following command in the root directory of your project:\n\n```sh\nnpm run playwright:init\n```\n\nThis script installs the dev-dependencies present inside `package.json` and the dependencies necessary for playwright to function (e.g. browsers)\n\nIf no errors occur, you're ready to use Playwright! 🎉 _If errors occur, stay calm and [troubleshoot](#-troubleshooting)!_ 🚨\n\n### 🔧 Configuration ️\n\nAll the configuration is happening inside `playwright.config.ts`.\nMost of the configuration should be trivial, but adding playwright-bdd to it is a bit different.\nThis snippet is used to configure BDD part of Playwright.\n```typescript\nconst gherkinTestDir = defineBddConfig({\n  tags: '@projects or @permissions and not @todo',\n  features: playwrightTestDir + '/features/**/*.feature',\n  steps: [playwrightTestDir + '/steps/*.steps.ts', playwrightTestDir + '/fixtures/fixtures.ts'],\n  outputDir: playwrightTestDir + '/.features-gen/tests',\n});\n```\n\n- **testDir**: Specifies the directory where the test files are located.\n- **outputDir**: Defines where test artifacts (e.g., screenshots, videos) are saved.\n- **timeout**: Time allowed for each individual test to run.\n- **reporter**: Specifies the format and destination for test reports.\n- **globalSetup**: A script that runs before all tests to set up the environment.\n- **use**: Global settings for browser context, like base URL, video recording, and screenshots.\n- **projects**: Defines configurations for running tests across different browsers or devices. Makes use of the bdd code-snippet\n\nBut rather than creating another wiki here, we would suggest visiting the [Playwright Config Documentation](https://playwright.dev/docs/test-configuration) or look at the [playwright.config.ts](playwright.config.ts)\n\n## 🧪 Testing\n### 📜 Tests with Playwright BDD\n\nPlaywright does not natively support Behavior-Driven Development (BDD) ([official issue](https://github.com/microsoft/playwright/issues/11975)), but recommends a plugin that makes it possible: [Playwright BDD](https://vitalets.github.io/playwright-bdd/#/).\nThat Plugin basically translates Gherkin into executable tests for the Playwright runner. The generated tests will be located in `/.feature-gen`.\n\n### 📝 Writing a Test with Gherkin Syntax ️\n\nWe use Playwright-BDD for the tests, which makes use of cucumber/gherkin.\n\n**Feature**: High-level functionality written in `.feature` files using Gherkin syntax.\n```gherkin\nFeature: VIEW_PORTFOLIO\n  Scenario: Without VIEW_PORTFOLIO Permission The User Cannot Log In\n    Given the user \"test-user0_PERMS\" tries to log in to DependencyTrack\n    Then the user receives login error toast\n```\n**Steps**: Define the behavior for each scenario step, implemented in `.step.ts`-files linking with the Gherkin steps:\n```typescript\nGiven('the user {string} tries to log in to DependencyTrack', async ({ loginPage }, username: string) =\u003e {\n  await loginPage.goto();\n  await loginPage.verifyVisibleLoginPage();\n  await loginPage.login(username, process.env.RANDOM_PASSWORD);\n});\n```\n**Page Objects**: Similar to classes but for locators of a page (e.g. [LoginPage](/playwright-tests/page-objects/login.pom.ts))\n\n**Fixtures**: Used to isolate test steps from another by initializing page-objects for each step (e.g. loginPage from the Given-step above)\n\n### 🏃 Running a Test\n\nIn order to run the tests, DependencyTrack must be running on `localhost`. Configuration for the baseURL can be done in `playwright.config.ts`.\nSome scripts are already present within `package.json`. They refer to the respective projects mentioned inside `playwright.config.ts` and follow a default structure:\n![Playwright Setup Order](/docs/images/playwright-setup-order.png)\n\nWhen running the tests for example in chromium, you would use the following script\n```sh\nnpm run playwright:test:chromium\n```\n\nIt will run all the tests, including the setup.\nInitially DependencyTrack is not set up, so you can run the following command, which will change the password of admin to the value set inside [local-auth.json](/playwright-tests/resources/local-auth.json)\n```shell\nnpm run playwright:clean:initial:chromium\n```\n\n**V1 of the setup takes quite long so if you just want to run the tests without the setup, use**:\n```sh\nnpm run playwright:test:only:chromium\n```\n**But keep in mind, that when only running the tests, the previous data will not be cleaned up.**\nBy adding `@only` above a feature (or scenario), you can reduce the test count to just that feature (or to just a scenario), depending on your use case 😎👌\n\n### 🐛 Debugging\n\nWhen a test is failing and there is not enough information in the report, running the test-command with certain parameters can help to narrow it down.\nCommon debugging parameters are:\n\n- `--headed` - Runs tests visually.\n- `--debug` - Enables the integrated debugger (does not require `--headed`).\n- `--ui` - Opens a UI similar.\n\nE.g. (Don't forget to add `--` before, as you are passing a parameter into a script)\n\n```sh\nnpm run playwright:test:chromium -- --headed\n```\n\nTo use the Trace Viewer for debugging just open [Playwright Trace Viewer](https://trace.playwright.dev/) and locate the trace file inside the report folder.\n\n## 📊 Test Report\n\nFor reporting, different solutions are used based on the environment:\n\n### 💻 Local - HTML Report\n\nPlaywright's built-in HTML report is used locally. The report opens automatically if there were failing tests, but you can still open the report by running:\n\n```sh\nnpm run playwright:show:report\n```\n\n### 📡 CI/CD - Allure Report\n\nFor CI/CD purposes [Allure Report](https://allurereport.org/) is used for reporting.\nThe configuration is inside [e2e-playwright-allure_report.yml](.github/workflows/e2e-playwright-allure_report.yml).\nWe basically execute the tests, let allure generate a report, publish it into the gh-pages-branch and let github-pages render the report. 🙌\n\n## 🚑 Troubleshooting\n\n**Potential Issues:**\n\n- **Playwright installation errors?**\n    - _Ensure you have the correct Node.js version (18, 20, or 22) and try reinstalling dependencies:_\n- **Test Errors occur?**\n    - _Verify that the .feature-files are referenced properly inside the .steps.ts-files_\n- _There may be more issues coming in the future_\n\n## ✅ Current Coverage\n\nAs of March 2025 V1 of the tests do not cover all functionality, that DependencyTrack provides.\nIt provides coverage for the main permissions and important features for projects. Check out `e2e/playwright-tests/features`.\n\n## 🎭 Updating Dependencies\n\nUpdating the dependencies inside `package.json` also needs updating `package-lock.json`. This can be achieved by running\n\n```shell\nnpm install\n```\n\n---\n\nFor more details, visit the [official Playwright documentation](https://playwright.dev/) and [Playwright-BDD](https://vitalets.github.io/playwright-bdd/#/) for the BDD approach.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdependencytrack%2Fhyades-e2e","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdependencytrack%2Fhyades-e2e","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdependencytrack%2Fhyades-e2e/lists"}