diff --git a/src/Turnierplan.App/Client/e2e/docker/docker-compose.yaml b/src/Turnierplan.App/Client/e2e/docker/docker-compose.yaml index 8cbdf49e..cb5c1441 100644 --- a/src/Turnierplan.App/Client/e2e/docker/docker-compose.yaml +++ b/src/Turnierplan.App/Client/e2e/docker/docker-compose.yaml @@ -1,6 +1,12 @@ # This docker compose file is used for running the E2E tests during the CI workflow services: + turnierplan.e2e.database: + image: postgres:17.0 + environment: + - POSTGRES_PASSWORD=P@ssw0rd + - POSTGRES_DB=turnierplan_e2e + turnierplan.e2e.application.amd64: build: dockerfile: 'docker/turnierplan-amd64/Dockerfile' @@ -8,6 +14,6 @@ services: ports: - "45001:8080" environment: - - Database__InMemory=true + - Database__ConnectionString=Host=turnierplan.e2e.database;Database=turnierplan_e2e;Username=postgres;Password=P@ssw0rd - Turnierplan__ApplicationUrl=http://localhost:45001 - Turnierplan__InitialUserPassword=P@ssw0rd diff --git a/src/Turnierplan.App/Client/e2e/pages/view-tournament-page.ts b/src/Turnierplan.App/Client/e2e/pages/view-tournament-page.ts index 87bd19ea..9067f882 100644 --- a/src/Turnierplan.App/Client/e2e/pages/view-tournament-page.ts +++ b/src/Turnierplan.App/Client/e2e/pages/view-tournament-page.ts @@ -11,8 +11,12 @@ export class ViewTournamentPage { public async reportMatch(index: number, scoreA: number, scoreB: number): Promise { await this.page.getByTestId(turnierplan.viewTournamentPage.matchPlan.matchRow(index)).click(); - await this.page.getByTestId(turnierplan.editMatchDialog.scoreAField).pressSequentially(`${scoreA}`); - await this.page.getByTestId(turnierplan.editMatchDialog.scoreBField).pressSequentially(`${scoreB}`); + await this.page.getByTestId(turnierplan.editMatchDialog.scoreAField).fill(`${scoreA}`); + + // This click() below seems pointless but is required because the scoreB is sometimes inserted into the scoreA field... + await this.page.getByTestId(turnierplan.editMatchDialog.scoreBField).click(); + + await this.page.getByTestId(turnierplan.editMatchDialog.scoreBField).fill(`${scoreB}`); await this.page.getByTestId(turnierplan.editMatchDialog.saveButton).click(); } diff --git a/src/Turnierplan.App/Client/package.json b/src/Turnierplan.App/Client/package.json index 2d98b938..61cfc297 100644 --- a/src/Turnierplan.App/Client/package.json +++ b/src/Turnierplan.App/Client/package.json @@ -21,7 +21,7 @@ "test:ci": "ng test --watch=false --source-map=true --code-coverage --browsers ChromeHeadless", "e2e:swap-environment": "replace-in-file \"environment.prod.ts\" \"environment.e2e.ts\" angular.json", "e2e:swap-environment-back": "replace-in-file \"environment.e2e.ts\" \"environment.prod.ts\" angular.json", - "e2e:prepare:amd64": "npx playwright install chromium && npm run e2e:swap-environment && docker compose -f e2e/docker/docker-compose.yaml up --build -d turnierplan.e2e.application.amd64 && npm run e2e:swap-environment-back", + "e2e:prepare:amd64": "npx playwright install chromium && npm run e2e:swap-environment && docker compose -f e2e/docker/docker-compose.yaml up --build -d && npm run e2e:swap-environment-back", "e2e:destroy": "docker compose -f e2e/docker/docker-compose.yaml down", "e2e:open": "npx playwright test --ui", "e2e:run": "npx playwright test"