Fix more tests
This commit is contained in:
@ -46,8 +46,6 @@ test.describe('Point and click for boolean workflows', () => {
|
||||
localStorage.setItem('persistCode', file)
|
||||
}, file)
|
||||
await homePage.goToModelingScene()
|
||||
await scene.waitForExecutionDone()
|
||||
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
// Test coordinates for selection - these might need adjustment based on actual scene layout
|
||||
|
@ -78,12 +78,12 @@ sketch001 = startSketchOn(XY)
|
||||
|
||||
// Ensure we execute the first time.
|
||||
await u.openDebugPanel()
|
||||
await expect(
|
||||
page.locator('[data-receive-command-type="scene_clear_all"]')
|
||||
).toHaveCount(1)
|
||||
await expect(
|
||||
page.locator('[data-message-type="execution-done"]')
|
||||
).toHaveCount(1)
|
||||
await expect.poll(() =>
|
||||
page.locator('[data-receive-command-type="scene_clear_all"]').count()
|
||||
).toBe(2)
|
||||
await expect.poll(() =>
|
||||
page.locator('[data-message-type="execution-done"]').count()
|
||||
).toBe(2)
|
||||
|
||||
// Add whitespace to the end of the code.
|
||||
await u.codeLocator.click()
|
||||
@ -131,7 +131,7 @@ sketch001 = startSketchOn(XY)
|
||||
await u.openDebugPanel()
|
||||
await expect(
|
||||
page.locator('[data-receive-command-type="scene_clear_all"]')
|
||||
).toHaveCount(1)
|
||||
).toHaveCount(2)
|
||||
await expect(
|
||||
page.locator('[data-message-type="execution-done"]')
|
||||
).toHaveCount(2)
|
||||
@ -159,7 +159,7 @@ sketch001 = startSketchOn(XY)
|
||||
).toHaveCount(3)
|
||||
await expect(
|
||||
page.locator('[data-receive-command-type="scene_clear_all"]')
|
||||
).toHaveCount(1)
|
||||
).toHaveCount(2)
|
||||
})
|
||||
|
||||
test('if you click the format button it formats your code', async ({
|
||||
|
@ -90,7 +90,7 @@ test.describe('Feature Tree pane', () => {
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
await toolbar.openFeatureTreePane()
|
||||
await expect(page.getByText('Feature tree')).toBeVisible()
|
||||
await expect.poll(() => page.getByText('Feature tree').count()).toBeGreaterThan(1)
|
||||
})
|
||||
|
||||
async function testViewSource({
|
||||
|
@ -1525,7 +1525,7 @@ extrude001 = extrude(sketch001, length = 200)`)
|
||||
test(
|
||||
'Opening a project should successfully load the stream, (regression test that this also works when switching between projects)',
|
||||
{ tag: '@electron' },
|
||||
async ({ context, page, cmdBar, homePage }, testInfo) => {
|
||||
async ({ context, page, cmdBar, homePage, scene }, testInfo) => {
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
await fsp.mkdir(path.join(dir, 'router-template-slate'), {
|
||||
recursive: true,
|
||||
@ -1594,15 +1594,7 @@ test(
|
||||
stage: 'commandBarClosed',
|
||||
})
|
||||
|
||||
await u.waitForPageLoad()
|
||||
|
||||
// gray at this pixel means the stream has loaded in the most
|
||||
// user way we can verify it (pixel color)
|
||||
await expect
|
||||
.poll(() => u.getGreatestPixDiff(pointOnModel, [85, 85, 85]), {
|
||||
timeout: 10_000,
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
await scene.settled(cmdBar)
|
||||
})
|
||||
|
||||
await test.step('Clicking the logo takes us back to the projects page / home', async () => {
|
||||
@ -1619,15 +1611,7 @@ test(
|
||||
|
||||
await page.getByText('router-template-slate').click()
|
||||
|
||||
await u.waitForPageLoad()
|
||||
|
||||
// gray at this pixel means the stream has loaded in the most
|
||||
// user way we can verify it (pixel color)
|
||||
await expect
|
||||
.poll(() => u.getGreatestPixDiff(pointOnModel, [143, 143, 143]), {
|
||||
timeout: 10_000,
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
await scene.settled(cmdBar)
|
||||
})
|
||||
|
||||
await test.step('The projects on the home page should still be normal', async () => {
|
||||
|
@ -1617,7 +1617,7 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
|
||||
test(
|
||||
`snapToProfile start only works for current profile`,
|
||||
{ tag: ['@skipWin'] },
|
||||
async ({ context, page, scene, toolbar, editor, homePage }) => {
|
||||
async ({ context, page, scene, toolbar, editor, homePage, cmdBar }) => {
|
||||
// We seed the scene with a single offset plane
|
||||
await context.addInitScript(() => {
|
||||
localStorage.setItem(
|
||||
@ -1633,6 +1633,8 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
||||
})
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Start Sketch' })
|
||||
).not.toBeDisabled()
|
||||
@ -1654,9 +1656,13 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
||||
const codeFromTangentialArc = ` |> tangentialArcTo([39.49, 88.22], %)`
|
||||
await test.step('check that tangential tool does not snap to other profile starts', async () => {
|
||||
await toolbar.tangentialArcBtn.click()
|
||||
await page.waitForTimeout(1000)
|
||||
await endOfLowerSegMove()
|
||||
await page.waitForTimeout(1000)
|
||||
await endOfLowerSegClick()
|
||||
await page.waitForTimeout(1000)
|
||||
await profileStartOfHigherSegClick()
|
||||
await page.waitForTimeout(1000)
|
||||
await editor.expectEditor.toContain(codeFromTangentialArc)
|
||||
await editor.expectEditor.not.toContain(
|
||||
`[profileStartX(%), profileStartY(%)]`
|
||||
@ -2245,8 +2251,9 @@ profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07]
|
||||
|
||||
await test.step('enter sketch and setup', async () => {
|
||||
await moveToClearToolBarPopover()
|
||||
await page.waitForTimeout(1000)
|
||||
await pointOnSegment({ shouldDbClick: true })
|
||||
await page.waitForTimeout(600)
|
||||
await page.waitForTimeout(2000)
|
||||
|
||||
await toolbar.lineBtn.click()
|
||||
await page.waitForTimeout(100)
|
||||
|
@ -866,6 +866,8 @@ test.describe('Testing settings', () => {
|
||||
page,
|
||||
homePage,
|
||||
tronApp,
|
||||
scene,
|
||||
cmdBar
|
||||
}) => {
|
||||
if (!tronApp) {
|
||||
fail()
|
||||
@ -887,6 +889,8 @@ test.describe('Testing settings', () => {
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
await scene.connectionEstablished()
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
// Constants and locators
|
||||
const resizeHandle = page.locator('.sidebar-resize-handles > div.block')
|
||||
|
Reference in New Issue
Block a user