https://github.com/redhat-developer/consoledot-e2e
https://github.com/redhat-developer/consoledot-e2e
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/redhat-developer/consoledot-e2e
- Owner: redhat-developer
- License: apache-2.0
- Created: 2022-10-17T11:24:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-06T09:41:09.000Z (over 2 years ago)
- Last Synced: 2025-06-05T05:30:19.333Z (9 months ago)
- Language: TypeScript
- Size: 314 KB
- Stars: 3
- Watchers: 5
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# E2E tests for console.redhat.com
[](https://github.com/redhat-developer/consoledot-e2e/actions/workflows/playwright.yml)
E2E tests for RedHat Console.
## Build & Run
Tools:
- [Typescript](https://www.typescriptlang.org/): close to the UI developers ecosystem
- [NPM](https://www.npmjs.com/): build tool
- [Node](https://nodejs.org/en/): runtime
- [Playwright](https://playwright.dev/): framework for UI testing
- [GH Action](https://docs.github.com/en/actions): infrastructure
Local requirements:
- `npm`: `8.X`
- `node`: `16.X`
Before running the tests you would need to provide a valid username and password to be used in the form of environment variables.
```bash
export ENV_TYPE=... # stage or production - depends on environment
export USE_BETA=... # true/false to enable test run on Beta
export TEST_USERNAME=...
export TEST_PASSWORD=...
export TEST_ADMIN_USERNAME=...
export TEST_ADMIN_PASSWORD=...
export TEST_2_USERNAME=...
export TEST_2_PASSWORD=...
export STARTING_PAGE=...
```
or drop a `.env` file in the root folder with a similar content:
```
USE_BETA=... # true/false to enable test run on Beta
ENV_TYPE=... # stage or production - depends on environment
TEST_USERNAME=...
TEST_PASSWORD=...
TEST_ADMIN_USERNAME=...
TEST_ADMIN_PASSWORD=...
TEST_2_USERNAME=...
TEST_2_PASSWORD=...
STARTING_PAGE=...
```
Now you can run the tests:
```bash
npm install # Install all the needed Node dependencies
npx playwright install # Install all the Playwright dependencies and needed browsers
npx playwright test --project chromium # Executes the tests on a selected browser (`chromium` in this case)
npm test-chrome # package.json has prepared scripts so you don't need to call whole npx command
npm test-firefox
```
if you need to debug you can use the Playwright console and have a Playwright helper available in console by executing:
```bash
PWDEBUG=1 npx playwright test --project chromium --debug
```
For enabling slow mode 1s for debugging use
```bash
SLOW_MODE=1000 npx playwright test
```
For enabling error logging use
```bash
ENABLE_ERR_LOGGING=1 npx playwright test
```
### Setup
This repository uses GitHub Actions as infrastructure to run the tests against publicly accessible services.
The CI only runs on the `main` branch to avoid sharing secrets on branches and forks.
### Security
The only sensitive data in this project is the username and password used to login.
Those are stored in [GitHub Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets).