Skip to content

Commit 1388d44

Browse files
authored
✨ e2e: playwright frontend (#5717)
1 parent 390afe1 commit 1388d44

File tree

18 files changed

+476
-3
lines changed

18 files changed

+476
-3
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"ObjectPattern": {
4444
"multiline": true,
45-
"minProperties": 1
45+
"minProperties": 3
4646
}
4747
}
4848
],

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Makefile @pcrespov @sanderegg
3838
/services/static-webserver/client/ @jsaq007 @odeimaiz @ignapas
3939
/services/storage/ @sanderegg
4040
/services/web/server/ @pcrespov @sanderegg @GitHK @matusdrobuliak66
41+
/tests/e2e-frontend/ @odeimaiz
4142
/tests/e2e-playwright/ @matusdrobuliak66
4243
/tests/environment-setup/ @pcrespov
4344
/tests/performance/ @pcrespov @sanderegg

services/static-webserver/client/source/class/osparc/data/model/Workbench.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ qx.Class.define("osparc.data.model.Workbench", {
286286
}
287287
};
288288
await osparc.data.Resources.fetch("studies", "addNode", params).catch(err => {
289-
let errorMsg = this.tr("Error creating ") + key + ":" + version;
289+
let errorMsg = qx.locale.Manager.tr("Error creating ") + key + ":" + version;
290290
if ("status" in err && err.status === 406) {
291-
errorMsg = key + ":" + version + this.tr(" is retired");
291+
errorMsg = key + ":" + version + qx.locale.Manager.tr(" is retired");
292292
}
293293
const errorMsgData = {
294294
msg: errorMsg,

services/static-webserver/client/source/class/osparc/store/Support.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ qx.Class.define("osparc.store.Support", {
163163
const createAccountWindow = new osparc.ui.window.Dialog("Create Account").set({
164164
maxWidth: 380
165165
});
166+
osparc.utils.Utils.setIdToWidget(createAccountWindow, "createAccountWindow");
166167
const vendor = osparc.store.VendorInfo.getInstance().getVendor();
167168
if ("invitation_url" in vendor) {
168169
const displayName = osparc.store.StaticInfo.getInstance().getDisplayName();

services/static-webserver/client/source/class/osparc/ui/basic/PoweredByOsparc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ qx.Class.define("osparc.ui.basic.PoweredByOsparc", {
2424
construct: function() {
2525
this.base(arguments);
2626

27+
osparc.utils.Utils.setIdToWidget(this, "poweredByOsparc");
28+
2729
this._setLayout(new qx.ui.layout.VBox(2));
2830

2931
this.set({

tests/e2e-frontend/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/playwright-report/
3+
/test-results/
4+
users.json

tests/e2e-frontend/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
install-dev:
2+
npm install
3+
4+
.PHONY: run-tests
5+
run-tests: install-dev ## run tests headless
6+
npx playwright test
7+
8+
.PHONY: run-tests-headed
9+
run-tests-headed: install-dev ## run tests headed (you can see what's going on)
10+
npx playwright test --headed
11+
12+
.PHONY: run-tests-ui
13+
run-tests-ui: install-dev ## run tests headed with an assistance GUI
14+
npx playwright test --ui

tests/e2e-frontend/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# e2e tests using [playwright](https://playwright.dev/) for testing mainly the frontend against the master deployment
2+
3+
## Install dependencies
4+
npm install
5+
6+
## Run tests
7+
npm run tests
8+
9+
## Run one test
10+
npx playwright test tests/init/statics.spec.js
11+
12+
13+
## Products
14+
Tets will run against the urls (products) defined in the products.json file
15+
16+
## Users
17+
In order to provide a list of users, required for some tests, copy users.template.json to users.json and fill up the details

tests/e2e-frontend/package-lock.json

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e-frontend/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "e2e-frontend",
3+
"version": "1.0.0",
4+
"description": "Run test locally with headed mode",
5+
"main": "index.js",
6+
"directories": {
7+
"test": "tests"
8+
},
9+
"scripts": {
10+
"tests": "npx playwright test",
11+
"tests-headed": "npx playwright test --headed",
12+
"tests-ui": "npx playwright test --ui"
13+
},
14+
"keywords": [],
15+
"author": "",
16+
"license": "ISC",
17+
"devDependencies": {
18+
"@playwright/test": "^1.43.1",
19+
"@types/node": "^20.12.7"
20+
}
21+
}

0 commit comments

Comments
 (0)