Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-rew committed Jan 11, 2024
1 parent 1b97f21 commit 33bfe74
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 43 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/playwright.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
dist/
node_modules/
target/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
8 changes: 7 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
FROM node:18.17.1-bookworm
FROM mcr.microsoft.com/playwright:v1.40.1-jammy

RUN apt-get update &&\
apt-get install software-properties-common -y &&\
apt-add-repository universe -y &&\
apt-get update &&\
apt-get install openjdk-17-jdk maven -y

USER node
12 changes: 12 additions & 0 deletions build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ pipeline {
}
}
}
stage('NPM:test') {
steps {
script {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
docker.build('node', '-f build/Dockerfile .').inside {
sh 'npm run test'
}
}
archiveArtifacts artifacts: 'playwright-report/**', allowEmptyArchive: false
}
}
}
stage('Deploy') {
when {
expression { isReleaseOrMasterBranch() && currentBuild.changeSets.size() > 0 }
Expand Down
15 changes: 0 additions & 15 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
import { defineConfig, devices } from '@playwright/test';

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

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* 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: {
baseURL: 'http://localhost:5173',
/* 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: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run start',
url: 'http://localhost:5173',
Expand Down

0 comments on commit 33bfe74

Please sign in to comment.