Skip to content

Commit

Permalink
fix deps issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Oct 23, 2023
1 parent c7f1b12 commit b1bdac7
Show file tree
Hide file tree
Showing 5 changed files with 666 additions and 977 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ name: End-to-end

on: [push, pull_request]

env:
BASE_CANONICAL_URL: ${{ vars.BASE_CANONICAL_URL }}
API_HOST_CLIENT: ${{ vars.API_HOST_CLIENT }}
API_HOST_SERVER: ${{ vars.API_HOST_SERVER }}
COOKIE_SECRET: ${{ secrets.COOKIE_SECRET }}
ADS_SESSION_COOKIE_NAME: ${{ vars.ADS_SESSION_COOKIE_NAME }}
SCIX_SESSION_COOKIE_NAME: ${{ vars.SCIX_SESSION_COOKIE_NAME }}

jobs:
unit-tests:
timeout-minutes: 60
Expand Down Expand Up @@ -54,6 +46,12 @@ jobs:
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
CI: true
BASE_CANONICAL_URL: ${{ vars.BASE_CANONICAL_URL }}
API_HOST_CLIENT: ${{ vars.API_HOST_CLIENT }}
API_HOST_SERVER: ${{ vars.API_HOST_SERVER }}
COOKIE_SECRET: ${{ vars.COOKIE_SECRET }}
strategy:
matrix:
node-version: [ 18 ]
Expand All @@ -78,6 +76,15 @@ jobs:
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: setup environment variables
run: |
touch .env.local
echo "CI=${{ env.CI }}" >> .env.local
echo "BASE_CANONICAL_URL=${{ env.BASE_CANONICAL_URL }}" >> .env.local
echo "API_HOST_CLIENT=${{ env.API_HOST_CLIENT }}" >> .env.local
echo "API_HOST_SERVER=${{ env.API_HOST_SERVER }}" >> .env.local
echo "COOKIE_SECRET=${{ env.COOKIE_SECRET }}" >> .env.local
- name: Run integration tests
run: pnpm integration

Expand Down
2 changes: 1 addition & 1 deletion e2e/classic-form.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, PlaywrightTestArgs, test } from '@playwright/test';

test('blank form has correct defaults set', async ({ page }) => {
await page.goto('/classic-form');
await page.goto('/classic-form', { timeout: 60000 });
await page.locator('form').isVisible();

// of all radios, only the first is checked (All)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"dayzed": "^3.2.3",
"diff": "^5.1.0",
"dompurify": "^3.0.3",
"dotenv": "^16.3.1",
"downshift": "^6.1.7",
"escape-html": "^1.0.3",
"express": "^4.17.1",
Expand Down Expand Up @@ -137,7 +138,7 @@
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/coverage-v8": "^0.34.5",
"@vitest/ui": "^0.29.2",
"autoprefixer": "^10.2.4",
"babel-loader": "^8.0.0",
Expand Down
45 changes: 16 additions & 29 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
dotenv.config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e',
/* Run tests in files in parallel */
fullyParallel: true,
fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
Expand Down Expand Up @@ -48,32 +45,22 @@ export default defineConfig({
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* 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' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
env: {
BASE_CANONICAL_URL: process.env.BASE_CANONICAL_URL || 'https://ui.adsabs.harvard.edu',
API_HOST_CLIENT: process.env.API_HOST_CLIENT || 'https://devapi.adsabs.harvard.edu/v1',
API_HOST_SERVER: process.env.API_HOST_SERVER || 'https://devapi.adsabs.harvard.edu/v1',
COOKIE_SECRET: process.env.COOKIE_SECRET || 'secret_secret_secret_secret_secret',
ADS_SESSION_COOKIE_NAME: process.env.ADS_SESSION_COOKIE_NAME || 'ads_session',
SCIX_SESSION_COOKIE_NAME: process.env.SCIX_SESSION_COOKIE_NAME || 'scix_session',
},
command: 'pnpm run dev:mocks',
url: 'http://localhost:8000',
port: 8000,
// 5 minute timeout
timeout: 300000,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
},
});
Loading

0 comments on commit b1bdac7

Please sign in to comment.