Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 18, 2025
1 parent 0bcc28e commit 40631fd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.describe('UI Test', () => {
// logs.push(message.text());
// console.log(`Total logs captured: ${logs.length}`);
// });

// await page.goto();

// expect(logs.filter(s => s === 'Initializing OCC...')).toHaveLength(1);
Expand Down Expand Up @@ -50,11 +50,15 @@ test.describe('UI Test', () => {
});

for (const file of fileList) {
test(`Should be able to render ${file} without error`, async ({ browser }) => {
test(`Should be able to render ${file} without error`, async ({
browser
}) => {
const context = await browser.newContext();
const page = await context.newPage();

await page.goto(`lab/index.html?path=${file}`, {waitUntil: 'domcontentloaded'});
await page.goto(`lab/index.html?path=${file}`, {
waitUntil: 'domcontentloaded'
});
console.log('FILE LOADED');

await page.locator('div.jpcad-Spinner').waitFor({ state: 'hidden' });
Expand All @@ -68,10 +72,13 @@ test.describe('UI Test', () => {
// await page.sidebar.close('right');
await page.waitForTimeout(1000);

const main = await page.waitForSelector('#jp-main-split-panel', { state: 'visible', timeout: 10000 });
const main = await page.waitForSelector('#jp-main-split-panel', {
state: 'visible',
timeout: 10000
});

console.log('hurrayyyy', main);

console.log('hurrayyyy',main);

expect(errors).toBe(0);
if (main) {
expect(await main.screenshot()).toMatchSnapshot({

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error

1) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 670600 pixels (ratio 0.36 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error/Render-test-jcad-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error/Render-test-jcad-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error

1) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 659015 pixels (ratio 0.35 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error-retry1/Render-test-jcad-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error-retry1/Render-test-jcad-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error

2) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 623949 pixels (ratio 0.33 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error/Render-3M-CONNECTOR-STEP-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error/Render-3M-CONNECTOR-STEP-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error

2) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 623949 pixels (ratio 0.33 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error-retry1/Render-3M-CONNECTOR-STEP-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error-retry1/Render-3M-CONNECTOR-STEP-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error

3) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 609103 pixels (ratio 0.32 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error/Render-fan-stl-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error/Render-fan-stl-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error

3) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 609103 pixels (ratio 0.32 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error-retry1/Render-fan-stl-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error-retry1/Render-fan-stl-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error

1) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 184808 pixels (ratio 0.10 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error/Render-test-jcad-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error/Render-test-jcad-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error

1) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render test.jcad without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 185121 pixels (ratio 0.10 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error-retry1/Render-test-jcad-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f32dc-der-test-jcad-without-error-retry1/Render-test-jcad-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error

2) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 417324 pixels (ratio 0.22 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error/Render-3M-CONNECTOR-STEP-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error/Render-3M-CONNECTOR-STEP-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error

2) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render 3M_CONNECTOR.STEP without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 417140 pixels (ratio 0.22 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error-retry1/Render-3M-CONNECTOR-STEP-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-f3546-ONNECTOR-STEP-without-error-retry1/Render-3M-CONNECTOR-STEP-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error

3) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 420645 pixels (ratio 0.23 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error/Render-fan-stl-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error/Render-fan-stl-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43

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

View workflow job for this annotation

GitHub Actions / Integration tests Lite

tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error

3) tests/ui.spec.ts:53:11 › UI Test › File operations › Should be able to render fan.stl without error Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(Buffer).toMatchSnapshot(expected) Expected an image 1854px by 1028px, received 958px by 716px. 157946 pixels (ratio 0.09 of all image pixels) are different. Expected: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png Received: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error-retry1/Render-fan-stl-actual.png Diff: /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/test-results/tests-ui-UI-Test-File-oper-5e420-ender-fan-stl-without-error-retry1/Render-fan-stl-diff.png 82 | expect(errors).toBe(0); 83 | if (main) { > 84 | expect(await main.screenshot()).toMatchSnapshot({ | ^ 85 | name: `Render-${file}.png`, 86 | maxDiffPixelRatio: 0.01 87 | }); at /home/runner/work/JupyterCAD/JupyterCAD/ui-tests/tests/ui.spec.ts:84:43
Expand Down

0 comments on commit 40631fd

Please sign in to comment.