Skip to content

Commit

Permalink
Update UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Feb 27, 2024
1 parent e25810e commit b08f39f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
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"
},
"devDependencies": {
"@jupyterlab/galata": "^5.0.8",
"@jupyterlab/galata": "^5.1.0",
"@playwright/test": "^1.32.0",
"@types/klaw-sync": "^6.0.1"
},
Expand Down
22 changes: 8 additions & 14 deletions ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,17 @@ 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();

await page.getByTitle('New Box').click();

const nameInput = await page.locator(
'input[id^="id-jp-schemaform"][label="Name"]'
);
nameInput.fill('Foo');
await nameInput.fill('Foo');
const accept = await page.locator('div.jp-Dialog-buttonLabel', {
hasText: 'Submit'
});
accept.click();
await accept.click();

await page
.getByRole('tablist', { name: 'main sidebar' })
Expand Down Expand Up @@ -248,10 +247,8 @@ 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 @@ -287,10 +284,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();

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:240:9 › UI Test › File operator test › Should be able to do multi selection

1) tests/ui.spec.ts:240:9 › UI Test › File operator test › Should be able to do multi selection ── Error: locator.click: Error: strict mode violation: getByTitle('Cut') resolved to 2 elements: 1) <li data-isdir="false" data-file-type="FCStd" class=…>…</li> aka getByText('cut.FCStd3 seconds ago4.8 KB') 2) <jp-button minimal="" title="Cut" tabindex="-1" current-val…>…</jp-button> aka getByTitle('Cut', { exact: true }) =========================== logs =========================== waiting for getByTitle('Cut') ============================================================ 285 | 286 | // Apply a cut operator from the selection > 287 | await page.getByTitle('Cut').click(); | ^ 288 | await page 289 | .locator('.jp-Dialog-body') 290 | .locator('div.jp-Dialog-buttonLabel', { at /home/runner/work/jupytercad-freecad/jupytercad-freecad/ui-tests/tests/ui.spec.ts:287:36
await page
.locator('.jp-Dialog-body')
.locator('div.jp-Dialog-buttonLabel', {
Expand Down

0 comments on commit b08f39f

Please sign in to comment.