Skip to content

Commit

Permalink
test playwright image
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Jul 23, 2024
1 parent 1330d0d commit 71079da
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: run tests
run: make CI=1 ci
run: make CI=1 ci_new
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ build_docker_ci:
docker build -f docker/Dockerfile_ci -t elasticvue-ci .

ci: build_docker_ci
docker run --rm elasticvue-ci yarn lint
docker run --rm elasticvue-ci yarn tsc
docker run --rm elasticvue-ci yarn test:unit
docker run --rm -e CI="$(CI)" -v ./playwright-report-ci:/app/playwright-report elasticvue-ci yarn test:e2e:all
docker run --rm -e CI="$(CI)" -v ./playwright-report-ci:/app/playwright-report elasticvue-ci yarn ci

build_docker_ci_new:
docker build -f docker/Dockerfile_ci_new -t elasticvue-ci-new .

ci_new: build_docker_ci_new
docker run --rm -e CI="$(CI)" -v ./playwright-report-ci:/app/playwright-report elasticvue-ci-new yarn ci

build_tauri:
yarn tauri:build
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile_ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.5.1-bookworm AS builder
FROM node:22.5.1-bookworm
RUN mkdir /app
WORKDIR /app

Expand Down
19 changes: 19 additions & 0 deletions docker/Dockerfile_ci_new
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mcr.microsoft.com/playwright:v1.45.1-noble
ENV ASDF_DIR=/root/.asdf

RUN mkdir /app
WORKDIR /app

COPY .tool-versions .

RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 \
&& . "$HOME/.asdf/asdf.sh" \
&& asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git \
&& asdf install

COPY package.json .
COPY yarn.lock .

RUN yarn install

COPY . .
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"test:e2e:all": "playwright test",
"test:e2e:watch": "PWTEST_WATCH=1 playwright test --project=chromium",
"test:e2e:report": "playwright show-report",
"ci": "yarn lint && yarn tsc && yarn test:unit && yarn test:e2e:all",
"tauri:dev": "tauri dev",
"tauri:build": "tauri build",
"bundle:report": "vite-bundle-visualizer"
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/Routing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { test, expect } from '@playwright/test'
import { setupClusterConnection } from '../helpers'
import { withElastic } from '../mocks'

test.describe.configure({ mode: 'parallel' });

withElastic(({ mockElastic, elastic }) => {
test.describe(`elasticsearch ${elastic.version}`, () => {
test.describe('Routing', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/pages/Base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { test, expect } from '@playwright/test'
import { openElasticvue } from '../../helpers'

test.describe.configure({ mode: 'parallel' });

test.describe('base', () => {
test('has a title', async ({ page }) => {
await openElasticvue(page)
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/pages/ClusterManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { test, expect, Page } from '@playwright/test'
import { setupClusterConnection } from '../../helpers'
import { withElastic } from '../../mocks'

test.describe.configure({ mode: 'parallel' });

const setupClusterSelectionTest = async (page: Page) => {
await setupClusterConnection(page)
await page.getByTestId('cluster-selection').click()
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/pages/HomeStatus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { test, expect } from '@playwright/test'
import { setupClusterConnection } from '../../helpers'
import { withElastic } from '../../mocks'

test.describe.configure({ mode: 'parallel' });

withElastic(({ mockElastic, elastic }) => {
test.describe(`elasticsearch ${elastic.version}`, () => {
test.describe('HomeStatus', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/pages/Indices.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { test, expect } from '@playwright/test'
import { setupClusterConnection } from '../../helpers'
import { withElastic } from '../../mocks'

test.describe.configure({ mode: 'parallel' });

const setup = async (page: any, mockElastic: any) => {
await mockElastic(page)
await setupClusterConnection(page)
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/tests/pages/Nodes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { test, expect } from '@playwright/test'
import { setupClusterConnection } from '../../helpers'
import { withElastic } from '../../mocks'

test.describe.configure({ mode: 'parallel' });

withElastic(({ mockElastic, elastic }) => {
test.describe(`elasticsearch ${elastic.version}`, () => {
test.describe('Nodes', () => {
Expand Down

0 comments on commit 71079da

Please sign in to comment.