Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add console test #501

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,44 @@
}
});
});

test.describe('Console activation test', () => {
test.beforeAll(async ({ request }) => {
const content = galata.newContentsHelper(request);
await content.deleteDirectory('/testDir');
await content.uploadDirectory(
path.resolve(__dirname, './gis-files'),
'/testDir'
);
});

test('should open console', async ({ page }) => {
await page.goto();
await page.sidebar.close('right');
await page.sidebar.close('left');
await page.getByLabel('notebook content').getByText('GIS File').click();
await page.getByRole('button', { name: 'Toggle console' }).click();
await page.getByRole('button', { name: 'Remove console' });
await page
.getByRole('textbox')
.filter({ hasText: /^$/ })
.locator('div')
.click();
await page
.getByRole('textbox')
.filter({ hasText: /^$/ })
.locator('div')
.fill('doc.add_geojson_layer(path="testDir/eq.json")');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.fill('doc.add_geojson_layer(path="testDir/eq.json")');
.fill('doc.add_geojson_layer(path="testDir/eq.json");');

await page.waitForTimeout(1000);
await page.keyboard.press('Shift+Enter');
await page.waitForTimeout(1000);

const main = await page.locator('#jp-main-dock-panel');

if (main) {
expect(await main.screenshot()).toMatchSnapshot({

Check failure on line 106 in ui-tests/tests/ui.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:82:7 › Console activation test › should open console

1) tests/ui.spec.ts:82:7 › Console activation test › should open console ───────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) 2852 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts-snapshots/JGIS-Console-linux.png Received: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console/JGIS-Console-actual.png Diff: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console/JGIS-Console-diff.png 104 | 105 | if (main) { > 106 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 107 | name: `JGIS-Console.png` 108 | }); 109 | } at /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts:106:39

Check failure on line 106 in ui-tests/tests/ui.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:82:7 › Console activation test › should open console

1) tests/ui.spec.ts:82:7 › Console activation test › should open console ───────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) 2972 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts-snapshots/JGIS-Console-linux.png Received: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console-retry1/JGIS-Console-actual.png Diff: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console-retry1/JGIS-Console-diff.png 104 | 105 | if (main) { > 106 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 107 | name: `JGIS-Console.png` 108 | }); 109 | } at /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts:106:39

Check failure on line 106 in ui-tests/tests/ui.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:82:7 › Console activation test › should open console

1) tests/ui.spec.ts:82:7 › Console activation test › should open console ───────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) 6446 pixels (ratio 0.02 of all image pixels) are different. Expected: /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts-snapshots/JGIS-Console-linux.png Received: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console-retry2/JGIS-Console-actual.png Diff: /home/runner/work/jupytergis/jupytergis/ui-tests/test-results/tests-ui-Console-activation-test-should-open-console-retry2/JGIS-Console-diff.png 104 | 105 | if (main) { > 106 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 107 | name: `JGIS-Console.png` 108 | }); 109 | } at /home/runner/work/jupytergis/jupytergis/ui-tests/tests/ui.spec.ts:106:39
name: `JGIS-Console.png`
});
}
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading