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

🐛 [e2e] Fix tests, 3rd attempt #6740

Merged
merged 11 commits into from
Nov 18, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
__centerLayout: null,
_resourceType: null,
_resourcesList: null,
_topBar: null,
_toolbar: null,
_searchBarFilter: null,
__viewModeLayout: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
this.invalidateStudies();
this._resourcesContainer.setResourcesToList([]);

this._toolbar.show();
if (context === "search") {
this.__reloadFolders();
this.__reloadStudies();
} else if (context === "workspaces") {
this._toolbar.hide();
this._searchBarFilter.resetFilters();
this.__reloadWorkspaces();
} else if (context === "studiesAndFolders") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,15 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
__iFrameChanged: function(node) {
this.__iframePage.removeAll();

const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this.__iframePage.add(iFrameView, {
flex: 1
});
if (node) {
const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this.__iframePage.add(iFrameView, {
flex: 1
});
}
},

__populateSecondaryColumn: function(node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
this._iFrameLayout.removeAll();

const node = this.getNode();

const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this._iFrameLayout.add(iFrameView, {
flex: 1
});
if (node) {
const loadingPage = node.getLoadingPage();
const iFrame = node.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this._iFrameLayout.add(iFrameView, {
flex: 1
});
}
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ qx.Class.define("osparc.viewer.NodeViewer", {
__iFrameChanged: function() {
this._removeAll();

const iframeHandler = this.getNode().getIframeHandler();

const loadingPage = iframeHandler.getLoadingPage();
const iFrame = iframeHandler.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this._add(iFrameView, {
flex: 1
});
if (this.getNode() && this.getNode().getIframeHandler()) {
const iframeHandler = this.getNode().getIframeHandler();
const loadingPage = iframeHandler.getLoadingPage();
const iFrame = iframeHandler.getIFrame();
const src = iFrame.getSource();
const iFrameView = (src === null || src === "about:blank") ? loadingPage : iFrame;
this._add(iFrameView, {
flex: 1
});
}
},

__attachSocketEventHandlers: function() {
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e-playwright/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ def _(
re.compile(r"/projects/[^:]+:open"), timeout=timeout + 5 * SECOND
) as response_info,
):
open_with_resources_clicked = False
# Project detail view pop-ups shows
if press_open:
open_button = page.get_by_test_id("openResource")
Expand All @@ -456,6 +457,7 @@ def _(
re.compile(rf"/projects\?from_study\={template_id}")
) as lrt:
open_button.click()
open_with_resources_clicked = True
lrt_data = lrt.value.json()
lrt_data = lrt_data["data"]
with log_context(
Expand Down Expand Up @@ -496,6 +498,10 @@ def wait_for_done(response):
if is_product_billable:
# Open project with default resources
page.get_by_test_id("openWithResources").click()
open_with_resources_clicked = True
if is_product_billable and not open_with_resources_clicked:
# Open project with default resources
page.get_by_test_id("openWithResources").click()
project_data = response_info.value.json()
assert project_data
project_uuid = project_data["data"]["uuid"]
Expand Down
Loading