Skip to content

Commit 488ba90

Browse files
author
Greg
committed
Add console test
1 parent a6d7ef5 commit 488ba90

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

ui-tests/tests/ui.spec.ts

+41
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,44 @@ test.describe('UI Test', () => {
6868
}
6969
});
7070
});
71+
72+
test.describe('Console activation test', () => {
73+
test.beforeAll(async ({ request }) => {
74+
const content = galata.newContentsHelper(request);
75+
await content.deleteDirectory('/testDir');
76+
await content.uploadDirectory(
77+
path.resolve(__dirname, './gis-files'),
78+
'/testDir'
79+
);
80+
});
81+
82+
test('should open console', async ({ page }) => {
83+
await page.goto();
84+
await page.sidebar.close('right');
85+
await page.sidebar.close('left');
86+
await page.getByLabel('notebook content').getByText('GIS File').click();
87+
await page.getByRole('button', { name: 'Toggle console' }).click();
88+
await page.getByRole('button', { name: 'Remove console' });
89+
await page
90+
.getByRole('textbox')
91+
.filter({ hasText: /^$/ })
92+
.locator('div')
93+
.click();
94+
await page
95+
.getByRole('textbox')
96+
.filter({ hasText: /^$/ })
97+
.locator('div')
98+
.fill('doc.add_geojson_layer(path="testDir/eq.json")');
99+
await page.waitForTimeout(1000);
100+
await page.keyboard.press('Shift+Enter');
101+
await page.waitForTimeout(1000);
102+
103+
const main = await page.locator('canvas');
104+
105+
if (main) {
106+
expect(await main.screenshot()).toMatchSnapshot({
107+
name: `JGIS-Console.png`
108+
});
109+
}
110+
});
111+
});
Loading

0 commit comments

Comments
 (0)