Skip to content

Commit 9f87f1a

Browse files
committed
Keep only one px coordinate for sweepEdge selection in Fillet point-and-click
1 parent 2ab49af commit 9f87f1a

File tree

1 file changed

+4
-59
lines changed

1 file changed

+4
-59
lines changed

e2e/playwright/point-click.spec.ts

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,58 +1430,27 @@ extrude001 = extrude(sketch001, length = -12)
14301430
const secondFilletDeclaration = `fillet(radius=5,tags=[getCommonEdge(faces=[seg01,capStart001])],)`
14311431

14321432
// Locators
1433-
const firstEdgeLocation = { x: 600, y: 193 }
1433+
// TODO: find a way to not have hardcoded pixel values for sweepEdges
14341434
const secondEdgeLocation = { x: 600, y: 383 }
1435-
const bodyLocation = { x: 630, y: 290 }
1436-
const [clickOnFirstEdge] = scene.makeMouseHelpers(
1437-
firstEdgeLocation.x,
1438-
firstEdgeLocation.y
1439-
)
14401435
const [clickOnSecondEdge] = scene.makeMouseHelpers(
14411436
secondEdgeLocation.x,
14421437
secondEdgeLocation.y
14431438
)
14441439

1445-
// Colors
1446-
const edgeColorWhite: [number, number, number] = [248, 248, 248]
1447-
const edgeColorYellow: [number, number, number] = [251, 251, 40] // Mac:B=67 Ubuntu:B=12
1448-
const bodyColor: [number, number, number] = [155, 155, 155]
1449-
const filletColor: [number, number, number] = [127, 127, 127]
1450-
const backgroundColor: [number, number, number] = [30, 30, 30]
1451-
const lowTolerance = 20
1452-
const highTolerance = 70 // TODO: understand why I needed that for edgeColorYellow on macos (local)
1453-
14541440
// Setup
14551441
await test.step(`Initial test setup`, async () => {
14561442
await context.addInitScript((initialCode) => {
14571443
localStorage.setItem('persistCode', initialCode)
14581444
}, initialCode)
14591445
await page.setBodyDimensions({ width: 1000, height: 500 })
14601446
await homePage.goToModelingScene()
1461-
1462-
// verify modeling scene is loaded
1463-
await scene.expectPixelColor(
1464-
backgroundColor,
1465-
secondEdgeLocation,
1466-
lowTolerance
1467-
)
1468-
1469-
// wait for stream to load
1470-
await scene.expectPixelColor(bodyColor, bodyLocation, highTolerance)
1447+
await scene.settled(cmdBar)
14711448
})
14721449

14731450
// Test 1: Command bar flow with preselected edges
14741451
await test.step(`Select first edge`, async () => {
1475-
await scene.expectPixelColor(
1476-
edgeColorWhite,
1477-
firstEdgeLocation,
1478-
lowTolerance
1479-
)
1480-
await clickOnFirstEdge()
1481-
await scene.expectPixelColor(
1482-
edgeColorYellow,
1483-
firstEdgeLocation,
1484-
highTolerance // Ubuntu color mismatch can require high tolerance
1452+
await editor.selectText(
1453+
'line(endAbsolute = [profileStartX(%), profileStartY(%)])'
14851454
)
14861455
})
14871456

@@ -1534,10 +1503,6 @@ extrude001 = extrude(sketch001, length = -12)
15341503
})
15351504
})
15361505

1537-
await test.step(`Confirm scene has changed`, async () => {
1538-
await scene.expectPixelColor(filletColor, firstEdgeLocation, lowTolerance)
1539-
})
1540-
15411506
// Test 1.1: Edit fillet (segment type)
15421507
async function editFillet(
15431508
featureTreeIndex: number,
@@ -1610,17 +1575,7 @@ extrude001 = extrude(sketch001, length = -12)
16101575
})
16111576

16121577
await test.step(`Select second edge`, async () => {
1613-
await scene.expectPixelColor(
1614-
edgeColorWhite,
1615-
secondEdgeLocation,
1616-
lowTolerance
1617-
)
16181578
await clickOnSecondEdge()
1619-
await scene.expectPixelColor(
1620-
edgeColorYellow,
1621-
secondEdgeLocation,
1622-
highTolerance // Ubuntu color mismatch can require high tolerance
1623-
)
16241579
})
16251580

16261581
await test.step(`Apply fillet to the second edge`, async () => {
@@ -1670,14 +1625,6 @@ extrude001 = extrude(sketch001, length = -12)
16701625
})
16711626
})
16721627

1673-
await test.step(`Confirm scene has changed`, async () => {
1674-
await scene.expectPixelColor(
1675-
backgroundColor,
1676-
secondEdgeLocation,
1677-
lowTolerance
1678-
)
1679-
})
1680-
16811628
// Test 2.1: Edit fillet (edgeSweep type)
16821629
await test.step('Edit fillet via feature tree selection works', async () => {
16831630
const secondFilletFeatureTreeIndex = 1
@@ -1712,9 +1659,7 @@ extrude001 = extrude(sketch001, length = -12)
17121659
await operationButton.click({ button: 'left' })
17131660
await page.keyboard.press('Delete')
17141661
await page.waitForTimeout(500)
1715-
await scene.expectPixelColor(edgeColorWhite, secondEdgeLocation, 15) // deleted
17161662
await editor.expectEditor.not.toContain(secondFilletDeclaration)
1717-
await scene.expectPixelColor(filletColor, firstEdgeLocation, 15) // stayed
17181663
})
17191664
})
17201665
})

0 commit comments

Comments
 (0)