Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] Handle running UI tests on localhost #6

Closed
vOrigins opened this issue Feb 7, 2025 · 0 comments · Fixed by #5
Closed

[FE] Handle running UI tests on localhost #6

vOrigins opened this issue Feb 7, 2025 · 0 comments · Fixed by #5
Assignees
Labels
enhancement New feature or request

Comments

@vOrigins
Copy link
Contributor

vOrigins commented Feb 7, 2025

Tests should be run with different parameters depending on how APIHUB UI is launched.

  1. Live environment ✅
  2. Local via docker compose ✅
  3. Local via docker compose + dev proxy ✅

To test the "Playground" via a localhost, in playwright tests, you need to set a value for the PLAYGROUND_BACKEND_HOST environment variable, it will be used in the test to create a custom server for sending requests.

In case of using Docker Compose, this is http://host.docker.internal:8081 (protocol + value of the APIHUB_URL variable from the qubership-apihub-backend.env file). Also, you need to add the variable ALLOWED_HOSTS=host.docker.internal to the qubership-apihub-backend.env file.

In case of using docker compose + dev proxy, in addition to the previous settings, in playwright tests, you need to add the variable DEV_PROXY_MODE=true, to skip tests that cannot be executed in this mode.

These settings should be reflected in the README.

Live environment Docker compose Docker compose + dev proxy
Playground tests ✔️ ✔️ ALLOWED_HOSTS=host.docker.internal - in docker compose
PLAYGROUND_BACKEND_HOST=http://host.docker.internal:8081 - in tests
✔️ ALLOWED_HOSTS=host.docker.internal - in docker compose
PLAYGROUND_BACKEND_HOST=http://host.docker.internal:8081 - in test
Tests with rediretcs to the Agent ✔️ ✔️ ❌ Skipped with DEV_PROXY_MODE=true - in tests
Expand/collapse the Package page sidebar test ✔️ ✔️ ❌ Skipped with DEV_PROXY_MODE=true - in tests
@vOrigins vOrigins added the enhancement New feature or request label Feb 7, 2025
@vOrigins vOrigins self-assigned this Feb 7, 2025
@vOrigins vOrigins moved this to In progress in qubership-apihub Feb 7, 2025
@vOrigins vOrigins moved this from In progress to Done in qubership-apihub Feb 11, 2025
@vOrigins vOrigins closed this as completed by moving to Done in qubership-apihub Feb 11, 2025
@vOrigins vOrigins transferred this issue from Netcracker/qubership-apihub Feb 17, 2025
@vOrigins vOrigins linked a pull request Feb 18, 2025 that will close this issue
@vOrigins vOrigins linked a pull request Mar 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant