Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions e2e/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const pagesToRender = Object.keys(modules)
? {
Component: lazy(
// oxlint-disable-next-line typescript/no-unsafe-return
async () => import(`./tests/${path?.split('/')[2]}/render.tsx`),
async () =>
import(
`./tests/${path?.split('/')[2]}/${path?.split('/')[3]}/render.tsx`
),
),
name: path.replace('.tsx', ''),
}
Expand All @@ -55,9 +58,9 @@ const WelcomePage = () => (
{pagesToRender.map(path => (
<li key={path?.name}>
<ReactRouterLink
to={{ pathname: path?.name?.split('/')[2]?.toLowerCase() ?? '' }}
to={{ pathname: path?.name?.split('/')[3]?.toLowerCase() ?? '' }}
>
{path?.name?.split('/')[2]?.toLowerCase()}
{path?.name?.split('/')[3]?.toLowerCase()}
</ReactRouterLink>
</li>
))}
Expand All @@ -79,7 +82,7 @@ const App = () => (
<Route
element={<Element />}
key={path?.name}
path={path?.name?.split('/')[2]?.toLowerCase()}
path={path?.name?.split('/')[3]?.toLowerCase()}
/>
)
}
Expand Down
17 changes: 17 additions & 0 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# this dockerfile will be used to generate the same screenshot for our CI.
FROM mcr.microsoft.com/playwright:v1.58.2-jammy

WORKDIR /build

ARG TURBO_TOKEN=

ENV TURBO_TOKEN ${TURBO_TOKEN}
ENV CI=true

COPY . .

RUN npm install -g corepack@0.31.0
RUN corepack enable
RUN pnpm install --frozen-lockfile

ENTRYPOINT ["pnpm", "run", "test:e2e"]
22 changes: 17 additions & 5 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,32 @@ export default defineConfig({
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
name: 'e2e-chromium',
testDir: './tests/e2e',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
name: 'e2e-firefox',
testDir: './tests/e2e',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
name: 'e2e-webkit',
testDir: './tests/e2e',
use: {
...devices['Desktop Safari'],
},
},
{
name: 'screenshots-chromium',
testDir: './tests/screenshots',
use: {
...devices['Desktop Chrome'],
},
},
],
reporter: 'line',
retries: isCI ? 2 : 0,
testDir: './tests',
timeout: isCI ? Number(times['1min']) : undefined,
use: {
baseURL,
Expand All @@ -45,6 +56,7 @@ export default defineConfig({
stderr: 'pipe',
stdout: 'ignore',
url: baseURL,
reuseExistingServer: true,
},
workers: isCI ? 1 : undefined,
})
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { Button, Modal, Stack, Text, TextInput } from '@ultraviolet/ui'
import { useState } from 'react'

import { mockErrors } from '../../mocks/mockErrors'
import { mockErrors } from '../../../mocks/mockErrors'

const Render = () => {
const methods = useForm<{ lastName: ''; color: '' }>()
Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading