Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/update-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: npm run test:update

- name: Upload failed screenshots as artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: failed_screenshots
Expand Down
19 changes: 16 additions & 3 deletions open-scd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IconButton } from '@material/mwc-icon-button';
import type { ListItem } from '@material/mwc-list/mwc-list-item.js';

import './open-scd.js';
import { expect } from '@open-wc/testing';
import { expect, waitUntil } from '@open-wc/testing';
import type { OpenSCD } from './open-scd.js';

import { Edit, newEditEvent, newOpenEvent } from './foundation.js';
Expand All @@ -16,6 +16,13 @@ function timeout(ms: number) {
return new Promise(res => setTimeout(res, ms * factor));
}

function isMenuFullyOpen(editor: OpenSCD) {
const rect = editor.menuUI?.shadowRoot
?.querySelector('aside.mdc-drawer--open')
?.getBoundingClientRect();
return rect && rect.x === 0 && rect.width <= 256;
}

mocha.timeout(2000 * factor);

const doc = new DOMParser().parseFromString(
Expand Down Expand Up @@ -52,7 +59,10 @@ allLocales.forEach(lang =>
beforeEach(async () => {
editor.setAttribute('locale', lang);
await editor.updateComplete;
expect(editor).to.have.property('locale', lang);
await waitUntil(
() => editor.locale === lang,
`setting locale to ${lang} failed`
);
});

it(`displays a top app bar`, async () => {
Expand All @@ -67,7 +77,10 @@ allLocales.forEach(lang =>
?.querySelector<IconButton>('mwc-icon-button[icon="menu"]')
?.click();

await editor.updateComplete;
await editor.menuUI?.updateComplete;
await waitUntil(() => isMenuFullyOpen(editor), 'menu did not appear', {
timeout: 3000,
});
await timeout(200);
await visualDiff(editor, `menu-drawer-${lang}`);
});
Expand Down
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
"typedoc": "^0.23.8",
"typescript": "^4.7.4"
},
"overrides": {
"playwright": {
".": "1.50.1",
"@web/test-runner-playwright": "0.11.0"
}
},
"customElements": "custom-elements.json",
"eslintConfig": {
"parser": "@typescript-eslint/parser",
Expand Down
Binary file modified screenshots/Chromium/baseline/app-bar-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/app-bar-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/document-name-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/document-name-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-selected-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-selected-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-with-doc-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/editor-plugins-with-doc-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-redone-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-redone-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-undone-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-entries-undone-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-screen-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/log-screen-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-drawer-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-drawer-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-plugins-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-plugins-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-plugins-triggered-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/menu-plugins-triggered-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/wizard-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Chromium/baseline/wizard-edit.png
Binary file modified screenshots/Chromium/baseline/wizard-fifo.png
Binary file modified screenshots/Chromium/baseline/wizard-subwizard.png
Binary file modified screenshots/Firefox/baseline/document-name-de.png
Binary file modified screenshots/Firefox/baseline/document-name-en.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-de.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-en.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-selected-de.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-selected-en.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-with-doc-de.png
Binary file modified screenshots/Firefox/baseline/editor-plugins-with-doc-en.png
Binary file modified screenshots/Firefox/baseline/log-entries-de.png
Binary file modified screenshots/Firefox/baseline/log-entries-en.png
Binary file modified screenshots/Firefox/baseline/log-entries-redone-de.png
Binary file modified screenshots/Firefox/baseline/log-entries-redone-en.png
Binary file modified screenshots/Firefox/baseline/log-entries-undone-de.png
Binary file modified screenshots/Firefox/baseline/log-entries-undone-en.png
Binary file modified screenshots/Firefox/baseline/log-screen-de.png
Binary file modified screenshots/Firefox/baseline/log-screen-en.png
Binary file modified screenshots/Firefox/baseline/menu-drawer-de.png
Binary file modified screenshots/Firefox/baseline/menu-drawer-en.png
Binary file modified screenshots/Firefox/baseline/menu-plugins-de.png
Binary file modified screenshots/Firefox/baseline/menu-plugins-en.png
Binary file modified screenshots/Firefox/baseline/menu-plugins-triggered-de.png
Binary file modified screenshots/Firefox/baseline/menu-plugins-triggered-en.png
Binary file modified screenshots/Firefox/baseline/wizard-create.png
Binary file modified screenshots/Firefox/baseline/wizard-edit.png
Binary file modified screenshots/Firefox/baseline/wizard-fifo.png
Binary file modified screenshots/Firefox/baseline/wizard-subwizard.png
Binary file modified screenshots/Webkit/baseline/app-bar-de.png
Binary file modified screenshots/Webkit/baseline/app-bar-en.png
Binary file modified screenshots/Webkit/baseline/document-name-de.png
Binary file modified screenshots/Webkit/baseline/document-name-en.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-de.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-en.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-selected-de.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-selected-en.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-with-doc-de.png
Binary file modified screenshots/Webkit/baseline/editor-plugins-with-doc-en.png
Binary file modified screenshots/Webkit/baseline/log-entries-de.png
Binary file modified screenshots/Webkit/baseline/log-entries-en.png
Binary file modified screenshots/Webkit/baseline/log-entries-redone-de.png
Binary file modified screenshots/Webkit/baseline/log-entries-redone-en.png
Binary file modified screenshots/Webkit/baseline/log-entries-undone-de.png
Binary file modified screenshots/Webkit/baseline/log-entries-undone-en.png
Binary file modified screenshots/Webkit/baseline/log-screen-de.png
Binary file modified screenshots/Webkit/baseline/log-screen-en.png
Binary file modified screenshots/Webkit/baseline/menu-drawer-de.png
Binary file modified screenshots/Webkit/baseline/menu-drawer-en.png
Binary file modified screenshots/Webkit/baseline/menu-plugins-de.png
Binary file modified screenshots/Webkit/baseline/menu-plugins-en.png
Binary file modified screenshots/Webkit/baseline/menu-plugins-triggered-de.png
Binary file modified screenshots/Webkit/baseline/menu-plugins-triggered-en.png
Binary file modified screenshots/Webkit/baseline/wizard-create.png
Binary file modified screenshots/Webkit/baseline/wizard-edit.png
Binary file modified screenshots/Webkit/baseline/wizard-fifo.png
Binary file modified screenshots/Webkit/baseline/wizard-subwizard.png
2 changes: 1 addition & 1 deletion web-test-runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
concurrentBrowsers: 3,

/** Amount of test files per browser to test concurrently */
concurrency: 2,
concurrency: 1,

/** Browsers to run tests on */
browsers,
Expand Down