Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test de playwright #204

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ dist/extension/manifest.json
# Docs
/docs/css/boosted.css
/docs/css/orange-helvetica.css
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
2 changes: 1 addition & 1 deletion build/terser.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const files = {
'dist/js/app/shared/settings/text-transform.component.js',
'dist/js/app/shared/btn-modal.component.js',
'dist/js/app/shared/btn-setting.component.js',
'dist/js/app/shared/header.component.js',
'dist/js/app/shared/header/header.component.js',
'dist/js/app/shared/icon.component.js',
'dist/js/app/shared/select-mode.component.js',
'dist/js/app/pages/edit-setting/edit-setting.component.js',
Expand Down
2 changes: 1 addition & 1 deletion dist/extension/assets/icons/orange-icons-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/extension/css/styles.min.css

Large diffs are not rendered by default.

41 changes: 18 additions & 23 deletions dist/extension/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
function P(a, b, d, f) {
var c = window.ShadyDOM;
if (a.shadyDomFastWalk && c && c.inUse) {
if (b.nodeType === Node.ELEMENT_NODE && d(b), b.querySelectorAll) for (a = c.nativeMethods.querySelectorAll.call(b, "*"),
if (b.nodeType === Node.ELEMENT_NODE && d(b), b.querySelectorAll) for (a = c.nativeMethods.querySelectorAll.call(b, "*"),
b = 0; b < a.length; b++) d(a[b]);
} else M(b, d, f);
}
Expand Down Expand Up @@ -205,7 +205,7 @@
if (e.localName !== d) throw Error("Failed to construct '" + d + "': The constructed element's local name is incorrect.");
return e;
} catch (g) {
return X(g), b = null === f ? n.call(b, d) : p.call(b, f, d), Object.setPrototypeOf(b, HTMLUnknownElement.prototype),
return X(g), b = null === f ? n.call(b, d) : p.call(b, f, d), Object.setPrototypeOf(b, HTMLUnknownElement.prototype),
b.__CE_state = 2, b.__CE_definition = void 0, R(a, b), b;
}
b = null === f ? n.call(b, d) : p.call(b, f, d);
Expand All @@ -214,7 +214,7 @@
}
function X(a) {
var b = "", d = "", f = 0, c = 0;
a instanceof Error ? (b = a.message, d = a.sourceURL || a.fileName || "", f = a.line || a.lineNumber || 0,
a instanceof Error ? (b = a.message, d = a.sourceURL || a.fileName || "", f = a.line || a.lineNumber || 0,
c = a.column || a.columnNumber || 0) : b = "Uncaught " + String(a);
var e = void 0;
void 0 === ErrorEvent.prototype.initErrorEvent ? e = new ErrorEvent("error", {
Expand All @@ -224,7 +224,7 @@
lineno: f,
colno: c,
error: a
}) : (e = document.createEvent("ErrorEvent"), e.initErrorEvent("error", !1, !0, b, d, f),
}) : (e = document.createEvent("ErrorEvent"), e.initErrorEvent("error", !1, !0, b, d, f),
e.preventDefault = function() {
Object.defineProperty(this, "defaultPrevented", {
configurable: !0,
Expand Down Expand Up @@ -261,7 +261,7 @@
this.h = a;
this.g = b;
V(this.h, this.g);
"loading" === this.g.readyState && (this.l = new MutationObserver(this.G.bind(this)),
"loading" === this.g.readyState && (this.l = new MutationObserver(this.G.bind(this)),
this.l.observe(this.g, {
childList: !0,
subtree: !0
Expand Down Expand Up @@ -525,8 +525,8 @@
var l = this.previousSibling;
e.call(this, h, k);
g(l || this.parentNode.firstChild, this);
} else if ("afterbegin" === h) l = this.firstChild, e.call(this, h, k), g(this.firstChild, l); else if ("beforeend" === h) l = this.lastChild,
e.call(this, h, k), g(l || this.firstChild, null); else if ("afterend" === h) l = this.nextSibling,
} else if ("afterbegin" === h) l = this.firstChild, e.call(this, h, k), g(this.firstChild, l); else if ("beforeend" === h) l = this.lastChild,
e.call(this, h, k), g(l || this.firstChild, null); else if ("afterend" === h) l = this.nextSibling,
e.call(this, h, k), g(this.nextSibling, l); else throw new SyntaxError("The value provided (" + String(h) + ") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");
};
}
Expand Down Expand Up @@ -601,7 +601,7 @@
var f = document.__CE_registry.C.get(d);
if (!f) throw Error("Failed to construct a custom element: The constructor was not registered with `customElements`.");
var c = f.constructionStack;
if (0 === c.length) return c = n.call(document, f.localName), Object.setPrototypeOf(c, d.prototype),
if (0 === c.length) return c = n.call(document, f.localName), Object.setPrototypeOf(c, d.prototype),
c.__CE_state = 1, c.__CE_definition = f, R(a, c), c;
var e = c.length - 1, g = c[e];
if (g === Fa) throw Error("Failed to construct '" + f.localName + "': This element was already constructed.");
Expand Down Expand Up @@ -1108,6 +1108,10 @@ class PauseService {
name: "marginAlign",
instanceService: marginAlignServiceInstance.setMargin.bind(this),
value: ""
}, {
name: "navigationAuto",
instanceService: navigationAutoServiceInstance.setNavigationAuto.bind(this),
value: ""
}, {
name: "navigationButtons",
instanceService: navigationButtonsServiceInstance.setNavigationButtons.bind(this),
Expand Down Expand Up @@ -2434,20 +2438,14 @@ class NavigationAutoService {
this.handler = this.createHandler();
}
setNavigationAuto=value => {
this.resetAutoFocus();
window.removeEventListener("focus", this.handler);
this.clearIntervalFocus();
if (value !== DEFAULT_VALUE) {
this.initializeFocusTracking();
window.addEventListener("focus", this.handler, true);
let delay = Number(value.split("_")[1]) * 1e3;
this.setAutoFocus(delay);
this.setIntervalFocus(delay);
}
};
setAutoFocus=delay => {
this.setIntervalFocus(delay);
};
resetAutoFocus=() => {
window.removeEventListener("focus", this.handler);
this.clearInterval();
};
focusElement=() => {
const not = {
inert: ":not([inert]):not([inert] *)",
Expand All @@ -2470,15 +2468,12 @@ class NavigationAutoService {
this.focusElement();
}), delay);
};
clearInterval=() => {
clearIntervalFocus=() => {
if (this.timer !== null) {
clearInterval(this.timer);
this.timer = null;
}
};
initializeFocusTracking() {
window.addEventListener("focus", this.handler, true);
}
createHandler() {
return event => {
if (event.target) {
Expand Down Expand Up @@ -5150,4 +5145,4 @@ customElements.define("app-toolbar", ToolbarComponent);

const appRootElt = document.createElement("app-root");

document.body.prepend(appRootElt);
document.body.prepend(appRootElt);
4 changes: 2 additions & 2 deletions dist/extension/js/toolbar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/extension/js/toolbar.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/serveur/assets/icons/orange-icons-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/serveur/css/styles.min.css

Large diffs are not rendered by default.

25 changes: 10 additions & 15 deletions dist/serveur/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ class PauseService {
name: "marginAlign",
instanceService: marginAlignServiceInstance.setMargin.bind(this),
value: ""
}, {
name: "navigationAuto",
instanceService: navigationAutoServiceInstance.setNavigationAuto.bind(this),
value: ""
}, {
name: "navigationButtons",
instanceService: navigationButtonsServiceInstance.setNavigationButtons.bind(this),
Expand Down Expand Up @@ -1685,20 +1689,14 @@ class NavigationAutoService {
this.handler = this.createHandler();
}
setNavigationAuto=value => {
this.resetAutoFocus();
window.removeEventListener("focus", this.handler);
this.clearIntervalFocus();
if (value !== DEFAULT_VALUE) {
this.initializeFocusTracking();
window.addEventListener("focus", this.handler, true);
let delay = Number(value.split("_")[1]) * 1e3;
this.setAutoFocus(delay);
this.setIntervalFocus(delay);
}
};
setAutoFocus=delay => {
this.setIntervalFocus(delay);
};
resetAutoFocus=() => {
window.removeEventListener("focus", this.handler);
this.clearInterval();
};
focusElement=() => {
const not = {
inert: ":not([inert]):not([inert] *)",
Expand All @@ -1721,15 +1719,12 @@ class NavigationAutoService {
this.focusElement();
}), delay);
};
clearInterval=() => {
clearIntervalFocus=() => {
if (this.timer !== null) {
clearInterval(this.timer);
this.timer = null;
}
};
initializeFocusTracking() {
window.addEventListener("focus", this.handler, true);
}
createHandler() {
return event => {
if (event.target) {
Expand Down Expand Up @@ -4401,4 +4396,4 @@ customElements.define("app-toolbar", ToolbarComponent);

const appRootElt = document.createElement("app-root");

document.body.prepend(appRootElt);
document.body.prepend(appRootElt);
4 changes: 2 additions & 2 deletions dist/serveur/js/toolbar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/serveur/js/toolbar.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/icons/orange-icons-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/css/styles.min.css

Large diffs are not rendered by default.

Binary file added docs/fonts/HelvNeue55_W1G.woff2
Binary file not shown.
Binary file added docs/fonts/HelvNeue75_W1G.woff2
Binary file not shown.
25 changes: 10 additions & 15 deletions docs/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ class PauseService {
name: "marginAlign",
instanceService: marginAlignServiceInstance.setMargin.bind(this),
value: ""
}, {
name: "navigationAuto",
instanceService: navigationAutoServiceInstance.setNavigationAuto.bind(this),
value: ""
}, {
name: "navigationButtons",
instanceService: navigationButtonsServiceInstance.setNavigationButtons.bind(this),
Expand Down Expand Up @@ -1685,20 +1689,14 @@ class NavigationAutoService {
this.handler = this.createHandler();
}
setNavigationAuto=value => {
this.resetAutoFocus();
window.removeEventListener("focus", this.handler);
this.clearIntervalFocus();
if (value !== DEFAULT_VALUE) {
this.initializeFocusTracking();
window.addEventListener("focus", this.handler, true);
let delay = Number(value.split("_")[1]) * 1e3;
this.setAutoFocus(delay);
this.setIntervalFocus(delay);
}
};
setAutoFocus=delay => {
this.setIntervalFocus(delay);
};
resetAutoFocus=() => {
window.removeEventListener("focus", this.handler);
this.clearInterval();
};
focusElement=() => {
const not = {
inert: ":not([inert]):not([inert] *)",
Expand All @@ -1721,15 +1719,12 @@ class NavigationAutoService {
this.focusElement();
}), delay);
};
clearInterval=() => {
clearIntervalFocus=() => {
if (this.timer !== null) {
clearInterval(this.timer);
this.timer = null;
}
};
initializeFocusTracking() {
window.addEventListener("focus", this.handler, true);
}
createHandler() {
return event => {
if (event.target) {
Expand Down Expand Up @@ -4401,4 +4396,4 @@ customElements.define("app-toolbar", ToolbarComponent);

const appRootElt = document.createElement("app-root");

document.body.prepend(appRootElt);
document.body.prepend(appRootElt);
4 changes: 2 additions & 2 deletions docs/js/toolbar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/toolbar.min.js.map

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"postinstall": "shx cp -r node_modules/@webcomponents/custom-elements/custom-elements.min.js src/extension/vendors",
"start": "concurrently --kill-others \"npm:watch\" \"npm:serve\"",
"serve": "servor docs/ index.html 9010 --browse --reload",
"test": "",
"test": "npx playwright test",
"mkdir": "shx mkdir -p dist/css dist/serveur/assets/fonts/ dist/extension/assets/fonts/ dist/extension/js/",
"prebuild": "shx rm -rf dist/* && npm run mkdir",
"build": "npm run copy && concurrently \"npm:build:*\"",
Expand Down Expand Up @@ -90,6 +90,7 @@
"load:chrome": "cross-env-shell web-ext run --source-dir ./dist/extension --start-url=$npm_package_config_page --target chromium --devtools"
},
"devDependencies": {
"@playwright/test": "^1.45.1",
"@types/chrome": "^0.0.268",
"@types/node": "^20.14.2",
"autoprefixer": "^10.4.19",
Expand Down
Loading