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

Run playwright tests in our gha integration test workflow #1132

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion .github/workflows/integration-test-gha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ jobs:
kubectl wait --for=condition=Ready --timeout=120s pod -l 'app.kubernetes.io/component=controller' -n languagedepot
kubectl wait --for=condition=Ready --timeout=120s pod -l 'app in (lexbox, ui, hg, db)' -n languagedepot
- name: forward ingress
run: kubectl port-forward service/ingress-nginx-controller 6579:80 -n languagedepot &
run: |
kubectl port-forward service/ingress-nginx-controller 6579:80 -n languagedepot &
kubectl port-forward service/lexbox 1080:1080 -n languagedepot &
- name: verify ingress
run: curl -v http://localhost:6579
- name: build
Expand All @@ -80,6 +82,49 @@ jobs:
TEST_PROJECT_CODE: 'sena-3'
TEST_DEFAULT_PASSWORD: 'pass'
run: dotnet test LexBoxOnly.slnf --logger GitHubActions --filter "Category=Integration|Category=FlakyIntegration" --blame-hang-timeout 40m

##playwright tests
# First we need to setup Node...
- uses: actions/setup-node@v4
with:
node-version-file: 'frontend/package.json'
# Then we can set up pnpm...
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
package_json_file: 'frontend/package.json'
# Then we can have Node set up package caching
- uses: actions/setup-node@v4
with:
node-version-file: 'frontend/package.json'
cache: 'pnpm'
cache-dependency-path: 'frontend/pnpm-lock.yaml'
- name: Playwright setup
working-directory: frontend
run: pnpm install
- name: Set up Playwright dependencies
working-directory: frontend
run: pnpm exec playwright install --with-deps

- name: Integration tests (Playwright)
id: playwright-tests
env:
TEST_SERVER_HOSTNAME: 'localhost:6579'
TEST_STANDARD_HG_HOSTNAME: 'hg.localhost:6579'
TEST_RESUMABLE_HG_HOSTNAME: 'resumable.localhost:6579'
TEST_PROJECT_CODE: 'sena-3'
TEST_DEFAULT_PASSWORD: 'pass'
working-directory: frontend
run: pnpm test

- name: Upload playwright results
if: ${{ always() && steps.playwright-tests.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
with:
name: playwright-traces-${{ inputs.runs-on }}-hg-${{ inputs.hg-version }}
path: |
./frontend/test-results


- name: status
if: failure()
run: |
Expand Down
3 changes: 2 additions & 1 deletion backend/LexBoxApi/Services/EmailService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ private async Task SendInvitationEmail(
var httpContext = httpContextAccessor.HttpContext;
ArgumentNullException.ThrowIfNull(httpContext);

var returnTo = _linkGenerator.GetUriByAction(httpContext,
//using GetPathByAction so the path is relative
var returnTo = _linkGenerator.GetPathByAction(httpContext,
nameof(LexBoxApi.Controllers.UserController.HandleInviteLink),
"User");
var registerLink = _linkGenerator.GetUriByAction(httpContext,
Expand Down
3 changes: 3 additions & 0 deletions deployment/gha/lexbox.patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ spec:
spec:
containers:
- name: lexbox-api
env:
- name: Email__BaseUrl
value: "http://localhost:6579"
volumeMounts:
- mountPath: /frontend
name: gql-schema
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/components/addMemberModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BaseComponent } from './baseComponent';
const EMAIL_LABEL = 'Email';
const ROLE_LABEL = 'Role';
const INVITE_LABEL = 'Invite';
const SUBMIT_BUTTON_LABEL = new RegExp(`Add Member|Add or invite Member`);
const SUBMIT_BUTTON_LABEL = new RegExp(`Add Member|Add/Invite Member`);

export class AddMemberModal extends BaseComponent {
get emailField(): Locator {
Expand Down
Loading