less flaky point and click

This commit is contained in:
lee-at-zoo-corp
2025-03-27 14:59:16 -04:00
parent 2c673fba82
commit 62a18dd2b3

View File

@ -74,8 +74,6 @@ test.describe('Point-and-click tests', () => {
await test.step('do extrude flow and check extrude code is added to editor', async () => {
await toolbar.extrudeButton.click()
await expect(page.getByText('Please select one or more face')).toBeVisible()
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'distance',
@ -1031,7 +1029,7 @@ openSketch = startSketchOn(XY)
})
await test.step(`Go through the command bar flow`, async () => {
await toolbar.offsetPlaneButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'plane',
@ -1258,7 +1256,7 @@ openSketch = startSketchOn(XY)
commandName: 'Helix',
})
await cmdBar.selectOption({ name: 'Edge' }).click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(1)
await clickOnEdge()
await page.waitForTimeout(1000)
await cmdBar.progressCmdBar()
@ -1545,7 +1543,7 @@ extrude001 = extrude(profile001, length = 100)
if (!shouldPreselect) {
await test.step(`Go through the command bar flow without preselected sketches`, async () => {
await toolbar.loftButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -1564,7 +1562,6 @@ extrude001 = extrude(profile001, length = 100)
await test.step(`Go through the command bar flow with preselected sketches`, async () => {
await toolbar.loftButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar()
})
}
@ -1725,7 +1722,7 @@ sketch002 = startSketchOn(XZ)
await test.step(`Go through the command bar flow`, async () => {
await toolbar.sweepButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
commandName: 'Sweep',
currentArgKey: 'target',
@ -1862,7 +1859,7 @@ sketch002 = startSketchOn(XZ)
await test.step(`Go through the command bar flow and fail validation with a toast`, async () => {
await toolbar.sweepButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
commandName: 'Sweep',
currentArgKey: 'target',
@ -1979,7 +1976,6 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Apply fillet to the preselected edge`, async () => {
await page.waitForTimeout(100)
await toolbar.filletButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({
commandName: 'Fillet',
highlightedHeaderArg: 'selection',
@ -2080,7 +2076,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Open fillet UI without selecting edges`, async () => {
await page.waitForTimeout(100)
await toolbar.filletButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -2448,7 +2444,6 @@ extrude001 = extrude(profile001, length = 5)
await test.step(`Apply fillet`, async () => {
await page.waitForTimeout(100)
await toolbar.filletButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({
commandName: 'Fillet',
highlightedHeaderArg: 'selection',
@ -2566,7 +2561,6 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Apply chamfer to the preselected edge`, async () => {
await page.waitForTimeout(100)
await toolbar.chamferButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({
commandName: 'Chamfer',
highlightedHeaderArg: 'selection',
@ -2674,7 +2668,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Open chamfer UI without selecting edges`, async () => {
await page.waitForTimeout(100)
await toolbar.chamferButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -2984,7 +2978,7 @@ extrude001 = extrude(sketch001, length = 30)
if (!shouldPreselect) {
await test.step(`Go through the command bar flow without preselected faces`, async () => {
await toolbar.shellButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -3019,7 +3013,6 @@ extrude001 = extrude(sketch001, length = 30)
await test.step(`Go through the command bar flow with a preselected face (cap)`, async () => {
await toolbar.shellButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar()
await page.waitForTimeout(500)
await cmdBar.progressCmdBar()
@ -3126,7 +3119,7 @@ extrude001 = extrude(sketch001, length = 40)
await test.step(`Go through the command bar flow, selecting a wall and keeping default thickness`, async () => {
await toolbar.shellButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -3138,9 +3131,7 @@ extrude001 = extrude(sketch001, length = 40)
highlightedHeaderArg: 'selection',
commandName: 'Shell',
})
await expect(
page.getByText('Please select one or more face')
).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await clickOnCap()
await page.keyboard.down('Shift')
await clickOnWall()
@ -3267,7 +3258,6 @@ extrude002 = extrude(sketch002, length = 50)
await test.step(`Go through the command bar flow, selecting a cap and keeping default thickness`, async () => {
await toolbar.shellButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -3279,9 +3269,7 @@ extrude002 = extrude(sketch002, length = 50)
highlightedHeaderArg: 'selection',
commandName: 'Shell',
})
await expect(
page.getByText('Please select one or more face')
).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(1)
await clickOnCap()
await page.waitForTimeout(500)
await cmdBar.progressCmdBar()
@ -3438,7 +3426,7 @@ sweep001 = sweep(sketch001, path = sketch002)
await test.step(`Go through the Shell flow and fail validation with a toast`, async () => {
await toolbar.shellButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await expect.poll(() => page.getByText('Please select one').count()).toBe(2)
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'selection',
@ -3507,9 +3495,9 @@ segAng(rectangleSegmentA002),
// select line of code
const codeToSelection = `segAng(rectangleSegmentA002) - 90,`
// revolve
await editor.scrollToText(codeToSelection)
await page.getByText(codeToSelection).click()
await toolbar.revolveButton.click()
await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
@ -3682,7 +3670,7 @@ sketch003 = startSketchOn(extrude001, 'START')
await page.waitForTimeout(1000)
await editor.scrollToText(codeToSelection)
await page.getByText(codeToSelection).click()
await expect(page.getByText('AxisOrEdge', { exact: true })).toBeVisible()
await expect.poll(() => page.getByText('AxisOrEdge').count()).toBe(2)
await page.getByText('Edge', { exact: true }).click()
const lineCodeToSelection = `length = 2.6`
await editor.scrollToText(lineCodeToSelection)