Skip to content

Commit 2ab49af

Browse files
committed
Remove redundant sketch test
1 parent d525419 commit 2ab49af

File tree

1 file changed

+1
-147
lines changed

1 file changed

+1
-147
lines changed

e2e/playwright/various.spec.ts

Lines changed: 1 addition & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { doExport, getUtils, makeTemplate } from '@e2e/playwright/test-utils'
1+
import { doExport, getUtils } from '@e2e/playwright/test-utils'
22
import { expect, test } from '@e2e/playwright/zoo-test'
33

44
test('Units menu', async ({ page, homePage }) => {
@@ -443,149 +443,3 @@ test('Delete key does not navigate back', async ({ page, homePage }) => {
443443
await page.keyboard.press('Delete')
444444
await expect.poll(() => page.url()).not.toContain('/settings')
445445
})
446-
447-
test('Sketch on face', async ({ page, homePage, scene, cmdBar, toolbar }) => {
448-
test.setTimeout(90_000)
449-
const u = await getUtils(page)
450-
await page.addInitScript(async () => {
451-
localStorage.setItem(
452-
'persistCode',
453-
`@settings(defaultLengthUnit = in)
454-
sketch001 = startSketchOn(XZ)
455-
|> startProfile(at = [3.29, 7.86])
456-
|> line(end = [2.48, 2.44])
457-
|> line(end = [2.66, 1.17])
458-
|> line(end = [3.75, 0.46])
459-
|> line(end = [4.99, -0.46])
460-
|> line(end = [3.3, -2.12])
461-
|> line(end = [2.16, -3.33])
462-
|> line(end = [0.85, -3.08])
463-
|> line(end = [-0.18, -3.36])
464-
|> line(end = [-3.86, -2.73])
465-
|> line(end = [-17.67, 0.85])
466-
|> close()
467-
extrude001 = extrude(sketch001, length = 5 + 7)`
468-
)
469-
})
470-
471-
await page.setBodyDimensions({ width: 1200, height: 500 })
472-
473-
await homePage.goToModelingScene()
474-
await scene.connectionEstablished()
475-
await scene.settled(cmdBar)
476-
477-
let previousCodeContent = await page.locator('.cm-content').innerText()
478-
479-
await toolbar.startSketchThenCallbackThenWaitUntilReady(async () => {
480-
await u.openAndClearDebugPanel()
481-
await u.doAndWaitForCmd(
482-
() => page.mouse.click(625, 165),
483-
'default_camera_get_settings',
484-
true
485-
)
486-
await page.waitForTimeout(150)
487-
await u.closeDebugPanel()
488-
})
489-
await page.waitForTimeout(300)
490-
491-
const firstClickPosition = [612, 238]
492-
const secondClickPosition = [661, 242]
493-
const thirdClickPosition = [609, 267]
494-
495-
await page.mouse.click(firstClickPosition[0], firstClickPosition[1])
496-
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
497-
previousCodeContent = await page.locator('.cm-content').innerText()
498-
499-
await page.waitForTimeout(100)
500-
await page.mouse.click(secondClickPosition[0], secondClickPosition[1])
501-
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
502-
previousCodeContent = await page.locator('.cm-content').innerText()
503-
504-
await page.waitForTimeout(100)
505-
await page.mouse.click(thirdClickPosition[0], thirdClickPosition[1])
506-
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
507-
previousCodeContent = await page.locator('.cm-content').innerText()
508-
509-
await page.waitForTimeout(100)
510-
await page.mouse.click(firstClickPosition[0], firstClickPosition[1])
511-
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
512-
previousCodeContent = await page.locator('.cm-content').innerText()
513-
514-
await expect.poll(u.normalisedEditorCode).toContain(
515-
u.normalisedCode(`sketch002 = startSketchOn(extrude001, face = seg01)
516-
profile001 = startProfile(sketch002, at = [-12.34, 12.34])
517-
|> line(end = [12.34, -12.34])
518-
|> line(end = [-12.34, -12.34])
519-
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
520-
|> close()
521-
`)
522-
)
523-
524-
await u.openAndClearDebugPanel()
525-
await page.getByRole('button', { name: 'Exit Sketch' }).click()
526-
await u.expectCmdLog('[data-message-type="execution-done"]')
527-
528-
await u.updateCamPosition([1049, 239, 686])
529-
await u.closeDebugPanel()
530-
531-
await page.getByText('startProfile(sketch002, at = [-12').click()
532-
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible()
533-
await page.getByRole('button', { name: 'Edit Sketch' }).click()
534-
await page.waitForTimeout(500)
535-
await page.setViewportSize({ width: 1200, height: 1200 })
536-
await u.openAndClearDebugPanel()
537-
await u.updateCamPosition([452, -152, 1166])
538-
await u.closeDebugPanel()
539-
await page.waitForTimeout(200)
540-
541-
const pointToDragFirst = [787, 565]
542-
await page.mouse.move(pointToDragFirst[0], pointToDragFirst[1])
543-
await page.mouse.down()
544-
await page.mouse.move(pointToDragFirst[0] - 20, pointToDragFirst[1], {
545-
steps: 5,
546-
})
547-
await page.mouse.up()
548-
await page.waitForTimeout(100)
549-
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
550-
previousCodeContent = await page.locator('.cm-content').innerText()
551-
552-
const result = makeTemplate`sketch002 = startSketchOn(extrude001, face = seg01)
553-
|> startProfile(at = [-12.83, 6.7])
554-
|> line(end = [${[2.28, 2.35]}, -${0.07}])
555-
|> line(end = [-3.05, -1.47])
556-
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
557-
|> close()`
558-
559-
await expect(page.locator('.cm-content')).toHaveText(result.regExp)
560-
561-
// exit sketch
562-
await u.openAndClearDebugPanel()
563-
await page.getByRole('button', { name: 'Exit Sketch' }).click()
564-
await u.expectCmdLog('[data-message-type="execution-done"]')
565-
566-
await page.getByText('startProfile(sketch002, at = [-12').click()
567-
568-
await expect(page.getByRole('button', { name: 'Extrude' })).not.toBeDisabled()
569-
await page.waitForTimeout(100)
570-
await page.getByRole('button', { name: 'Extrude' }).click()
571-
572-
await expect(page.getByTestId('command-bar')).toBeVisible()
573-
await page.waitForTimeout(100)
574-
575-
await cmdBar.progressCmdBar()
576-
await cmdBar.progressCmdBar()
577-
await cmdBar.submit()
578-
579-
const result2 = result.genNext`
580-
const sketch002 = extrude(sketch002, length = ${[5, 5]} + 7)`
581-
await expect(page.locator('.cm-content')).toHaveText(result2.regExp)
582-
})
583-
584-
test.fixme(
585-
`Opening a share link in the web isn't blocked by the web warning banner`,
586-
async () => {
587-
// This test is not able to be run right now since we don't have a web-only setup for Playwright.
588-
// @franknoirot can implement it when that testing infra is set up. It should be a test to cover the fix from
589-
// modeling-app issue #6172.
590-
}
591-
)

0 commit comments

Comments
 (0)