-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
for more information, see https://pre-commit.ci
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
import { expect, test, galata } from '@jupyterlab/galata'; | ||
Check failure on line 1 in ui-tests/tests/lite.spec.ts
|
||
|
||
test.describe('JupyterCAD Lite Tests', () => { | ||
test.beforeEach(({ page }) => { | ||
page.setDefaultTimeout(600000); | ||
test.beforeEach(({ page }) => { | ||
page.setDefaultTimeout(600000); | ||
|
||
page.on('console', (message) => { | ||
console.log('CONSOLE MSG ---', message.text()); | ||
}); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await page.close({ runBeforeUnload: true }); | ||
page.on('console', message => { | ||
console.log('CONSOLE MSG ---', message.text()); | ||
}); | ||
}); | ||
|
||
test('Render Tree', async ({ page }, testInfo) => { | ||
await page.goto('lite'); | ||
test.afterEach(async ({ page }) => { | ||
await page.close({ runBeforeUnload: true }); | ||
}); | ||
|
||
const widget = await page.getByText('widgets'); | ||
test('Render Tree', async ({ page }, testInfo) => { | ||
await page.goto('lite'); | ||
|
||
// Wait a bit for the theme to be applied | ||
await page.waitForTimeout(1000); | ||
const widget = await page.getByText('widgets'); | ||
|
||
expect(await page.screenshot()).toMatchSnapshot('jupytercad-lite-tree.png'); | ||
// Wait a bit for the theme to be applied | ||
await page.waitForTimeout(1000); | ||
|
||
await widget.click(); | ||
expect(await page.screenshot()).toMatchSnapshot('jupytercad-lite-tree.png'); | ||
|
||
expect(await page.screenshot()).toMatchSnapshot('jupytercad-lite-subtree.png'); | ||
await widget.click(); | ||
|
||
const goUp = await page.getByTitle('Jupyter Server Root').locator('svg'); | ||
await goUp.click(); | ||
expect(await page.screenshot()).toMatchSnapshot( | ||
'jupytercad-lite-subtree.png' | ||
); | ||
|
||
expect(await page.screenshot()).toMatchSnapshot('jupytercad-lite-tree.png'); | ||
}); | ||
}) | ||
const goUp = await page.getByTitle('Jupyter Server Root').locator('svg'); | ||
await goUp.click(); | ||
|
||
expect(await page.screenshot()).toMatchSnapshot('jupytercad-lite-tree.png'); | ||
}); | ||
}); |