-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02b11cb
commit 21a4fe1
Showing
18 changed files
with
702 additions
and
845 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: e2e client x | ||
on: | ||
push: | ||
paths: | ||
- 'app/**' | ||
- ".github/workflows/e2e-client.yml" | ||
- '!app/README.md' | ||
|
||
jobs: | ||
e2e_client: | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
working-directory: app | ||
steps: | ||
- name: checkout pull | ||
uses: actions/checkout@v3 | ||
- name: Node setup | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: 'app/.nvmrc' | ||
cache: yarn | ||
cache-dependency-path: 'app/yarn.lock' | ||
|
||
# - name: Get yarn cache directory path | ||
# id: yarn-cache-dir-path | ||
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
# - name: Yarn cache | ||
# uses: actions/cache@v3 | ||
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
# with: | ||
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Install Playwright Browsers | ||
run: yarn playwright install --with-deps | ||
|
||
- name: Run Playwright tests | ||
run: yarn playwright test | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
env: | ||
NEXT_PUBLIC_MAPBOX_API_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_API_TOKEN }} | ||
# Recommended: pass the GitHub token lets this action correctly | ||
# determine the unique run id necessary to re-run the checks | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NEXTAUTH_URL=http://localhost:3000 | ||
NEXTAUTH_SECRET=cats | ||
NEXT_PUBLIC_API_URL=https://marxan23.northeurope.cloudapp.azure.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules | ||
.next | ||
# **/*__test__.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ import { Meta } from '@storybook/addon-docs/blocks'; | |
|
||
# Tests | ||
|
||
- Cypress | ||
- Playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('About page', async ({ page }) => { | ||
await page.goto('/about'); | ||
|
||
await expect(page).toHaveTitle(/About/); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import path from 'path'; | ||
|
||
import { defineConfig, devices } from '@playwright/test'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config({ path: path.resolve(__dirname, '.env.test') }); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
|
||
const PORT = process.env.PORT || 3000; | ||
|
||
export default defineConfig({ | ||
testDir: './e2e', | ||
outputDir: './e2e/test-results', | ||
/* Run your local dev server before starting the tests */ | ||
webServer: { | ||
command: process.env.CI ? 'yarn build && yarn start' : 'yarn dev', | ||
url: `http://localhost:${PORT}`, | ||
reuseExistingServer: !process.env.CI, | ||
timeout: 120 * 1000, | ||
env: { | ||
// NEXTAUTH_URL: `http://localhost:${PORT}`, | ||
// NEXTAUTH_SECRET: | ||
// 'eyJhbGciOiJIUzUxMiJ9.ew0KICAic3ViIjogIjEyMzQ1Njc4OTAiLA0KICAibmFtZSI6ICJBbmlzaCBOYXRoIiwNCiAgImlhdCI6IDE1MTYyMzkwMjINCn0.iAHjJSyVz3a9cd6AfCHz05hEYeueUBmNHaSjBlKm8i5ygAIsRa9u5_yDV3HH2G599Sc2ueycdKP32BzTGRDeuA', | ||
// NEXT_PUBLIC_API_URL: 'https://test.marxanapi.com', | ||
}, | ||
}, | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 2 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 1 : undefined, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: 'html', | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
/* Base URL to use in actions like `await page.goto('/')`. */ | ||
baseURL: `http://localhost:${PORT}`, | ||
|
||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
{ | ||
name: 'auth-setup', | ||
testMatch: 'e2e/setups/auth.ts', | ||
}, | ||
{ | ||
name: 'Google Chrome', | ||
use: { | ||
...devices['Desktop Chrome'], | ||
channel: 'chrome', | ||
}, | ||
// dependencies: ['auth-setup'], | ||
}, | ||
// { | ||
// name: 'Microsoft Edge', | ||
// use: { | ||
// ...devices['Desktop Edge'], | ||
// channel: 'msedge', | ||
// }, | ||
// dependencies: ['auth-setup'], | ||
// }, | ||
// { | ||
// name: 'Mozilla Firefox', | ||
// use: { ...devices['Desktop Firefox'] }, | ||
// dependencies: ['auth-setup'], | ||
// }, | ||
|
||
/* Test against mobile viewports. */ | ||
// { | ||
// name: 'Mobile Chrome', | ||
// use: { ...devices['Pixel 5'] }, | ||
// }, | ||
// { | ||
// name: 'Mobile Safari', | ||
// use: { ...devices['iPhone 12'] }, | ||
// }, | ||
|
||
/* Test against branded browsers. */ | ||
// { | ||
// name: 'Microsoft Edge', | ||
// use: { ...devices['Desktop Edge'], channel: 'msedge' }, | ||
// }, | ||
// { | ||
// name: 'Google Chrome', | ||
// use: { ..devices['Desktop Chrome'], channel: 'chrome' }, | ||
// }, | ||
], | ||
}); |
Oops, something went wrong.