Skip to content

Commit aec83a2

Browse files
Unpin jupyterlab in ui-tests (#251)
* 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>
1 parent 80b9371 commit aec83a2

File tree

9 files changed

+501
-408
lines changed

9 files changed

+501
-408
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
environment-name: cad
139139
create-args: >-
140140
python=3.9
141-
jupyterlab=4.0.12
141+
jupyterlab
142142
pythonocc-core=7.7.0
143143
144144
- name: Download extension package

python/jupytercad/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ classifiers = [
1919
"Programming Language :: Python :: 3.12",
2020
]
2121
dependencies = [
22-
"jupytercad_core>=1.0.0a0,<2",
23-
"jupytercad_lab>=1.0.0a0,<2",
24-
"jupytercad_app>=1.0.0a0,<2",
22+
"jupytercad_core>=2.0.0a0,<3",
23+
"jupytercad_lab>=2.0.0a0,<3",
24+
"jupytercad_app>=2.0.0a0,<3",
2525
]
2626
dynamic = ["version"]
2727
license = {file = "LICENSE"}

python/jupytercad_app/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ classifiers = [
2424
]
2525
dependencies = [
2626
"jupyter_server>=2.0.1,<3",
27-
"jupytercad_core>=1.0.0a0,<2",
28-
"jupytercad_lab>=1.0.0a0,<2",
27+
"jupytercad_core>=2.0.0a0,<3",
28+
"jupytercad_lab>=2.0.0a0,<3",
2929
]
3030
dynamic = ["version", "description", "authors", "urls", "keywords"]
3131
license = {file = "LICENSE"}

python/jupytercad_lab/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"yjs-widgets>=0.3.4,<0.4",
3333
"comm>=0.1.2,<0.2.0",
3434
"pydantic>=2,<3",
35-
"jupytercad_core>=1.0.0a0,<2",
35+
"jupytercad_core>=2.0.0a0,<3",
3636
]
3737
dynamic = ["version", "description", "authors", "urls", "keywords"]
3838
license = {file = "LICENSE"}

ui-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test:debug": "PWDEBUG=1 npx playwright test --workers 1"
1111
},
1212
"devDependencies": {
13-
"@jupyterlab/galata": "^5.0.8",
13+
"@jupyterlab/galata": "^5.1.0",
1414
"@playwright/test": "^1.32.0",
1515
"@types/klaw-sync": "^6.0.1"
1616
},

ui-tests/tests/sketcher.spec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ test.describe('Sketcher test', () => {
4040
.getByRole('tab', { name: 'JupyterCad Control Panel' })
4141
.click();
4242

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

71-
const btn = await page.locator(
72-
"button.jp-ToolbarButtonComponent[data-command='jupytercad:sketch']"
73-
);
74-
await btn.click();
68+
await page.getByTitle('New Sketch').click();
7569
await page.getByRole('button', { name: 'CIRCLE' }).click();
7670
await page
7771
.locator('canvas')
-95 Bytes
Loading

ui-tests/tests/ui.spec.ts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,13 @@ test.describe('UI Test', () => {
108108
await page.notebook.openByPath(fullPath);
109109
await page.notebook.activate(fullPath);
110110
await page.locator('div.jpcad-Spinner').waitFor({ state: 'hidden' });
111-
const btn = await page.locator(
112-
"button.jp-ToolbarButtonComponent[data-command='jupytercad:newBox']"
113-
);
114-
await btn.click();
115-
const nameInput = await page.locator(
116-
'input[id^="id-jp-schemaform"][label="Name"]'
117-
);
118-
nameInput.fill('Foo');
119-
const accept = await page.locator('div.jp-Dialog-buttonLabel', {
120-
hasText: 'Submit'
121-
});
122-
accept.click();
111+
await page.getByTitle('New Box').click();
112+
page.locator('input[id^="id-jp-schemaform"][label="Name"]').fill('Foo');
113+
await page
114+
.locator('div.jp-Dialog-buttonLabel', {
115+
hasText: 'Submit'
116+
})
117+
.click();
123118

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

239234
// Create a cone
240-
const btn = await page.locator(
241-
"button.jp-ToolbarButtonComponent[data-command='jupytercad:newCone']"
242-
);
243-
await btn.click();
235+
await page.getByTitle('New Cone').click();
244236
await page.getByLabel('Radius1').click();
245237
await page.getByLabel('Radius1').fill('15');
246238
await page.getByLabel('Radius2').click();
@@ -276,10 +268,7 @@ test.describe('UI Test', () => {
276268
await page.waitForTimeout(1000);
277269

278270
// Apply a cut operator from the selection
279-
const cutbtn = await page.locator(
280-
"button.jp-ToolbarButtonComponent[data-command='jupytercad:cut']"
281-
);
282-
await cutbtn.click();
271+
await page.getByTitle('Cut').click();
283272
await page
284273
.locator('.jp-Dialog-body')
285274
.locator('div.jp-Dialog-buttonLabel', {

0 commit comments

Comments
 (0)