Skip to content

Commit 670cb8d

Browse files
authored
tiny refactor. just adding steps to the e2e extrude test (#9146)
1 parent 0814d6f commit 670cb8d

File tree

1 file changed

+98
-79
lines changed

1 file changed

+98
-79
lines changed

e2e/playwright/point-click.spec.ts

Lines changed: 98 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -122,96 +122,115 @@ test.describe('Point-and-click tests', () => {
122122
}) => {
123123
const code = `sketch001 = startSketchOn(XY)
124124
profile001 = circle(sketch001, center = [0, 0], radius = 5)`
125-
await context.addInitScript((initialCode) => {
126-
localStorage.setItem('persistCode', initialCode)
127-
}, code)
128-
await homePage.goToModelingScene()
129-
await scene.settled(cmdBar)
125+
await test.step('Settle the scene', async () => {
126+
await context.addInitScript((initialCode) => {
127+
localStorage.setItem('persistCode', initialCode)
128+
}, code)
129+
await page.setBodyDimensions({ width: 1000, height: 500 })
130+
await homePage.goToModelingScene()
131+
await scene.settled(cmdBar)
132+
})
130133

131134
await test.step('Add extrude with tags', async () => {
132-
await toolbar.extrudeButton.click()
133-
await editor.selectText('circle')
134-
await cmdBar.progressCmdBar()
135-
await cmdBar.clickOptionalArgument('length')
136-
await cmdBar.expectState({
137-
stage: 'arguments',
138-
currentArgKey: 'length',
139-
currentArgValue: '5',
140-
headerArguments: {
141-
Profiles: '1 profile',
142-
Length: '',
143-
},
144-
highlightedHeaderArg: 'length',
145-
commandName: 'Extrude',
135+
await test.step('Open extrude command from toolbar', async () => {
136+
await toolbar.extrudeButton.click()
146137
})
147-
await page.keyboard.insertText('4')
148-
await cmdBar.progressCmdBar()
149-
await cmdBar.expectState({
150-
stage: 'review',
151-
headerArguments: {
152-
Length: '4',
153-
Profiles: '1 profile',
154-
},
155-
commandName: 'Extrude',
138+
await test.step('Select profile', async () => {
139+
await editor.selectText('circle')
140+
await cmdBar.progressCmdBar()
156141
})
157-
await cmdBar.clickOptionalArgument('tagEnd')
158-
await cmdBar.expectState({
159-
stage: 'arguments',
160-
currentArgKey: 'tagEnd$',
161-
currentArgValue: '',
162-
headerArguments: {
163-
Length: '4',
164-
Profiles: '1 profile',
165-
TagEnd: '',
166-
},
167-
highlightedHeaderArg: 'tagEnd',
168-
commandName: 'Extrude',
142+
await test.step('Set length', async () => {
143+
await cmdBar.clickOptionalArgument('length')
144+
await cmdBar.expectState({
145+
stage: 'arguments',
146+
currentArgKey: 'length',
147+
currentArgValue: '5',
148+
headerArguments: {
149+
Profiles: '1 profile',
150+
Length: '',
151+
},
152+
highlightedHeaderArg: 'length',
153+
commandName: 'Extrude',
154+
})
155+
await page.keyboard.insertText('4')
156+
await cmdBar.progressCmdBar()
157+
await cmdBar.expectState({
158+
stage: 'review',
159+
headerArguments: {
160+
Length: '4',
161+
Profiles: '1 profile',
162+
},
163+
commandName: 'Extrude',
164+
})
169165
})
170-
await page.keyboard.insertText('myEndTag')
171-
await cmdBar.progressCmdBar()
172-
await cmdBar.expectState({
173-
stage: 'review',
174-
headerArguments: {
175-
Length: '4',
176-
Profiles: '1 profile',
177-
TagEnd: 'myEndTag',
178-
},
179-
commandName: 'Extrude',
166+
await test.step('Set end tag', async () => {
167+
await cmdBar.clickOptionalArgument('tagEnd')
168+
await cmdBar.expectState({
169+
stage: 'arguments',
170+
currentArgKey: 'tagEnd$',
171+
currentArgValue: '',
172+
headerArguments: {
173+
Length: '4',
174+
Profiles: '1 profile',
175+
TagEnd: '',
176+
},
177+
highlightedHeaderArg: 'tagEnd',
178+
commandName: 'Extrude',
179+
})
180+
await page.keyboard.insertText('myEndTag')
181+
await cmdBar.progressCmdBar()
182+
await cmdBar.expectState({
183+
stage: 'review',
184+
headerArguments: {
185+
Length: '4',
186+
Profiles: '1 profile',
187+
TagEnd: 'myEndTag',
188+
},
189+
commandName: 'Extrude',
190+
})
191+
})
192+
await test.step('Submit and verify', async () => {
193+
await cmdBar.submit()
194+
await editor.expectEditor.toContain(
195+
'extrude(profile001, length = 4, tagEnd = $myEndTag)'
196+
)
180197
})
181-
await cmdBar.submit()
182-
await editor.expectEditor.toContain(
183-
'extrude(profile001, length = 4, tagEnd = $myEndTag)'
184-
)
185198
})
186199

187200
await test.step(`Edit first extrude via feature tree`, async () => {
188-
await (await toolbar.getFeatureTreeOperation('Extrude', 0)).dblclick()
189-
await cmdBar.clickHeaderArgument('length')
190-
await cmdBar.expectState({
191-
stage: 'arguments',
192-
currentArgKey: 'length',
193-
currentArgValue: '4',
194-
headerArguments: {
195-
Length: '4',
196-
TagEnd: 'myEndTag',
197-
},
198-
highlightedHeaderArg: 'length',
199-
commandName: 'Extrude',
201+
await test.step('Open extrude operation from feature tree', async () => {
202+
await (await toolbar.getFeatureTreeOperation('Extrude', 0)).dblclick()
200203
})
201-
await page.keyboard.insertText('3')
202-
await cmdBar.progressCmdBar()
203-
await cmdBar.expectState({
204-
stage: 'review',
205-
headerArguments: {
206-
Length: '3',
207-
TagEnd: 'myEndTag',
208-
},
209-
commandName: 'Extrude',
204+
await test.step('Edit length argument', async () => {
205+
await cmdBar.clickHeaderArgument('length')
206+
await cmdBar.expectState({
207+
stage: 'arguments',
208+
currentArgKey: 'length',
209+
currentArgValue: '4',
210+
headerArguments: {
211+
Length: '4',
212+
TagEnd: 'myEndTag',
213+
},
214+
highlightedHeaderArg: 'length',
215+
commandName: 'Extrude',
216+
})
217+
await page.keyboard.insertText('3')
218+
await cmdBar.progressCmdBar()
219+
await cmdBar.expectState({
220+
stage: 'review',
221+
headerArguments: {
222+
Length: '3',
223+
TagEnd: 'myEndTag',
224+
},
225+
commandName: 'Extrude',
226+
})
227+
})
228+
await test.step('Submit and verify', async () => {
229+
await cmdBar.submit()
230+
await editor.expectEditor.toContain(
231+
'extrude(profile001, length = 3, tagEnd = $myEndTag)'
232+
)
210233
})
211-
await cmdBar.progressCmdBar()
212-
await editor.expectEditor.toContain(
213-
'extrude(profile001, length = 3, tagEnd = $myEndTag)'
214-
)
215234
})
216235
})
217236

0 commit comments

Comments
 (0)