fix: fixing e2e test
This commit is contained in:
@ -293,7 +293,7 @@ test.describe('when using the file tree to', () => {
|
|||||||
{
|
{
|
||||||
tag: '@desktop',
|
tag: '@desktop',
|
||||||
},
|
},
|
||||||
async ({ page }, testInfo) => {
|
async ({ page, toolbar}, testInfo) => {
|
||||||
const {
|
const {
|
||||||
panesOpen,
|
panesOpen,
|
||||||
pasteCodeInEditor,
|
pasteCodeInEditor,
|
||||||
@ -319,19 +319,11 @@ test.describe('when using the file tree to', () => {
|
|||||||
|
|
||||||
// Create a large lego file
|
// Create a large lego file
|
||||||
await createNewFile('lego')
|
await createNewFile('lego')
|
||||||
const legoFile = page.getByRole('listitem').filter({
|
|
||||||
has: page.getByRole('button', { name: 'lego.kcl' }),
|
|
||||||
})
|
|
||||||
await expect(legoFile).toBeVisible({ timeout: 60_000 })
|
|
||||||
await legoFile.click()
|
|
||||||
const kclLego = await fsp.readFile(
|
const kclLego = await fsp.readFile(
|
||||||
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
await pasteCodeInEditor(kclLego)
|
await pasteCodeInEditor(kclLego)
|
||||||
const mainFile = page.getByRole('listitem').filter({
|
|
||||||
has: page.getByRole('button', { name: 'main.kcl' }),
|
|
||||||
})
|
|
||||||
|
|
||||||
// Open settings and enable the debug panel
|
// Open settings and enable the debug panel
|
||||||
await page
|
await page
|
||||||
@ -345,12 +337,12 @@ test.describe('when using the file tree to', () => {
|
|||||||
await test.step('swap between small and large files', async () => {
|
await test.step('swap between small and large files', async () => {
|
||||||
await openDebugPanel()
|
await openDebugPanel()
|
||||||
// Previously created a file so we need to start back at main.kcl
|
// Previously created a file so we need to start back at main.kcl
|
||||||
await mainFile.click()
|
await toolbar.openFile('main.kcl')
|
||||||
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
||||||
// Click the large file
|
// Click the large file
|
||||||
await legoFile.click()
|
await toolbar.openFile('lego.kcl')
|
||||||
// Once it is building, click back to the smaller file
|
// Once it is building, click back to the smaller file
|
||||||
await mainFile.click()
|
await toolbar.openFile('main.kcl')
|
||||||
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
||||||
await closeDebugPanel()
|
await closeDebugPanel()
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user