diff --git a/services/static-webserver/client/source/class/osparc/study/StudyOptions.js b/services/static-webserver/client/source/class/osparc/study/StudyOptions.js index 5b0fd30cadb1..0ceef6fde4e5 100644 --- a/services/static-webserver/client/source/class/osparc/study/StudyOptions.js +++ b/services/static-webserver/client/source/class/osparc/study/StudyOptions.js @@ -130,6 +130,8 @@ qx.Class.define("osparc.study.StudyOptions", { control = new qx.ui.form.TextField().set({ maxWidth: 220 }); + control.addListener("changeValue", () => this.__evaluateOpenButton()); + osparc.utils.Utils.setIdToWidget(control, "studyTitleField"); this.getChildControl("title-layout").add(control); break; case "wallet-selector-layout": @@ -140,6 +142,7 @@ qx.Class.define("osparc.study.StudyOptions", { control = osparc.desktop.credits.Utils.createWalletSelector("read").set({ allowGrowX: false }); + control.addListener("changeSelection", () => this.__evaluateOpenButton()); this.getChildControl("wallet-selector-layout").add(control); break; case "advanced-layout": @@ -226,7 +229,8 @@ qx.Class.define("osparc.study.StudyOptions", { minWidth: 150, maxWidth: 150, height: 35, - center: true + center: true, + enabled: false, }); osparc.utils.Utils.setIdToWidget(control, "openWithResources"); this.getChildControl("buttons-layout").addAt(control, 1); @@ -275,14 +279,20 @@ qx.Class.define("osparc.study.StudyOptions", { } }); } + }, - this.getChildControl("open-button").setEnabled(Boolean(wallet)); + __evaluateOpenButton: function() { + const hasTitle = Boolean(this.getChildControl("title-field").getValue()); + const walletSelected = Boolean(this.getChildControl("wallet-selector").getSelection().length); + this.getChildControl("open-button").setEnabled(hasTitle && walletSelected); }, __buildLayout: function() { this.__buildTopSummaryLayout(); this.__buildOptionsLayout(); this.__buildButtons(); + + this.__evaluateOpenButton(); }, __buildTopSummaryLayout: function() { diff --git a/tests/e2e-playwright/tests/conftest.py b/tests/e2e-playwright/tests/conftest.py index 665ba78d774f..ca2ec5a579e1 100644 --- a/tests/e2e-playwright/tests/conftest.py +++ b/tests/e2e-playwright/tests/conftest.py @@ -11,7 +11,6 @@ import os import random import re -import time import urllib.parse from collections.abc import Callable, Iterator from contextlib import ExitStack @@ -463,7 +462,6 @@ def _( open_button.click() # Open project with default resources open_button = page.get_by_test_id("openWithResources") - time.sleep(2) # wait until the study options are filled up # it returns a Long Running Task with page.expect_response( re.compile(rf"/projects\?from_study\={template_id}") @@ -510,13 +508,11 @@ def wait_for_done(response): if is_product_billable: # Open project with default resources open_button = page.get_by_test_id("openWithResources") - time.sleep(2) # wait until the study options are filled up open_button.click() open_with_resources_clicked = True if is_product_billable and not open_with_resources_clicked: # Open project with default resources open_button = page.get_by_test_id("openWithResources") - time.sleep(2) # wait until the study options are filled up open_button.click() project_data = response_info.value.json() assert project_data