2025-04-01 23:54:26 -07:00
|
|
|
import type { EngineCommand } from '@src/lang/std/artifactGraph'
|
|
|
|
import { uuidv4 } from '@src/lib/utils'
|
|
|
|
|
2025-04-25 10:49:22 -04:00
|
|
|
import { getUtils } from '@e2e/playwright/test-utils'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
2025-06-03 14:56:19 -04:00
|
|
|
import type { Page } from '@playwright/test'
|
|
|
|
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-04-24 20:50:26 -04:00
|
|
|
test.describe('Testing Camera Movement', () => {
|
2025-06-03 14:56:19 -04:00
|
|
|
/**
|
|
|
|
* hack that we're implemented our own retry instead of using retries built into playwright.
|
|
|
|
* however each of these camera drags can be flaky, because of udp
|
|
|
|
* and so putting them together means only one needs to fail to make this test extra flaky.
|
|
|
|
* this way we can retry within the test
|
|
|
|
* We could break them out into separate tests, but the longest past of the test is waiting
|
|
|
|
* for the stream to start, so it can be good to bundle related things together.
|
|
|
|
*/
|
|
|
|
const bakeInRetries = async ({
|
|
|
|
mouseActions,
|
|
|
|
afterPosition,
|
|
|
|
beforePosition,
|
|
|
|
retryCount = 0,
|
2025-04-07 07:08:31 -04:00
|
|
|
page,
|
|
|
|
scene,
|
2025-06-03 14:56:19 -04:00
|
|
|
}: {
|
|
|
|
mouseActions: () => Promise<void>
|
|
|
|
beforePosition: [number, number, number]
|
|
|
|
afterPosition: [number, number, number]
|
|
|
|
retryCount?: number
|
|
|
|
page: Page
|
|
|
|
scene: SceneFixture
|
2025-04-07 07:08:31 -04:00
|
|
|
}) => {
|
2025-06-03 14:56:19 -04:00
|
|
|
const acceptableCamError = 5
|
2024-08-07 19:27:32 +10:00
|
|
|
const u = await getUtils(page)
|
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await test.step('Set up initial camera position', async () =>
|
|
|
|
await scene.moveCameraTo({
|
|
|
|
x: beforePosition[0],
|
|
|
|
y: beforePosition[1],
|
|
|
|
z: beforePosition[2],
|
|
|
|
}))
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await test.step('Do actions and watch for changes', async () =>
|
|
|
|
u.doAndWaitForImageDiff(async () => {
|
2024-08-07 19:27:32 +10:00
|
|
|
await mouseActions()
|
|
|
|
|
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await u.closeDebugPanel()
|
|
|
|
await page.waitForTimeout(100)
|
2025-06-03 14:56:19 -04:00
|
|
|
}, 300))
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await expect(page.getByTestId('cam-x-position')).toBeAttached()
|
|
|
|
|
|
|
|
const vals = await Promise.all([
|
|
|
|
page.getByTestId('cam-x-position').inputValue(),
|
|
|
|
page.getByTestId('cam-y-position').inputValue(),
|
|
|
|
page.getByTestId('cam-z-position').inputValue(),
|
|
|
|
])
|
|
|
|
const errors = vals.map((v, i) => Math.abs(Number(v) - afterPosition[i]))
|
|
|
|
let shouldRetry = false
|
|
|
|
|
|
|
|
if (errors.some((e) => e > acceptableCamError)) {
|
|
|
|
if (retryCount > 2) {
|
|
|
|
console.log('xVal', vals[0], 'xError', errors[0])
|
|
|
|
console.log('yVal', vals[1], 'yError', errors[1])
|
|
|
|
console.log('zVal', vals[2], 'zError', errors[2])
|
|
|
|
|
|
|
|
throw new Error('Camera position not as expected', {
|
|
|
|
cause: {
|
|
|
|
vals,
|
|
|
|
errors,
|
|
|
|
},
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
}
|
2025-06-03 14:56:19 -04:00
|
|
|
shouldRetry = true
|
2024-08-07 19:27:32 +10:00
|
|
|
}
|
2025-06-03 14:56:19 -04:00
|
|
|
if (shouldRetry) {
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions,
|
|
|
|
afterPosition: afterPosition,
|
|
|
|
beforePosition: beforePosition,
|
|
|
|
retryCount: retryCount + 1,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
}
|
2025-06-03 14:56:19 -04:00
|
|
|
}
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
test(
|
|
|
|
'Can pan and zoom camera reliably',
|
|
|
|
{
|
|
|
|
tag: '@web',
|
|
|
|
},
|
|
|
|
async ({ page, homePage, scene, cmdBar }) => {
|
|
|
|
const u = await getUtils(page)
|
|
|
|
const camInitialPosition: [number, number, number] = [0, 85, 85]
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await homePage.goToModelingScene()
|
|
|
|
await scene.settled(cmdBar)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await u.closeKclCodePanel()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await test.step('Pan', async () => {
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions: async () => {
|
|
|
|
await page.keyboard.down('Shift')
|
|
|
|
await page.mouse.move(600, 200)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
// Gotcha: remove steps:2 from this 700,200 mouse move. This bricked the test on local host engine.
|
|
|
|
await page.mouse.move(700, 200)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
await page.keyboard.up('Shift')
|
|
|
|
await page.waitForTimeout(200)
|
|
|
|
},
|
|
|
|
afterPosition: [19, 85, 85],
|
|
|
|
beforePosition: camInitialPosition,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await test.step('Zoom with click and drag', async () => {
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions: async () => {
|
|
|
|
await page.keyboard.down('Control')
|
|
|
|
await page.mouse.move(700, 400)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.mouse.move(700, 300)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
await page.keyboard.up('Control')
|
|
|
|
},
|
|
|
|
afterPosition: [0, 118, 118],
|
|
|
|
beforePosition: camInitialPosition,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await test.step('Zoom with scrollwheel', async () => {
|
|
|
|
const refreshCamValuesCmd: EngineCommand = {
|
|
|
|
type: 'modeling_cmd_req',
|
|
|
|
cmd_id: uuidv4(),
|
|
|
|
cmd: {
|
|
|
|
type: 'default_camera_get_settings',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions: async () => {
|
|
|
|
await page.mouse.move(700, 400)
|
|
|
|
await page.mouse.wheel(0, -150)
|
|
|
|
|
|
|
|
// Scroll zooming doesn't update the debug pane's cam position values,
|
|
|
|
// so we have to force a refresh.
|
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await u.sendCustomCmd(refreshCamValuesCmd)
|
|
|
|
await u.waitForCmdReceive('default_camera_get_settings')
|
|
|
|
await u.closeDebugPanel()
|
|
|
|
},
|
|
|
|
afterPosition: [0, 42.5, 42.5],
|
|
|
|
beforePosition: camInitialPosition,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
test(
|
|
|
|
'Can orbit camera reliably',
|
|
|
|
{
|
|
|
|
tag: '@web',
|
|
|
|
},
|
|
|
|
async ({ page, homePage, scene, cmdBar }) => {
|
|
|
|
const u = await getUtils(page)
|
|
|
|
const initialCamPosition: [number, number, number] = [0, 85, 85]
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-06-03 14:56:19 -04:00
|
|
|
await homePage.goToModelingScene()
|
|
|
|
// this turns on the debug pane setting as well
|
|
|
|
await scene.settled(cmdBar)
|
|
|
|
|
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await u.closeKclCodePanel()
|
|
|
|
|
|
|
|
await test.step('Test orbit with spherical mode', async () => {
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions: async () => {
|
|
|
|
await page.mouse.move(700, 200)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
|
|
|
|
const appLogoBBox = await page.getByTestId('app-logo').boundingBox()
|
|
|
|
expect(appLogoBBox).not.toBeNull()
|
|
|
|
if (!appLogoBBox) throw new Error('app logo not found')
|
|
|
|
await page.mouse.move(
|
|
|
|
appLogoBBox.x + appLogoBBox.width / 2,
|
|
|
|
appLogoBBox.y + appLogoBBox.height / 2
|
|
|
|
)
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await page.mouse.move(600, 303)
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
},
|
|
|
|
afterPosition: [-4, 10.5, 120],
|
|
|
|
beforePosition: initialCamPosition,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step('Test orbit with trackball mode', async () => {
|
|
|
|
await test.step('Set orbitMode to trackball', async () => {
|
|
|
|
await cmdBar.openCmdBar()
|
|
|
|
await cmdBar.selectOption({ name: 'camera orbit' }).click()
|
|
|
|
await cmdBar.selectOption({ name: 'trackball' }).click()
|
|
|
|
await expect(
|
|
|
|
page.getByText(`camera orbit to "trackball"`)
|
|
|
|
).toBeVisible()
|
|
|
|
})
|
|
|
|
|
|
|
|
await bakeInRetries({
|
|
|
|
mouseActions: async () => {
|
|
|
|
await page.mouse.move(700, 200)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
|
|
|
|
const appLogoBBox = await page.getByTestId('app-logo').boundingBox()
|
|
|
|
expect(appLogoBBox).not.toBeNull()
|
|
|
|
if (!appLogoBBox) {
|
|
|
|
throw new Error('app logo not found')
|
|
|
|
}
|
|
|
|
await page.mouse.move(
|
|
|
|
appLogoBBox.x + appLogoBBox.width / 2,
|
|
|
|
appLogoBBox.y + appLogoBBox.height / 2
|
|
|
|
)
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await page.mouse.move(600, 303)
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
},
|
|
|
|
afterPosition: [18.06, -42.79, 110.87],
|
|
|
|
beforePosition: initialCamPosition,
|
|
|
|
page,
|
|
|
|
scene,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
// TODO: fix after electron migration is merged
|
2025-03-20 16:28:08 -04:00
|
|
|
test('Zoom should be consistent when exiting or entering sketches', async ({
|
|
|
|
page,
|
|
|
|
homePage,
|
|
|
|
}) => {
|
|
|
|
// start new sketch pan and zoom before exiting, when exiting the sketch should stay in the same place
|
|
|
|
// than zoom and pan outside of sketch mode and enter again and it should not change from where it is
|
|
|
|
// than again for sketching
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
const u = await getUtils(page)
|
|
|
|
await page.setBodyDimensions({ width: 1200, height: 500 })
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await homePage.goToModelingScene()
|
|
|
|
await u.waitForPageLoad()
|
|
|
|
await u.openDebugPanel()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await expect(
|
|
|
|
page.getByRole('button', { name: 'Start Sketch' })
|
|
|
|
).not.toBeDisabled()
|
|
|
|
await expect(
|
|
|
|
page.getByRole('button', { name: 'Start Sketch' })
|
|
|
|
).toBeVisible()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
// click on "Start Sketch" button
|
|
|
|
await u.clearCommandLogs()
|
|
|
|
await page.getByRole('button', { name: 'Start Sketch' }).click()
|
|
|
|
await page.waitForTimeout(100)
|
2024-08-24 02:10:46 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
// select a plane
|
|
|
|
await page.mouse.click(700, 325)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-04-30 17:13:11 +12:00
|
|
|
let code = `sketch001 = startSketchOn(XY)`
|
2025-03-20 16:28:08 -04:00
|
|
|
await expect(u.codeLocator).toHaveText(code)
|
|
|
|
await u.closeDebugPanel()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
|
|
|
|
|
|
|
|
// move the camera slightly
|
|
|
|
await page.keyboard.down('Shift')
|
|
|
|
await page.mouse.move(700, 300)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.mouse.move(800, 200)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
await page.keyboard.up('Shift')
|
|
|
|
|
|
|
|
let y = 350,
|
|
|
|
x = 948
|
|
|
|
|
|
|
|
await u.canvasLocator.click({ position: { x: 783, y } })
|
2025-04-25 16:01:35 -05:00
|
|
|
code += `\n |> startProfile(at = [8.12, -12.98])`
|
2025-03-20 16:28:08 -04:00
|
|
|
// await expect(u.codeLocator).toHaveText(code)
|
|
|
|
await u.canvasLocator.click({ position: { x, y } })
|
|
|
|
code += `\n |> line(end = [11.18, 0])`
|
|
|
|
// await expect(u.codeLocator).toHaveText(code)
|
|
|
|
await u.canvasLocator.click({ position: { x, y: 275 } })
|
|
|
|
code += `\n |> line(end = [0, 6.99])`
|
|
|
|
// await expect(u.codeLocator).toHaveText(code)
|
|
|
|
|
|
|
|
// click the line button
|
|
|
|
await page.getByRole('button', { name: 'line Line', exact: true }).click()
|
|
|
|
|
|
|
|
const hoverOverNothing = async () => {
|
|
|
|
// await u.canvasLocator.hover({position: {x: 700, y: 325}})
|
|
|
|
await page.mouse.move(700, 325)
|
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await expect(page.getByTestId('hover-highlight')).not.toBeVisible({
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2025-03-20 16:28:08 -04:00
|
|
|
}
|
2024-08-16 07:15:42 -04:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await expect(page.getByTestId('hover-highlight')).not.toBeVisible()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.waitForTimeout(200)
|
|
|
|
// hover over horizontal line
|
|
|
|
await u.canvasLocator.hover({ position: { x: 800, y } })
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
|
|
|
await page.waitForTimeout(200)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
|
|
|
await page.waitForTimeout(200)
|
|
|
|
// hover over vertical line
|
|
|
|
await u.canvasLocator.hover({ position: { x, y: 325 } })
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
// click exit sketch
|
|
|
|
await page.getByRole('button', { name: 'Exit Sketch' }).click()
|
|
|
|
await page.waitForTimeout(400)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
|
|
|
await page.waitForTimeout(200)
|
|
|
|
// hover over horizontal line
|
|
|
|
await page.mouse.move(858, y, { steps: 5 })
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
// hover over vertical line
|
|
|
|
await page.mouse.move(x, 325)
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
// hover over vertical line
|
|
|
|
await page.mouse.move(857, y)
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
|
|
|
// now click it
|
|
|
|
await page.mouse.click(857, y)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await expect(
|
|
|
|
page.getByRole('button', { name: 'Edit Sketch' })
|
|
|
|
).toBeVisible()
|
|
|
|
await hoverOverNothing()
|
|
|
|
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.waitForTimeout(400)
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
x = 975
|
|
|
|
y = 468
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.waitForTimeout(100)
|
|
|
|
await page.mouse.move(x, 419, { steps: 5 })
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.mouse.move(855, y)
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
2024-08-24 02:10:46 +10:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.getByRole('button', { name: 'Exit Sketch' }).click()
|
|
|
|
await page.waitForTimeout(200)
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await hoverOverNothing()
|
|
|
|
await page.waitForTimeout(200)
|
2024-10-02 17:19:29 -04:00
|
|
|
|
2025-03-20 16:28:08 -04:00
|
|
|
await page.mouse.move(x, 419)
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
|
|
|
|
|
|
|
await hoverOverNothing()
|
|
|
|
|
|
|
|
await page.mouse.move(855, y)
|
|
|
|
await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
|
|
|
|
timeout: 10_000,
|
|
|
|
})
|
|
|
|
})
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
|
|
|
|
test(`Zoom by scroll should not fire while orbiting`, async ({
|
|
|
|
homePage,
|
|
|
|
page,
|
|
|
|
}) => {
|
2024-10-02 17:19:29 -04:00
|
|
|
/**
|
|
|
|
* Currently we only allow zooming by scroll when no other camera movement is happening,
|
|
|
|
* set within cameraMouseDragGuards in cameraControls.ts,
|
|
|
|
* until the engine supports unifying multiple camera movements.
|
|
|
|
* This verifies that scrollCallback's guard is working as expected.
|
|
|
|
*/
|
|
|
|
const u = await getUtils(page)
|
|
|
|
|
|
|
|
// Constants and locators
|
|
|
|
const settingsLink = page.getByTestId('settings-link')
|
|
|
|
const settingsDialogHeading = page.getByRole('heading', {
|
|
|
|
name: 'Settings',
|
|
|
|
exact: true,
|
|
|
|
})
|
|
|
|
const userSettingsTab = page.getByRole('radio', { name: 'User' })
|
2025-02-21 13:47:36 -05:00
|
|
|
const mouseControlsSetting = () => page.locator('#camera-controls').first()
|
2025-05-07 12:48:23 -05:00
|
|
|
const mouseControlSuccessToast = page.getByText(
|
2024-10-02 17:19:29 -04:00
|
|
|
'Set mouse controls to "Solidworks"'
|
|
|
|
)
|
|
|
|
const settingsCloseButton = page.getByTestId('settings-close-button')
|
|
|
|
const gizmo = page.locator('[aria-label*=gizmo]')
|
|
|
|
const resetCameraButton = page.getByRole('button', { name: 'Reset view' })
|
|
|
|
const orbitMouseStart = { x: 800, y: 130 }
|
|
|
|
const orbitMouseEnd = { x: 0, y: 130 }
|
|
|
|
const mid = (v1: number, v2: number) => v1 + (v2 - v1) / 2
|
|
|
|
type Point = { x: number; y: number }
|
|
|
|
const midPoint = (p1: Point, p2: Point) => ({
|
|
|
|
x: mid(p1.x, p2.x),
|
|
|
|
y: mid(p1.y, p2.y),
|
|
|
|
})
|
|
|
|
const orbitMouseStepOne = midPoint(orbitMouseStart, orbitMouseEnd)
|
|
|
|
const expectedStartCamZPosition = 64.0
|
|
|
|
const expectedZoomCamZPosition = 32.0
|
|
|
|
const expectedOrbitCamZPosition = 64.0
|
|
|
|
|
|
|
|
await test.step(`Test setup`, async () => {
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
await homePage.goToModelingScene()
|
|
|
|
await u.waitForPageLoad()
|
2024-10-02 17:19:29 -04:00
|
|
|
await u.closeKclCodePanel()
|
|
|
|
// This test requires the mouse controls to be set to Solidworks
|
|
|
|
await u.openDebugPanel()
|
|
|
|
await test.step(`Set mouse controls setting to Solidworks`, async () => {
|
|
|
|
await settingsLink.click()
|
|
|
|
await expect(settingsDialogHeading).toBeVisible()
|
|
|
|
await userSettingsTab.click()
|
2025-02-21 13:47:36 -05:00
|
|
|
const setting = mouseControlsSetting()
|
|
|
|
await expect(setting).toBeAttached()
|
|
|
|
await setting.scrollIntoViewIfNeeded()
|
|
|
|
await setting.selectOption({ label: 'Solidworks' })
|
|
|
|
await expect(setting, 'Setting value did not change').toHaveValue(
|
|
|
|
'Solidworks',
|
|
|
|
{ timeout: 120_000 }
|
|
|
|
)
|
2025-05-07 12:48:23 -05:00
|
|
|
await expect(mouseControlSuccessToast).toBeVisible()
|
2024-10-02 17:19:29 -04:00
|
|
|
await settingsCloseButton.click()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step(`Test scrolling zoom works`, async () => {
|
|
|
|
await resetCamera()
|
|
|
|
await page.mouse.move(orbitMouseStart.x, orbitMouseStart.y)
|
|
|
|
await page.mouse.wheel(0, -100)
|
|
|
|
await test.step(`Force a refresh of the camera position`, async () => {
|
|
|
|
await u.openAndClearDebugPanel()
|
|
|
|
await u.sendCustomCmd({
|
|
|
|
type: 'modeling_cmd_req',
|
|
|
|
cmd_id: uuidv4(),
|
|
|
|
cmd: {
|
|
|
|
type: 'default_camera_get_settings',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
await u.waitForCmdReceive('default_camera_get_settings')
|
|
|
|
})
|
|
|
|
|
|
|
|
await expect
|
|
|
|
.poll(getCameraZValue, {
|
|
|
|
message: 'Camera should be at expected position after zooming',
|
|
|
|
})
|
|
|
|
.toEqual(expectedZoomCamZPosition)
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step(`Test orbiting works`, async () => {
|
|
|
|
await doOrbitWith()
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step(`Test scrolling while orbiting doesn't zoom`, async () => {
|
|
|
|
await doOrbitWith(async () => {
|
|
|
|
await page.mouse.wheel(0, -100)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// Helper functions
|
|
|
|
async function resetCamera() {
|
|
|
|
await test.step(`Reset camera`, async () => {
|
|
|
|
await u.openDebugPanel()
|
|
|
|
await u.clearCommandLogs()
|
|
|
|
await u.doAndWaitForCmd(async () => {
|
|
|
|
await gizmo.click({ button: 'right' })
|
|
|
|
await resetCameraButton.click()
|
|
|
|
}, 'zoom_to_fit')
|
|
|
|
await expect
|
|
|
|
.poll(getCameraZValue, {
|
|
|
|
message: 'Camera Z should be at expected position after reset',
|
|
|
|
})
|
|
|
|
.toEqual(expectedStartCamZPosition)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
async function getCameraZValue() {
|
|
|
|
return page
|
|
|
|
.getByTestId('cam-z-position')
|
|
|
|
.inputValue()
|
|
|
|
.then((value) => parseFloat(value))
|
|
|
|
}
|
|
|
|
|
2025-06-03 18:04:35 -05:00
|
|
|
async function doOrbitWith(callback = async () => {}) {
|
2024-10-02 17:19:29 -04:00
|
|
|
await resetCamera()
|
|
|
|
|
|
|
|
await test.step(`Perform orbit`, async () => {
|
|
|
|
await page.mouse.move(orbitMouseStart.x, orbitMouseStart.y)
|
|
|
|
await page.mouse.down({ button: 'middle' })
|
|
|
|
await page.mouse.move(orbitMouseStepOne.x, orbitMouseStepOne.y, {
|
|
|
|
steps: 3,
|
|
|
|
})
|
|
|
|
await callback()
|
|
|
|
await page.mouse.move(orbitMouseEnd.x, orbitMouseEnd.y, {
|
|
|
|
steps: 3,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step(`Verify orbit`, async () => {
|
|
|
|
await expect
|
|
|
|
.poll(getCameraZValue, {
|
|
|
|
message: 'Camera should be at expected position after orbiting',
|
|
|
|
})
|
|
|
|
.toEqual(expectedOrbitCamZPosition)
|
|
|
|
await page.mouse.up({ button: 'middle' })
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
2024-12-11 12:57:38 -05:00
|
|
|
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
test('Right-click opens context menu when not dragged', async ({
|
|
|
|
homePage,
|
|
|
|
page,
|
|
|
|
}) => {
|
2024-12-11 12:57:38 -05:00
|
|
|
const u = await getUtils(page)
|
Move all tests over to electron (#4484)
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* One last try with window-16-cores
* Trigger CI
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Skip more win tests, add back all three oses
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* Add two more fixmes
* 2 more fixmes
* skip segment overlays on win32
* Another fixme
* Trigger CI
* Trigger CI
* Quick clean up
* Move all tests over to electron
* Pass the correct param to playwright-electron.sh
* Add shebang to script and add macos-14-large as a target
* Get sketch-tests.spec.ts passing in electron
* Try out 4 workers
* Got testing-segment-overlays passing
* Pass testing-selections.spec.ts
* Go back to fix up sketch-tests test
* Pass various.spec.ts, by far the hardest one
* Pass can-sketch-on-all-planes... with ease
* Pass command bar tests
* fmt
* Completely fix code mirror text navigating for tests
* Pass debug pane tests
* Pass desktop export tests
* Pass editor tests
* Pass file tree tests
* Pass onboarding tests
* Corrected a fixme in file-tree.spec!
* Painfully fix hardcoded coordinates in point-click.spec
* Pass machine.spec tests
* Pass projects, fought hard with filechooser
* Pass regresion-tests.spec tests
* Pass network and connection tests
* Pass camera-movement.spec tests
* Extreme time eaten by gizmo test fixes. All passing now.
* Merge main (tests changed x_x) and pass all constraints.spec tests (pain)
* Pass another painful spec suite: testing-settings
* Pass perspective-toggle, interesting note
* Pass samples loading tests
* Pass app header tests
* Pass text-to-cad tests
* Pass segment-overlays (minor ache) and ability to switch to web if needed :)
* Fix a ton of syntax changes and deflake 2 more tests (pain)
* Correct all tsc errors
* Remove to-electron script
* Add an f-ton of shit because playwright doesnt want S P R E A D
* Try CI again
* Stop snapshots of exports (already test in e2e)
* Fix flake in double click editor
* Hopefully help CI flake
* Fixmes, fixmes everywhere
* One more fixme to settings
* Skip another code pane flake
* Port jess's projects.spec tests
* fixup
* Reuse electron window; difficult task
* Rebased and refixed
* Remove duplicate cases
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* Reduce the workers to something CI can handle
* Lower it further, we need to think about the others
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update package.json
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Fix the last tests and tsc errors
* Timeout to 120 and windows-2022-16core
* Fix windows runner detection, enable concurrency temporarily
* Hopefully this time fix windows runner detection
* Comment out Vector, add back removed camera test code
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Fix camera tests again
* Massively deflake a whole class of tests
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: macos-14-large)
* Try new CI and fix small onboarding test
* Derp
* No github tuning
* Try mac
* Add back all the OS
* Lord, hallow be thy name
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)
* Try AWS Windows runner
* Passing on windows locally with a few skips
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* fmt, tsc, lint
* Enable two fixmes again
* Fix lint, codespell, fmt
* Fix lint
* Don't run e2e on draft, add back concurrency, clean up
* One last windows skip
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2024-12-18 17:58:03 -05:00
|
|
|
|
|
|
|
await homePage.goToModelingScene()
|
|
|
|
await u.waitForPageLoad()
|
2024-12-11 12:57:38 -05:00
|
|
|
|
|
|
|
await test.step(`The menu should not show if we drag the mouse`, async () => {
|
|
|
|
await page.mouse.move(900, 200)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.mouse.move(900, 300)
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
|
|
|
|
await expect(page.getByTestId('view-controls-menu')).not.toBeVisible()
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step(`The menu should show if we don't drag the mouse`, async () => {
|
|
|
|
await page.mouse.move(900, 200)
|
|
|
|
await page.mouse.down({ button: 'right' })
|
|
|
|
await page.mouse.up({ button: 'right' })
|
|
|
|
|
|
|
|
await expect(page.getByTestId('view-controls-menu')).toBeVisible()
|
|
|
|
})
|
|
|
|
})
|
2024-08-07 19:27:32 +10:00
|
|
|
})
|