Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juyrjola committed Oct 18, 2024
1 parent 865f5b0 commit f25958a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: 'Base URL for backend API'
required: true
type: string
default: 'https://api.watch.kausal.dev/v1'
default: 'https://api.watch.kausal.tech/v1'
build_id:
description: 'Unique ID for the build'
required: true
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
name: Run tests
runs-on: runner-prod
container:
image: harbor.kausal.tech/library/playwright:v1.44.1
image: harbor.kausal.tech/library/playwright:v1.48.1
env:
TEST_INSTANCE_IDENTIFIERS: ${{ inputs.instance_identifiers }}
NEXT_PUBLIC_API_URL: ${{ inputs.backend_base_url }}
Expand All @@ -60,8 +60,8 @@ jobs:
app:
image: ${{ inputs.image }}
env:
DEPLOYMENT_TYPE: testing
NEXT_PUBLIC_WILDCARD_DOMAINS: localhost
NEXT_PUBLIC_DEPLOYMENT_TYPE: testing
NEXT_PUBLIC_API_URL: ${{ inputs.backend_base_url }}
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
AUTH_SECRET: abcd
Expand Down
11 changes: 7 additions & 4 deletions e2e-tests/common/context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';
import { Page, expect } from '@playwright/test';
import * as apollo from '@apollo/client';
import AxeBuilder from '@axe-core/playwright';
import { expect, Page } from '@playwright/test';

import type {
PlaywrightGetPlanBasicsQuery,
PlaywrightGetPlanBasicsQueryVariables,
PlaywrightGetPlanInfoQuery,
PlaywrightGetPlanInfoQueryVariables,
} from './__generated__/graphql';
import AxeBuilder from '@axe-core/playwright';
} from '../__generated__/graphql';

const { ApolloClient, InMemoryCache, gql } = apollo.default as typeof apollo;

const API_BASE =
process.env.NEXT_PUBLIC_API_URL || 'https://api.watch.kausal.tech/v1';
Expand Down
76 changes: 38 additions & 38 deletions e2e-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
},
"author": "",
"license": "AGPL-3.0-or-later",
"type": "module",
"dependencies": {
"@apollo/client": "^3.10.4",
"@axe-core/playwright": "^4.9.1",
"@playwright/test": "^1.44.1",
"@apollo/client": "^3.11.8",
"@axe-core/playwright": "^4.10.0",
"@playwright/test": "^1.48.1",
"dotenv": "^16.4.5",
"playwright": "^1.44.1",
"playwright": "^1.48.1",
"react": "^18.3.1"
},
"importSorter": {
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/tests/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Page, test as base, expect } from '@playwright/test';
import { expect, Page, test as base } from '@playwright/test';

import {
PlanContext,
displayConfiguration,
getIdentifiersToTest,
} from '../context';
PlanContext,
} from '../common/context';

const test = base.extend<{ ctx: PlanContext }>({});

Expand Down

0 comments on commit f25958a

Please sign in to comment.