Opt-in tests that cover Windows-specific capabilities (#6489)

* Opt-in tests that cover Windows-specific capabilities

* Remove unnecessary quotes
This commit is contained in:
Jace Browning
2025-04-24 20:50:26 -04:00
committed by GitHub
parent 6001b71f06
commit bff13f6bfe
22 changed files with 3780 additions and 3730 deletions

View File

@ -155,7 +155,7 @@ async function doBasicSketch(
|> xLine(length = -segLen(seg01))`) |> xLine(length = -segLen(seg01))`)
} }
test.describe('Basic sketch', { tag: ['@skipWin'] }, () => { test.describe('Basic sketch', () => {
test('code pane open at start', async ({ page, homePage }) => { test('code pane open at start', async ({ page, homePage }) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
await doBasicSketch(page, homePage, ['code']) await doBasicSketch(page, homePage, ['code'])

View File

@ -8,10 +8,7 @@ import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
import { getUtils } from '@e2e/playwright/test-utils' import { getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe( test.describe('Can create sketches on all planes and their back sides', () => {
'Can create sketches on all planes and their back sides',
{ tag: ['@skipWin'] },
() => {
const sketchOnPlaneAndBackSideTest = async ( const sketchOnPlaneAndBackSideTest = async (
page: Page, page: Page,
homePage: HomePageFixture, homePage: HomePageFixture,
@ -133,5 +130,4 @@ test.describe(
) )
}) })
} }
} })
)

View File

@ -10,7 +10,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Code pane and errors', { tag: ['@skipWin'] }, () => { test.describe('Code pane and errors', () => {
test('Typing KCL errors induces a badge on the code pane button', async ({ test('Typing KCL errors induces a badge on the code pane button', async ({
page, page,
homePage, homePage,

View File

@ -9,7 +9,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Command bar tests', { tag: ['@skipWin'] }, () => { test.describe('Command bar tests', () => {
test('Extrude from command bar selects extrude line after', async ({ test('Extrude from command bar selects extrude line after', async ({
page, page,
homePage, homePage,
@ -179,10 +179,10 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
await expect(commandLevelArgButton).toHaveText('level: project') await expect(commandLevelArgButton).toHaveText('level: project')
}) })
test( test('Command bar keybinding works from code editor and can change a setting', async ({
'Command bar keybinding works from code editor and can change a setting', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage }) => { }) => {
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
@ -217,9 +217,10 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
await page.keyboard.press('ArrowDown') await page.keyboard.press('ArrowDown')
await page.keyboard.press('ArrowDown') await page.keyboard.press('ArrowDown')
await page.keyboard.press('ArrowDown') await page.keyboard.press('ArrowDown')
await expect( await expect(page.getByRole('option', { name: 'system' })).toHaveAttribute(
page.getByRole('option', { name: 'system' }) 'data-headlessui-state',
).toHaveAttribute('data-headlessui-state', 'active') 'active'
)
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Check the toast appeared // Check the toast appeared
@ -228,8 +229,7 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
).toBeVisible() ).toBeVisible()
// Check that the theme changed // Check that the theme changed
await expect(page.locator('body')).not.toHaveClass(`body-bg dark`) await expect(page.locator('body')).not.toHaveClass(`body-bg dark`)
} })
)
test('Can extrude from the command bar', async ({ test('Can extrude from the command bar', async ({
page, page,

View File

@ -10,7 +10,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
test( test(
'export works on the first try', 'export works on the first try',
{ tag: ['@electron', '@macOS', '@skipLocalEngine'] }, { tag: ['@electron', '@macos', '@windows', '@skipLocalEngine'] },
async ({ page, context, scene, tronApp, cmdBar }, testInfo) => { async ({ page, context, scene, tronApp, cmdBar }, testInfo) => {
if (!tronApp) { if (!tronApp) {
fail() fail()

View File

@ -10,7 +10,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Editor tests', { tag: ['@skipWin'] }, () => { test.describe('Editor tests', () => {
test('can comment out code with ctrl+/', async ({ page, homePage }) => { test('can comment out code with ctrl+/', async ({ page, homePage }) => {
const u = await getUtils(page) const u = await getUtils(page)
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -989,10 +989,11 @@ sketch001 = startSketchOn(XZ)
|> close()`) |> close()`)
}) })
test( test('Can undo a sketch modification with ctrl+z', async ({
'Can undo a sketch modification with ctrl+z', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage, editor }) => { editor,
}) => {
const u = await getUtils(page) const u = await getUtils(page)
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
@ -1143,8 +1144,7 @@ sketch001 = startSketchOn(XZ)
|> extrude(length = 5)`, |> extrude(length = 5)`,
{ shouldNormalise: true } { shouldNormalise: true }
) )
} })
)
test( test(
`Can import a local OBJ file`, `Can import a local OBJ file`,

View File

@ -41,7 +41,7 @@ class MyAPIReporter implements Reporter {
annotations: test.annotations.map((a) => a.type), // e.g. 'fail' or 'fixme' annotations: test.annotations.map((a) => a.type), // e.g. 'fail' or 'fixme'
id: test.id, // computed file/test/project ID used for reruns id: test.id, // computed file/test/project ID used for reruns
retry: result.retry, retry: result.retry,
tags: test.tags, // e.g. '@snapshot' or '@skipWin' tags: test.tags, // e.g. '@snapshot' or '@skipLocalEngine'
// Extra environment variables // Extra environment variables
CI_COMMIT_SHA: process.env.CI_COMMIT_SHA || null, CI_COMMIT_SHA: process.env.CI_COMMIT_SHA || null,
CI_PR_NUMBER: process.env.CI_PR_NUMBER || null, CI_PR_NUMBER: process.env.CI_PR_NUMBER || null,

View File

@ -6,7 +6,10 @@ import { expect, test } from '@e2e/playwright/zoo-test'
* Not all menu actions are tested. Some are default electron menu actions. * Not all menu actions are tested. Some are default electron menu actions.
* Test file menu actions that trigger something in the frontend * Test file menu actions that trigger something in the frontend
*/ */
test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => { test.describe(
'Native file menu',
{ tag: ['@electron', '@macos', '@windows'] },
() => {
test.skip() // TODO: Reimplement native file menu tests test.skip() // TODO: Reimplement native file menu tests
test.describe('Home page', () => { test.describe('Home page', () => {
test.describe('File role', () => { test.describe('File role', () => {
@ -161,7 +164,11 @@ test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => {
const defaultUnit = settings.locator('#defaultUnit') const defaultUnit = settings.locator('#defaultUnit')
await expect(defaultUnit).toBeVisible() await expect(defaultUnit).toBeVisible()
}) })
test('Home.File.Preferences.Theme', async ({ tronApp, cmdBar, page }) => { test('Home.File.Preferences.Theme', async ({
tronApp,
cmdBar,
page,
}) => {
if (!tronApp) fail() if (!tronApp) fail()
// Run electron snippet to find the Menu! // Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
@ -365,7 +372,11 @@ test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => {
}) })
}) })
test.describe('Help role', () => { test.describe('Help role', () => {
test('Home.Help.Show all commands', async ({ tronApp, cmdBar, page }) => { test('Home.Help.Show all commands', async ({
tronApp,
cmdBar,
page,
}) => {
if (!tronApp) fail() if (!tronApp) fail()
// Run electron snippet to find the Menu! // Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
@ -389,7 +400,11 @@ test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => {
const actual = cmdBar.cmdBarElement.getByTestId('cmd-bar-search') const actual = cmdBar.cmdBarElement.getByTestId('cmd-bar-search')
await expect(actual).toBeVisible() await expect(actual).toBeVisible()
}) })
test('Home.Help.KCL code samples', async ({ tronApp, cmdBar, page }) => { test('Home.Help.KCL code samples', async ({
tronApp,
cmdBar,
page,
}) => {
if (!tronApp) fail() if (!tronApp) fail()
// Run electron snippet to find the Menu! // Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
@ -435,7 +450,11 @@ test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => {
) )
await expect(actual).toBeVisible() await expect(actual).toBeVisible()
}) })
test('Home.Help.Reset onboarding', async ({ tronApp, cmdBar, page }) => { test('Home.Help.Reset onboarding', async ({
tronApp,
cmdBar,
page,
}) => {
if (!tronApp) fail() if (!tronApp) fail()
// Run electron snippet to find the Menu! // Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
@ -2354,4 +2373,5 @@ test.describe('Native file menu', { tag: ['@electron', '@macOS'] }, () => {
}) })
}) })
}) })
}) }
)

View File

@ -18,7 +18,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
test( test(
'projects reload if a new one is created, deleted, or renamed externally', 'projects reload if a new one is created, deleted, or renamed externally',
{ tag: ['@electron', '@macOS'] }, { tag: ['@electron', '@macos', '@windows'] },
async ({ context, page }, testInfo) => { async ({ context, page }, testInfo) => {
let externalCreatedProjectName = 'external-created-project' let externalCreatedProjectName = 'external-created-project'

View File

@ -29,7 +29,7 @@ sketch003 = startSketchOn(XY)
extrude003 = extrude(sketch003, length = 20) extrude003 = extrude(sketch003, length = 20)
` `
test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => { test.describe('Prompt-to-edit tests', () => {
test.describe('Check the happy path, for basic changing color', () => { test.describe('Check the happy path, for basic changing color', () => {
const cases = [ const cases = [
{ {

View File

@ -14,7 +14,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Regression tests', { tag: ['@skipWin'] }, () => { test.describe('Regression tests', () => {
// bugs we found that don't fit neatly into other categories // bugs we found that don't fit neatly into other categories
test('bad model has inline error #3251', async ({ test('bad model has inline error #3251', async ({
context, context,
@ -239,10 +239,11 @@ extrude001 = extrude(sketch001, length = 50)
await expect(zooLogo).not.toHaveAttribute('href') await expect(zooLogo).not.toHaveAttribute('href')
}) })
test( test('Position _ Is Out Of Range... regression test', async ({
'Position _ Is Out Of Range... regression test', context,
{ tag: ['@skipWin'] }, page,
async ({ context, page, homePage }) => { homePage,
}) => {
const u = await getUtils(page) const u = await getUtils(page)
// const PUR = 400 / 37.5 //pixeltoUnitRatio // const PUR = 400 / 37.5 //pixeltoUnitRatio
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
@ -315,8 +316,7 @@ extrude001 = extrude(sketch001, length = 50)
thing: "blah"`) thing: "blah"`)
await expect(page.locator('.cm-lint-marker-error')).toBeVisible() await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
} })
)
test( test(
'window resize updates should reconfigure the stream', 'window resize updates should reconfigure the stream',
@ -486,10 +486,10 @@ extrude002 = extrude(profile002, length = 150)
} }
) )
// We updated this test such that you can have multiple exports going at once. // We updated this test such that you can have multiple exports going at once.
test( test('ensure you CAN export while an export is already going', async ({
'ensure you CAN export while an export is already going', page,
{ tag: ['@skipLinux', '@skipWin'] }, homePage,
async ({ page, homePage }) => { }) => {
const u = await getUtils(page) const u = await getUtils(page)
await test.step('Set up the code and durations', async () => { await test.step('Set up the code and durations', async () => {
await page.addInitScript( await page.addInitScript(
@ -560,8 +560,7 @@ extrude002 = extrude(profile002, length = 150)
await expect(successToastMessage).toHaveCount(2) await expect(successToastMessage).toHaveCount(2)
}) })
} })
)
test( test(
`Network health indicator only appears in modeling view`, `Network health indicator only appears in modeling view`,

View File

@ -16,7 +16,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Sketch tests', { tag: ['@skipWin'] }, () => { test.describe('Sketch tests', () => {
test('multi-sketch file shows multiple Edit Sketch buttons', async ({ test('multi-sketch file shows multiple Edit Sketch buttons', async ({
page, page,
context, context,
@ -393,10 +393,13 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|> close() |> close()
`) `)
} }
test( test('code pane open at start-handles', async ({
'code pane open at start-handles', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage, scene, toolbar, cmdBar }) => { scene,
toolbar,
cmdBar,
}) => {
// Load the app with the code panes // Load the app with the code panes
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
@ -417,13 +420,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
toolbar, toolbar,
cmdBar cmdBar
) )
} })
)
test( test('code pane closed at start-handles', async ({
'code pane closed at start-handles', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage, scene, toolbar, cmdBar }) => { scene,
toolbar,
cmdBar,
}) => {
// Load the app with the code panes // Load the app with the code panes
await page.addInitScript(async (persistModelingContext) => { await page.addInitScript(async (persistModelingContext) => {
localStorage.setItem( localStorage.setItem(
@ -439,8 +444,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
toolbar, toolbar,
cmdBar cmdBar
) )
} })
)
}) })
test('Can edit a circle center and radius by dragging its handles', async ({ test('Can edit a circle center and radius by dragging its handles', async ({
@ -1389,10 +1393,15 @@ offsetPlane001 = offsetPlane(XY, offset = 10)`
}) })
test.describe('multi-profile sketching', () => { test.describe('multi-profile sketching', () => {
test( test(`test it removes half-finished expressions when changing tools in sketch mode`, async ({
`test it removes half-finished expressions when changing tools in sketch mode`, context,
{ tag: ['@skipWin'] }, page,
async ({ context, page, scene, toolbar, editor, homePage, cmdBar }) => { scene,
toolbar,
editor,
homePage,
cmdBar,
}) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
// We seed the scene with a single offset plane // We seed the scene with a single offset plane
await context.addInitScript(() => { await context.addInitScript(() => {
@ -1461,9 +1470,7 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
await test.step('equip line tool and verify three-point circle code is removed', async () => { await test.step('equip line tool and verify three-point circle code is removed', async () => {
await toolbar.lineBtn.click() await toolbar.lineBtn.click()
await editor.expectEditor.not.toContain( await editor.expectEditor.not.toContain('profile003 = circleThreePoint(')
'profile003 = circleThreePoint('
)
}) })
await test.step('equip three-point-arc tool and click first two points', async () => { await test.step('equip three-point-arc tool and click first two points', async () => {
@ -1520,12 +1527,16 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
await editor.expectEditor.not.toContain('arc(') await editor.expectEditor.not.toContain('arc(')
await editor.expectEditor.toContain('profile002') await editor.expectEditor.toContain('profile002')
}) })
} })
) test(`snapToProfile start only works for current profile`, async ({
test( context,
`snapToProfile start only works for current profile`, page,
{ tag: ['@skipWin'] }, scene,
async ({ context, page, scene, toolbar, editor, homePage, cmdBar }) => { toolbar,
editor,
homePage,
cmdBar,
}) => {
// We seed the scene with a single offset plane // We seed the scene with a single offset plane
await context.addInitScript(() => { await context.addInitScript(() => {
localStorage.setItem( localStorage.setItem(
@ -1604,8 +1615,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
`[profileStartX(%), profileStartY(%)]` `[profileStartX(%), profileStartY(%)]`
) )
}) })
} })
)
test('can enter sketch mode for sketch with no profiles', async ({ test('can enter sketch mode for sketch with no profiles', async ({
scene, scene,
toolbar, toolbar,
@ -2071,10 +2081,13 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
}) })
}) })
test( test('Can edit a sketch with multiple profiles, dragging segments to edit them, and adding one new profile', async ({
'Can edit a sketch with multiple profiles, dragging segments to edit them, and adding one new profile', homePage,
{ tag: ['@skipWin'] }, scene,
async ({ homePage, scene, toolbar, editor, page }) => { toolbar,
editor,
page,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2204,12 +2217,15 @@ profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07]
|> close()`.replaceAll('\n', '') |> close()`.replaceAll('\n', '')
) )
}) })
} })
) test('Can delete a profile in the editor while is sketch mode, and sketch mode does not break, can ctrl+z to undo after constraint with variable was added', async ({
test( scene,
'Can delete a profile in the editor while is sketch mode, and sketch mode does not break, can ctrl+z to undo after constraint with variable was added', toolbar,
{ tag: ['@skipWin', '@skipLinux'] }, editor,
async ({ scene, toolbar, editor, cmdBar, page, homePage }) => { cmdBar,
page,
homePage,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2303,13 +2319,15 @@ profile003 = circle(sketch001, center = [6.92, -4.2], radius = 3.16)
await editor.expectEditor.not.toContain('length001 = 7') await editor.expectEditor.not.toContain('length001 = 7')
await sketchIsDrawnProperly() await sketchIsDrawnProperly()
}) })
} })
)
test( test('can enter sketch when there is an extrude', async ({
'can enter sketch when there is an extrude', homePage,
{ tag: ['@skipWin'] }, scene,
async ({ homePage, scene, toolbar, page, cmdBar }) => { toolbar,
page,
cmdBar,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2361,8 +2379,7 @@ extrude001 = extrude(profile003, length = 5)
scene.expectPixelColor(TEST_COLORS.WHITE, { x: 763, y: 214 }, 15), scene.expectPixelColor(TEST_COLORS.WHITE, { x: 763, y: 214 }, 15),
]) ])
}) })
} })
)
test('exit new sketch without drawing anything should not be a problem', async ({ test('exit new sketch without drawing anything should not be a problem', async ({
homePage, homePage,
scene, scene,
@ -2416,10 +2433,13 @@ extrude001 = extrude(profile003, length = 5)
await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15) await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15)
}) })
}) })
test( test('A sketch with only "startProfileAt" and no segments should still be able to be continued', async ({
'A sketch with only "startProfileAt" and no segments should still be able to be continued', homePage,
{ tag: ['@skipWin'] }, scene,
async ({ homePage, scene, toolbar, editor, page }) => { toolbar,
editor,
page,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2457,12 +2477,14 @@ profile002 = startProfileAt([85.81, 52.55], sketch002)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await nextPoint() await nextPoint()
await editor.expectEditor.toContain(`|> line(end = [126.05, 44.12])`) await editor.expectEditor.toContain(`|> line(end = [126.05, 44.12])`)
} })
) test('old style sketch all in one pipe (with extrude) will break up to allow users to add a new profile to the same sketch', async ({
test( homePage,
'old style sketch all in one pipe (with extrude) will break up to allow users to add a new profile to the same sketch', scene,
{ tag: ['@skipWin'] }, toolbar,
async ({ homePage, scene, toolbar, editor, page }) => { editor,
page,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2517,12 +2539,15 @@ extrude001 = extrude(thePart, length = 75)
await profilePoint2() await profilePoint2()
await editor.expectEditor.toContain(`|> line(end = [18.97, -18.06])`) await editor.expectEditor.toContain(`|> line(end = [18.97, -18.06])`)
}) })
} })
) test('Can enter sketch on sketch of wall and cap for segment, solid2d, extrude-wall, extrude-cap selections', async ({
test( homePage,
'Can enter sketch on sketch of wall and cap for segment, solid2d, extrude-wall, extrude-cap selections', scene,
{ tag: ['@skipWin'] }, toolbar,
async ({ homePage, scene, toolbar, editor, page, cmdBar }) => { editor,
page,
cmdBar,
}) => {
// TODO this test should include a test for selecting revolve walls and caps // TODO this test should include a test for selecting revolve walls and caps
await page.addInitScript(async () => { await page.addInitScript(async () => {
@ -2681,12 +2706,14 @@ extrude003 = extrude(profile011, length = 2.5)
}) })
} }
}) */ }) */
} })
) test('Can enter sketch loft edges, base and continue sketch', async ({
test( homePage,
'Can enter sketch loft edges, base and continue sketch', scene,
{ tag: ['@skipWin'] }, toolbar,
async ({ homePage, scene, toolbar, editor, page }) => { editor,
page,
}) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -2736,8 +2763,7 @@ loft([profile001, profile002])
await editor.expectEditor.toContain( await editor.expectEditor.toContain(
`angledLine(angle = 0, length = 113.01, tag = $rectangleSegmentA001)` `angledLine(angle = 0, length = 113.01, tag = $rectangleSegmentA001)`
) )
} })
)
test('Can enter sketch loft edges offsetPlane and continue sketch', async ({ test('Can enter sketch loft edges offsetPlane and continue sketch', async ({
scene, scene,
toolbar, toolbar,
@ -3245,10 +3271,15 @@ profile003 = startProfileAt([-201.08, 254.17], sketch002)
).toBeVisible() ).toBeVisible()
}) })
}) })
test( test('adding a syntax error, recovers after fixing', async ({
'adding a syntax error, recovers after fixing', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage, context, scene, editor, toolbar, cmdBar }) => { context,
scene,
editor,
toolbar,
cmdBar,
}) => {
const file = await fs.readFile( const file = await fs.readFile(
path.resolve( path.resolve(
__dirname, __dirname,
@ -3335,6 +3366,5 @@ profile003 = startProfileAt([-201.08, 254.17], sketch002)
15 15
) )
}) })
} })
)
}) })

View File

@ -47,7 +47,7 @@ test.setTimeout(60_000)
// up with another PR if we want this back. // up with another PR if we want this back.
test( test(
'exports of each format should work', 'exports of each format should work',
{ tag: ['@snapshot', '@skipWin', '@skipMacos'] }, { tag: ['@snapshot'] },
async ({ page, context, scene, cmdBar, tronApp }) => { async ({ page, context, scene, cmdBar, tronApp }) => {
if (!tronApp) { if (!tronApp) {
fail() fail()

View File

@ -8,9 +8,12 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Test network and connection issues', { test.describe(
tag: ['@macOS'], 'Test network and connection issues',
}, () => { {
tag: ['@macos', '@windows'],
},
() => {
test( test(
'simulate network down and network little widget', 'simulate network down and network little widget',
{ tag: '@skipLocalEngine' }, { tag: '@skipLocalEngine' },
@ -186,7 +189,9 @@ test.describe('Test network and connection issues', {
await toolbar.editSketch() await toolbar.editSketch()
// Click the line tool // Click the line tool
await page.getByRole('button', { name: 'line Line', exact: true }).click() await page
.getByRole('button', { name: 'line Line', exact: true })
.click()
await page.waitForTimeout(150) await page.waitForTimeout(150)
@ -256,4 +261,5 @@ profile001 = startProfileAt([12.34, -12.34], sketch001)
).not.toBeVisible() ).not.toBeVisible()
} }
) )
}) }
)

View File

@ -4,7 +4,7 @@ import { uuidv4 } from '@src/lib/utils'
import { getUtils, orRunWhenFullSuiteEnabled } from '@e2e/playwright/test-utils' import { getUtils, orRunWhenFullSuiteEnabled } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Testing Camera Movement', { tag: ['@skipWin'] }, () => { test.describe('Testing Camera Movement', () => {
test('Can move camera reliably', async ({ test('Can move camera reliably', async ({
page, page,
context, context,

View File

@ -10,7 +10,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { test.describe('Testing constraints', () => {
test('Can constrain line length', async ({ page, homePage }) => { test('Can constrain line length', async ({ page, homePage }) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(

View File

@ -4,7 +4,7 @@ import { TEST_CODE_GIZMO } from '@e2e/playwright/storageStates'
import { getUtils } from '@e2e/playwright/test-utils' import { getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Testing Gizmo', { tag: ['@skipWin'] }, () => { test.describe('Testing Gizmo', () => {
const cases = [ const cases = [
{ {
testDescription: 'top view', testDescription: 'top view',

View File

@ -11,7 +11,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { test.describe('Testing segment overlays', () => {
test('Hover over a segment should show its overlay, hovering over the input overlays should show its popover, clicking the input overlay should constrain/unconstrain it:\nfor the following segments', () => { test('Hover over a segment should show its overlay, hovering over the input overlays should show its popover, clicking the input overlay should constrain/unconstrain it:\nfor the following segments', () => {
// TODO: fix this test on mac after the electron migration // TODO: fix this test on mac after the electron migration
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())

View File

@ -9,7 +9,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Testing selections', { tag: ['@skipWin'] }, () => { test.describe('Testing selections', () => {
test.setTimeout(90_000) test.setTimeout(90_000)
test('Selections work on fresh and edited sketch', async ({ test('Selections work on fresh and edited sketch', async ({
page, page,

View File

@ -29,7 +29,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
test.describe( test.describe(
'Testing settings', 'Testing settings',
{ {
tag: ['@macOS'], tag: ['@macos', '@windows'],
}, },
() => { () => {
test('Stored settings are validated and fall back to defaults', async ({ test('Stored settings are validated and fall back to defaults', async ({
@ -281,7 +281,7 @@ test.describe(
test( test(
`Project settings override user settings on desktop`, `Project settings override user settings on desktop`,
{ tag: ['@electron', '@skipWin'] }, { tag: ['@electron'] },
async ({ context, page }, testInfo) => { async ({ context, page }, testInfo) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
const projectName = 'bracket' const projectName = 'bracket'

View File

@ -9,7 +9,7 @@ import {
} from '@e2e/playwright/test-utils' } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
test.describe('Text-to-CAD tests', { tag: ['@skipWin'] }, () => { test.describe('Text-to-CAD tests', () => {
test('basic lego happy case', async ({ page, homePage }) => { test('basic lego happy case', async ({ page, homePage }) => {
const u = await getUtils(page) const u = await getUtils(page)
@ -436,10 +436,10 @@ test.describe('Text-to-CAD tests', { tag: ['@skipWin'] }, () => {
}) })
// This will be fine once greg makes prompt at top of file deterministic // This will be fine once greg makes prompt at top of file deterministic
test( test('can do many at once and get many prompts back, and interact with many', async ({
'can do many at once and get many prompts back, and interact with many', page,
{ tag: ['@skipWin'] }, homePage,
async ({ page, homePage }) => { }) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
// Let this test run longer since we've seen it timeout. // Let this test run longer since we've seen it timeout.
test.setTimeout(180_000) test.setTimeout(180_000)
@ -521,8 +521,7 @@ test.describe('Text-to-CAD tests', { tag: ['@skipWin'] }, () => {
// Expect the code to be pasted. // Expect the code to be pasted.
const code2x4 = await page.locator('.cm-content').innerText() const code2x4 = await page.locator('.cm-content').innerText()
await expect(code2x4.length).toBeGreaterThan(249) await expect(code2x4.length).toBeGreaterThan(249)
} })
)
test('can do many at once with errors, clicking dismiss error does not dismiss all', async ({ test('can do many at once with errors, clicking dismiss error does not dismiss all', async ({
page, page,

View File

@ -126,7 +126,7 @@
"generate:machine-api": "npx openapi-typescript ./openapi/machine-api.json -o src/lib/machine-api.d.ts", "generate:machine-api": "npx openapi-typescript ./openapi/machine-api.json -o src/lib/machine-api.d.ts",
"generate:samples-manifest": "cd public/kcl-samples && node generate-manifest.js", "generate:samples-manifest": "cd public/kcl-samples && node generate-manifest.js",
"tron:start": "electron-forge start", "tron:start": "electron-forge start",
"chrome:test": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --project='Google Chrome' --grep-invert='@snapshot'", "chrome:test": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --project='Google Chrome' --grep-invert=@snapshot",
"tronb:vite:dev": "vite build -c vite.main.config.ts -m development && vite build -c vite.preload.config.ts -m development && vite build -c vite.renderer.config.ts -m development", "tronb:vite:dev": "vite build -c vite.main.config.ts -m development && vite build -c vite.preload.config.ts -m development && vite build -c vite.renderer.config.ts -m development",
"tronb:vite:prod": "vite build -c vite.main.config.ts && vite build -c vite.preload.config.ts && vite build -c vite.renderer.config.ts", "tronb:vite:prod": "vite build -c vite.main.config.ts && vite build -c vite.preload.config.ts && vite build -c vite.renderer.config.ts",
"tronb:package:dev": "npm run tronb:vite:dev && electron-builder --config electron-builder.yml", "tronb:package:dev": "npm run tronb:vite:dev && electron-builder --config electron-builder.yml",
@ -136,15 +136,15 @@
"test:snapshots": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --grep=@snapshot --trace=on --shard=1/1", "test:snapshots": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --grep=@snapshot --trace=on --shard=1/1",
"test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts", "test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts",
"test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts", "test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts",
"test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot'", "test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:windows": "playwright test --config=playwright.electron.config.ts --grep-invert=\"@skipWin|@snapshot\" --quiet", "test:playwright:electron:windows": "playwright test --config=playwright.electron.config.ts --grep=@windows --quiet",
"test:playwright:electron:macos": "playwright test --config=playwright.electron.config.ts --grep='@macOS' --quiet", "test:playwright:electron:macos": "playwright test --config=playwright.electron.config.ts --grep=@macos --quiet",
"test:playwright:electron:ubuntu": "playwright test --config=playwright.electron.config.ts --grep-invert='@skipLinux|@snapshot' --quiet", "test:playwright:electron:ubuntu": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot --quiet",
"test:playwright:electron:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot'", "test:playwright:electron:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:windows:local": "npm run tronb:vite:dev && set NODE_ENV='development' && playwright test --config=playwright.electron.config.ts --grep-invert=\"@skipWin|@snapshot\"", "test:playwright:electron:windows:local": "npm run tronb:vite:dev && set NODE_ENV='development' && playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:macos:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@skipMacos|@snapshot'", "test:playwright:electron:macos:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:ubuntu:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@skipLinux|@snapshot'", "test:playwright:electron:ubuntu:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:ubuntu:engine:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@skipLinux|@snapshot|@skipLocalEngine'", "test:playwright:electron:ubuntu:engine:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot|@skipLocalEngine",
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000", "test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000",
"test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000" "test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000"
}, },