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] Study Options: Open button #6775

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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":
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 0 additions & 4 deletions tests/e2e-playwright/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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
Expand Down
Loading