Update onboarding interactive numbers test to use editor fixture (#6356)
Trying to bring it down from the leaderboard of failed tests. Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
This commit is contained in:
@ -107,12 +107,10 @@ test.describe('Onboarding tests', () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
test('Code resets after confirmation', async ({
|
test('Code resets after confirmation', async ({
|
||||||
context,
|
|
||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
scene,
|
scene,
|
||||||
cmdBar,
|
|
||||||
}) => {
|
}) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
@ -276,6 +274,8 @@ test.describe('Onboarding tests', () => {
|
|||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
|
editor,
|
||||||
|
toolbar,
|
||||||
}) => {
|
}) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
@ -289,7 +289,6 @@ test.describe('Onboarding tests', () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const u = await getUtils(page)
|
|
||||||
const badCode = `// This is bad code we shouldn't see`
|
const badCode = `// This is bad code we shouldn't see`
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
||||||
@ -299,18 +298,19 @@ test.describe('Onboarding tests', () => {
|
|||||||
.poll(() => page.url())
|
.poll(() => page.url())
|
||||||
.toContain(onboardingPaths.PARAMETRIC_MODELING)
|
.toContain(onboardingPaths.PARAMETRIC_MODELING)
|
||||||
|
|
||||||
const bracketNoNewLines = bracket.replace(/\n/g, '')
|
|
||||||
|
|
||||||
// Check the code got reset on load
|
// Check the code got reset on load
|
||||||
await expect(page.locator('#code-pane')).toBeVisible()
|
await toolbar.openPane('code')
|
||||||
await expect(u.codeLocator).toHaveText(bracketNoNewLines, {
|
await editor.expectEditor.toContain(bracket, {
|
||||||
|
shouldNormalise: true,
|
||||||
timeout: 10_000,
|
timeout: 10_000,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Mess with the code again
|
// Mess with the code again
|
||||||
await u.codeLocator.selectText()
|
await editor.replaceCode('', badCode)
|
||||||
await u.codeLocator.fill(badCode)
|
await editor.expectEditor.toContain(badCode, {
|
||||||
await expect(u.codeLocator).toHaveText(badCode)
|
shouldNormalise: true,
|
||||||
|
timeout: 10_000,
|
||||||
|
})
|
||||||
|
|
||||||
// Click to the next step
|
// Click to the next step
|
||||||
await page.locator('[data-testid="onboarding-next"]').hover()
|
await page.locator('[data-testid="onboarding-next"]').hover()
|
||||||
@ -320,7 +320,10 @@ test.describe('Onboarding tests', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Check that the code has been reset
|
// Check that the code has been reset
|
||||||
await expect(u.codeLocator).toHaveText(bracketNoNewLines)
|
await editor.expectEditor.toContain(bracket, {
|
||||||
|
shouldNormalise: true,
|
||||||
|
timeout: 10_000,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// (lee) The two avatar tests are weird because even on main, we don't have
|
// (lee) The two avatar tests are weird because even on main, we don't have
|
||||||
|
Reference in New Issue
Block a user