Skip to content

Commit 5c0da83

Browse files
authored
πŸ› [e2e] Fix tests, 3rd attempt (#6740)
1 parent 625d2cb commit 5c0da83

File tree

30 files changed

+69
-61
lines changed

30 files changed

+69
-61
lines changed

β€Žservices/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.jsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
195195
__centerLayout: null,
196196
_resourceType: null,
197197
_resourcesList: null,
198-
_topBar: null,
199198
_toolbar: null,
200199
_searchBarFilter: null,
201200
__viewModeLayout: null,

β€Žservices/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.jsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
991991
this.invalidateStudies();
992992
this._resourcesContainer.setResourcesToList([]);
993993

994+
this._toolbar.show();
994995
if (context === "search") {
995996
this.__reloadFolders();
996997
this.__reloadStudies();
997998
} else if (context === "workspaces") {
999+
this._toolbar.hide();
9981000
this._searchBarFilter.resetFilters();
9991001
this.__reloadWorkspaces();
10001002
} else if (context === "studiesAndFolders") {

β€Žservices/static-webserver/client/source/class/osparc/desktop/WorkbenchView.jsβ€Ž

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,15 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
752752
__iFrameChanged: function(node) {
753753
this.__iframePage.removeAll();
754754

755-
const loadingPage = node.getLoadingPage();
756-
const iFrame = node.getIFrame();
757-
const src = iFrame.getSource();
758-
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
759-
this.__iframePage.add(iFrameView, {
760-
flex: 1
761-
});
755+
if (node) {
756+
const loadingPage = node.getLoadingPage();
757+
const iFrame = node.getIFrame();
758+
const src = iFrame.getSource();
759+
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
760+
this.__iframePage.add(iFrameView, {
761+
flex: 1
762+
});
763+
}
762764
},
763765

764766
__populateSecondaryColumn: function(node) {

β€Žservices/static-webserver/client/source/class/osparc/node/slideshow/NodeView.jsβ€Ž

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
143143
this._iFrameLayout.removeAll();
144144

145145
const node = this.getNode();
146-
147-
const loadingPage = node.getLoadingPage();
148-
const iFrame = node.getIFrame();
149-
const src = iFrame.getSource();
150-
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
151-
this._iFrameLayout.add(iFrameView, {
152-
flex: 1
153-
});
146+
if (node) {
147+
const loadingPage = node.getLoadingPage();
148+
const iFrame = node.getIFrame();
149+
const src = iFrame.getSource();
150+
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
151+
this._iFrameLayout.add(iFrameView, {
152+
flex: 1
153+
});
154+
}
154155
}
155156
}
156157
});

β€Žservices/static-webserver/client/source/class/osparc/viewer/NodeViewer.jsβ€Ž

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,16 @@ qx.Class.define("osparc.viewer.NodeViewer", {
9393
__iFrameChanged: function() {
9494
this._removeAll();
9595

96-
const iframeHandler = this.getNode().getIframeHandler();
97-
98-
const loadingPage = iframeHandler.getLoadingPage();
99-
const iFrame = iframeHandler.getIFrame();
100-
const src = iFrame.getSource();
101-
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
102-
this._add(iFrameView, {
103-
flex: 1
104-
});
96+
if (this.getNode() && this.getNode().getIframeHandler()) {
97+
const iframeHandler = this.getNode().getIframeHandler();
98+
const loadingPage = iframeHandler.getLoadingPage();
99+
const iFrame = iframeHandler.getIFrame();
100+
const src = iFrame.getSource();
101+
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
102+
this._add(iFrameView, {
103+
flex: 1
104+
});
105+
}
105106
},
106107

107108
__attachSocketEventHandlers: function() {

β€Žtests/e2e-playwright/tests/conftest.pyβ€Ž

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212
import random
1313
import re
14+
import time
1415
import urllib.parse
1516
from collections.abc import Callable, Iterator
1617
from contextlib import ExitStack
@@ -443,6 +444,7 @@ def _(
443444
re.compile(r"/projects/[^:]+:open"), timeout=timeout + 5 * SECOND
444445
) as response_info,
445446
):
447+
open_with_resources_clicked = False
446448
# Project detail view pop-ups shows
447449
if press_open:
448450
open_button = page.get_by_test_id("openResource")
@@ -451,11 +453,13 @@ def _(
451453
open_button.click()
452454
# Open project with default resources
453455
open_button = page.get_by_test_id("openWithResources")
456+
time.sleep(2) # wait until the study options are filled up
454457
# it returns a Long Running Task
455458
with page.expect_response(
456459
re.compile(rf"/projects\?from_study\={template_id}")
457460
) as lrt:
458461
open_button.click()
462+
open_with_resources_clicked = True
459463
lrt_data = lrt.value.json()
460464
lrt_data = lrt_data["data"]
461465
with log_context(
@@ -495,7 +499,15 @@ def wait_for_done(response):
495499
open_button.click()
496500
if is_product_billable:
497501
# Open project with default resources
498-
page.get_by_test_id("openWithResources").click()
502+
open_button = page.get_by_test_id("openWithResources")
503+
time.sleep(2) # wait until the study options are filled up
504+
open_button.click()
505+
open_with_resources_clicked = True
506+
if is_product_billable and not open_with_resources_clicked:
507+
# Open project with default resources
508+
open_button = page.get_by_test_id("openWithResources")
509+
time.sleep(2) # wait until the study options are filled up
510+
open_button.click()
499511
project_data = response_info.value.json()
500512
assert project_data
501513
project_uuid = project_data["data"]["uuid"]

β€Žtests/e2e/portal-files/VTK_file.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function runTutorial () {
6060
await utils.takeScreenshot(page, screenshotPrefix + 'teapot');
6161
}
6262
catch(err) {
63-
await tutorial.setTutorialFailed(true);
63+
await tutorial.setTutorialFailed();
6464
console.log('Tutorial error: ' + err);
6565
}
6666
finally {

β€Žtests/e2e/portal/2D_Plot.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function runTutorial () {
5151
await utils.takeScreenshot(page, screenshotPrefix + 'iFrame2');
5252
}
5353
catch(err) {
54-
await tutorial.setTutorialFailed(true);
54+
await tutorial.setTutorialFailed();
5555
console.log('Tutorial error: ' + err);
5656
}
5757
finally {

β€Žtests/e2e/portal/3D_Anatomical.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function runTutorial () {
3939
await tutorial.checkNodeOutputs(1, outFiles);
4040
}
4141
catch(err) {
42-
await tutorial.setTutorialFailed(true);
42+
await tutorial.setTutorialFailed();
4343
console.log('Tutorial error: ' + err);
4444
}
4545
finally {

β€Žtests/e2e/portal/3D_EM.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function runTutorial () {
3939
await tutorial.checkNodeOutputs(2, outFiles);
4040
}
4141
catch(err) {
42-
await tutorial.setTutorialFailed(true);
42+
await tutorial.setTutorialFailed();
4343
console.log('Tutorial error: ' + err);
4444
}
4545
finally {

0 commit comments

Comments
Β (0)