Skip to content

Remove pixel color checks from manual edit tests #6349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions e2e/playwright/sketch-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3023,7 +3023,7 @@ test.describe('Redirecting to home page and back to the original file should cle
await click00r(0, 100)
await click00r(100, 0)

// draw a line to opposite tangnet direction of previous arc
// draw a line to opposite tangent direction of previous arc
await toolbar.selectLine()
await click00r(0, 0)
await click00r(-200, 200)
Expand Down Expand Up @@ -3058,7 +3058,7 @@ test.describe('manual edits during sketch mode', () => {
}) => {
const initialCode = `myVar1 = 5
myVar2 = 6

sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([106.68, 89.77], sketch001)
|> line(end = [132.34, 157.8])
Expand Down Expand Up @@ -3089,29 +3089,20 @@ test.describe('manual edits during sketch mode', () => {
await homePage.goToModelingScene()
await scene.connectionEstablished()
await scene.settled(cmdBar)
const expectSketchOriginToBeDrawn = async () => {
await scene.expectPixelColor(TEST_COLORS.WHITE, { x: 672, y: 193 }, 15)
}

await test.step('Open feature tree and edit second sketch', async () => {
await toolbar.openFeatureTreePane()
const sketchButton = await toolbar.getFeatureTreeOperation('Sketch', 1)
await sketchButton.dblclick()
await page.waitForTimeout(700) // Wait for engine animation
await expectSketchOriginToBeDrawn()
})

await test.step('Add new variable and wait for re-execution', async () => {
await page.waitForTimeout(500) // wait for deferred execution
await editor.replaceCode('myVar2 = 6', 'myVar2 = 6\nmyVar3 = 7')
await page.waitForTimeout(2000) // wait for deferred execution
await expectSketchOriginToBeDrawn()
await page.waitForTimeout(2000) // Wait for deferred execution
})

const handle1Location = { x: 843, y: 235 }

await test.step('Edit sketch by dragging handle', async () => {
await page.waitForTimeout(500)
await editor.expectEditor.toContain('length = 156.54, angle = -28')
await page.mouse.move(handle1Location.x, handle1Location.y)
await page.mouse.down()
Expand All @@ -3120,16 +3111,13 @@ test.describe('manual edits during sketch mode', () => {
})
await page.mouse.up()
await editor.expectEditor.toContain('length = 231.59, angle = -34')
// await page.waitForTimeout(1000) // Wait for update
})

await test.step('Delete variables and wait for re-execution', async () => {
await page.waitForTimeout(500)
await editor.replaceCode('myVar3 = 7', '')
await page.waitForTimeout(50)
await editor.replaceCode('myVar2 = 6', '')
await page.waitForTimeout(2000) // Wait for deferred execution
await expectSketchOriginToBeDrawn()
})

const handle2Location = { x: 872, y: 273 }
Expand All @@ -3142,6 +3130,7 @@ test.describe('manual edits during sketch mode', () => {
steps: 5,
})
await page.mouse.up()
await page.waitForTimeout(100)
await editor.expectEditor.toContain('length = 167.36, angle = -14')
})

Expand All @@ -3154,7 +3143,6 @@ test.describe('manual edits during sketch mode', () => {
profile004 = circle(sketch003, center = [143.91, 136.89], radius = 71.63)`
)
await page.waitForTimeout(2000) // Wait for deferred execution
await expectSketchOriginToBeDrawn()
})

const handle3Location = { x: 844, y: 212 }
Expand All @@ -3166,6 +3154,7 @@ test.describe('manual edits during sketch mode', () => {
steps: 5,
})
await page.mouse.up()
await page.waitForTimeout(100)
await editor.expectEditor.toContain('length = 219.2, angle = -56')
})

Expand All @@ -3176,7 +3165,7 @@ test.describe('manual edits during sketch mode', () => {
`myVar1 = 5
sketch003 = startSketchOn(XY)
profile004 = circle(sketch003, center = [143.91, 136.89], radius = 71.63)

sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([106.68, 89.77], sketch001)
|> line(end = [132.34, 157.8])
Expand Down Expand Up @@ -3220,7 +3209,7 @@ test.describe('manual edits during sketch mode', () => {
}) => {
const initialCode = `myVar1 = 5
myVar2 = 6

sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([106.68, 89.77], sketch001)
|> line(end = [132.34, 157.8])
Expand Down Expand Up @@ -3251,16 +3240,12 @@ test.describe('manual edits during sketch mode', () => {
await homePage.goToModelingScene()
await scene.connectionEstablished()
await scene.settled(cmdBar)
const expectSketchOriginToBeDrawn = async () => {
await scene.expectPixelColor(TEST_COLORS.WHITE, { x: 672, y: 193 }, 15)
}

await test.step('Open feature tree and edit second sketch', async () => {
await toolbar.openFeatureTreePane()
const sketchButton = await toolbar.getFeatureTreeOperation('Sketch', 1)
await sketchButton.dblclick()
await page.waitForTimeout(700) // Wait for engine animation
await expectSketchOriginToBeDrawn()
})

await test.step('rename variable of current sketch, sketch002 to changeSketchNamePartWayThrough', async () => {
Expand Down Expand Up @@ -3302,7 +3287,7 @@ test.describe('manual edits during sketch mode', () => {
// wait for scene to load
await scene.settled(cmdBar)

await test.step('check chamfer selection changes cursor positon', async () => {
await test.step('check chamfer selection changes cursor position', async () => {
await expect(async () => {
// sometimes initial click doesn't register
await objClick()
Expand Down
Loading