Skip to content

Commit

Permalink
Unpin jupyterlab in ui-tests (#251)
Browse files Browse the repository at this point in the history
* Unpin jupyterlab in ui-tests

* Update galata

* Fix pinning

* Update snapshot

* Debug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
martinRenou and pre-commit-ci[bot] authored Feb 9, 2024
1 parent 80b9371 commit aec83a2
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 408 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
environment-name: cad
create-args: >-
python=3.9
jupyterlab=4.0.12
jupyterlab
pythonocc-core=7.7.0
- name: Download extension package
Expand Down
6 changes: 3 additions & 3 deletions python/jupytercad/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
"jupytercad_core>=1.0.0a0,<2",
"jupytercad_lab>=1.0.0a0,<2",
"jupytercad_app>=1.0.0a0,<2",
"jupytercad_core>=2.0.0a0,<3",
"jupytercad_lab>=2.0.0a0,<3",
"jupytercad_app>=2.0.0a0,<3",
]
dynamic = ["version"]
license = {file = "LICENSE"}
Expand Down
4 changes: 2 additions & 2 deletions python/jupytercad_app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ classifiers = [
]
dependencies = [
"jupyter_server>=2.0.1,<3",
"jupytercad_core>=1.0.0a0,<2",
"jupytercad_lab>=1.0.0a0,<2",
"jupytercad_core>=2.0.0a0,<3",
"jupytercad_lab>=2.0.0a0,<3",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_lab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"yjs-widgets>=0.3.4,<0.4",
"comm>=0.1.2,<0.2.0",
"pydantic>=2,<3",
"jupytercad_core>=1.0.0a0,<2",
"jupytercad_core>=2.0.0a0,<3",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:debug": "PWDEBUG=1 npx playwright test --workers 1"
},
"devDependencies": {
"@jupyterlab/galata": "^5.0.8",
"@jupyterlab/galata": "^5.1.0",
"@playwright/test": "^1.32.0",
"@types/klaw-sync": "^6.0.1"
},
Expand Down
10 changes: 2 additions & 8 deletions ui-tests/tests/sketcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ test.describe('Sketcher test', () => {
.getByRole('tab', { name: 'JupyterCad Control Panel' })
.click();

const btn = await page.locator(
"button.jp-ToolbarButtonComponent[data-command='jupytercad:sketch']"
);
await btn.click();
await page.getByTitle('New Sketch').click();
const dialog = await page.$('.lm-Widget.lm-Panel.jp-Dialog-content');
if (dialog) {
expect(await dialog.screenshot()).toMatchSnapshot({
Expand All @@ -68,10 +65,7 @@ test.describe('Sketcher test', () => {
.getByRole('tab', { name: 'JupyterCad Control Panel' })
.click();

const btn = await page.locator(
"button.jp-ToolbarButtonComponent[data-command='jupytercad:sketch']"
);
await btn.click();
await page.getByTitle('New Sketch').click();
await page.getByRole('button', { name: 'CIRCLE' }).click();
await page
.locator('canvas')
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 9 additions & 20 deletions ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,13 @@ test.describe('UI Test', () => {
await page.notebook.openByPath(fullPath);
await page.notebook.activate(fullPath);
await page.locator('div.jpcad-Spinner').waitFor({ state: 'hidden' });
const btn = await page.locator(
"button.jp-ToolbarButtonComponent[data-command='jupytercad:newBox']"
);
await btn.click();
const nameInput = await page.locator(
'input[id^="id-jp-schemaform"][label="Name"]'
);
nameInput.fill('Foo');
const accept = await page.locator('div.jp-Dialog-buttonLabel', {
hasText: 'Submit'
});
accept.click();
await page.getByTitle('New Box').click();
page.locator('input[id^="id-jp-schemaform"][label="Name"]').fill('Foo');
await page
.locator('div.jp-Dialog-buttonLabel', {
hasText: 'Submit'
})
.click();

await page
.getByRole('tablist', { name: 'main sidebar' })
Expand Down Expand Up @@ -237,10 +232,7 @@ test.describe('UI Test', () => {
await page.locator('div.jpcad-Spinner').waitFor({ state: 'hidden' });

// Create a cone
const btn = await page.locator(
"button.jp-ToolbarButtonComponent[data-command='jupytercad:newCone']"
);
await btn.click();
await page.getByTitle('New Cone').click();
await page.getByLabel('Radius1').click();
await page.getByLabel('Radius1').fill('15');
await page.getByLabel('Radius2').click();
Expand Down Expand Up @@ -276,10 +268,7 @@ test.describe('UI Test', () => {
await page.waitForTimeout(1000);

// Apply a cut operator from the selection
const cutbtn = await page.locator(
"button.jp-ToolbarButtonComponent[data-command='jupytercad:cut']"
);
await cutbtn.click();
await page.getByTitle('Cut').click();
await page
.locator('.jp-Dialog-body')
.locator('div.jp-Dialog-buttonLabel', {
Expand Down
Loading

0 comments on commit aec83a2

Please sign in to comment.