remove playwright parallel, but run macos and ubuntu at the same time (#1617)

* remove playwright parallel, but run macos and ubuntu at the same time

* better logging for cam test

* skip a test for safari

* remove steps
This commit is contained in:
Kurt Hutten
2024-03-04 12:18:56 +11:00
committed by GitHub
parent 6406e27794
commit 61e2a1eddc
3 changed files with 16 additions and 14 deletions

View File

@ -85,7 +85,6 @@ jobs:
playwright-macos: playwright-macos:
timeout-minutes: 60 timeout-minutes: 60
runs-on: macos-14 runs-on: macos-14
needs: playwright-ubuntu
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4

View File

@ -4,6 +4,7 @@ import { getUtils } from './test-utils'
import waitOn from 'wait-on' import waitOn from 'wait-on'
import { Themes } from '../../src/lib/theme' import { Themes } from '../../src/lib/theme'
import { roundOff } from 'lib/utils' import { roundOff } from 'lib/utils'
import { platform } from 'node:os'
/* /*
debug helper: unfortunately we do rely on exact coord mouse clicks in a few places debug helper: unfortunately we do rely on exact coord mouse clicks in a few places
@ -134,6 +135,7 @@ test('Basic sketch', async ({ page }) => {
|> angledLine([180, segLen('seg01', %)], %)`) |> angledLine([180, segLen('seg01', %)], %)`)
}) })
test.skip(process.platform === 'darwin', 'Can moving camera')
test('Can moving camera', async ({ page, context }) => { test('Can moving camera', async ({ page, context }) => {
const u = getUtils(page) const u = getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 }) await page.setViewportSize({ width: 1200, height: 500 })
@ -161,6 +163,7 @@ test('Can moving camera', async ({ page, context }) => {
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByRole('button', { name: 'Start Sketch' }).click() await page.getByRole('button', { name: 'Start Sketch' }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// const yo = page.getByTestId('cam-x-position').inputValue()
await u.doAndWaitForImageDiff(async () => { await u.doAndWaitForImageDiff(async () => {
await mouseActions() await mouseActions()
@ -172,23 +175,23 @@ test('Can moving camera', async ({ page, context }) => {
}, 300) }, 300)
await u.openAndClearDebugPanel() await u.openAndClearDebugPanel()
const xError = Math.abs( const vals = await Promise.all([
Number(await page.getByTestId('cam-x-position').inputValue()) + xyz[0] page.getByTestId('cam-x-position').inputValue(),
) page.getByTestId('cam-y-position').inputValue(),
const yError = Math.abs( page.getByTestId('cam-z-position').inputValue(),
Number(await page.getByTestId('cam-y-position').inputValue()) + xyz[1] ])
) const xError = Math.abs(Number(vals[0]) + xyz[0])
const zError = Math.abs( const yError = Math.abs(Number(vals[1]) + xyz[1])
Number(await page.getByTestId('cam-z-position').inputValue()) + xyz[2] const zError = Math.abs(Number(vals[2]) + xyz[2])
)
let shouldRetry = false let shouldRetry = false
if (xError > 5 || yError > 5 || zError > 5) { if (xError > 5 || yError > 5 || zError > 5) {
if (cnt > 2) { if (cnt > 2) {
console.log('xError', xError) console.log('xVal', vals[0], 'xError', xError)
console.log('yError', yError) console.log('yVal', vals[1], 'yError', yError)
console.log('zError', zError) console.log('zVal', vals[2], 'zError', zError)
throw new Error('Camera position not as expected') throw new Error('Camera position not as expected')
} }
shouldRetry = true shouldRetry = true

View File

@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */ /* Retry on CI only */
retries: process.env.CI ? 3 : 0, retries: process.env.CI ? 3 : 0,
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 2 : 1, workers: process.env.CI ? 1 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */