Skip to content

Commit dce6a40

Browse files
authored
🐛 [e2e] Study Options: Open button (#6775)
1 parent f76be28 commit dce6a40

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

services/static-webserver/client/source/class/osparc/study/StudyOptions.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ qx.Class.define("osparc.study.StudyOptions", {
130130
control = new qx.ui.form.TextField().set({
131131
maxWidth: 220
132132
});
133+
control.addListener("changeValue", () => this.__evaluateOpenButton());
134+
osparc.utils.Utils.setIdToWidget(control, "studyTitleField");
133135
this.getChildControl("title-layout").add(control);
134136
break;
135137
case "wallet-selector-layout":
@@ -140,6 +142,7 @@ qx.Class.define("osparc.study.StudyOptions", {
140142
control = osparc.desktop.credits.Utils.createWalletSelector("read").set({
141143
allowGrowX: false
142144
});
145+
control.addListener("changeSelection", () => this.__evaluateOpenButton());
143146
this.getChildControl("wallet-selector-layout").add(control);
144147
break;
145148
case "advanced-layout":
@@ -226,7 +229,8 @@ qx.Class.define("osparc.study.StudyOptions", {
226229
minWidth: 150,
227230
maxWidth: 150,
228231
height: 35,
229-
center: true
232+
center: true,
233+
enabled: false,
230234
});
231235
osparc.utils.Utils.setIdToWidget(control, "openWithResources");
232236
this.getChildControl("buttons-layout").addAt(control, 1);
@@ -275,14 +279,20 @@ qx.Class.define("osparc.study.StudyOptions", {
275279
}
276280
});
277281
}
282+
},
278283

279-
this.getChildControl("open-button").setEnabled(Boolean(wallet));
284+
__evaluateOpenButton: function() {
285+
const hasTitle = Boolean(this.getChildControl("title-field").getValue());
286+
const walletSelected = Boolean(this.getChildControl("wallet-selector").getSelection().length);
287+
this.getChildControl("open-button").setEnabled(hasTitle && walletSelected);
280288
},
281289

282290
__buildLayout: function() {
283291
this.__buildTopSummaryLayout();
284292
this.__buildOptionsLayout();
285293
this.__buildButtons();
294+
295+
this.__evaluateOpenButton();
286296
},
287297

288298
__buildTopSummaryLayout: function() {

tests/e2e-playwright/tests/conftest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import os
1212
import random
1313
import re
14-
import time
1514
import urllib.parse
1615
from collections.abc import Callable, Iterator
1716
from contextlib import ExitStack
@@ -463,7 +462,6 @@ def _(
463462
open_button.click()
464463
# Open project with default resources
465464
open_button = page.get_by_test_id("openWithResources")
466-
time.sleep(2) # wait until the study options are filled up
467465
# it returns a Long Running Task
468466
with page.expect_response(
469467
re.compile(rf"/projects\?from_study\={template_id}")
@@ -510,13 +508,11 @@ def wait_for_done(response):
510508
if is_product_billable:
511509
# Open project with default resources
512510
open_button = page.get_by_test_id("openWithResources")
513-
time.sleep(2) # wait until the study options are filled up
514511
open_button.click()
515512
open_with_resources_clicked = True
516513
if is_product_billable and not open_with_resources_clicked:
517514
# Open project with default resources
518515
open_button = page.get_by_test_id("openWithResources")
519-
time.sleep(2) # wait until the study options are filled up
520516
open_button.click()
521517
project_data = response_info.value.json()
522518
assert project_data

0 commit comments

Comments
 (0)