Skip to content

Commit 4e9358e

Browse files
committed
adds --product-billable
1 parent 3085edc commit 4e9358e

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

tests/e2e-playwright/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ define run_test
168168
pytest -s $2 \
169169
--color=yes \
170170
--browser chromium \
171-
--headed \
172171
$$TEST_ARGS
173172
endef
174173

tests/e2e-playwright/tests/conftest.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ def pytest_addoption(parser: pytest.Parser) -> None:
7979
default=False,
8080
help="Whether product is billable or not",
8181
)
82+
group.addoption(
83+
"--product-lite",
84+
action="store_true",
85+
default=False,
86+
help="Whether product is lite version or not",
87+
)
8288
group.addoption(
8389
"--autoscaled",
8490
action="store_true",
@@ -227,13 +233,19 @@ def user_password(
227233

228234

229235
@pytest.fixture(scope="session")
230-
def product_billable(request: pytest.FixtureRequest) -> bool:
236+
def is_product_billable(request: pytest.FixtureRequest) -> bool:
231237
billable = request.config.getoption("--product-billable")
232238
return TypeAdapter(bool).validate_python(billable)
233239

234240

235241
@pytest.fixture(scope="session")
236-
def autoscaled(request: pytest.FixtureRequest) -> bool:
242+
def is_product_lite(request: pytest.FixtureRequest) -> bool:
243+
enabled = request.config.getoption("--product-lite")
244+
return TypeAdapter(bool).validate_python(enabled)
245+
246+
247+
@pytest.fixture(scope="session")
248+
def is_autoscaled(request: pytest.FixtureRequest) -> bool:
237249
autoscaled = request.config.getoption("--autoscaled")
238250
return TypeAdapter(bool).validate_python(autoscaled)
239251

@@ -392,7 +404,7 @@ def log_in_and_out(
392404
def create_new_project_and_delete(
393405
page: Page,
394406
log_in_and_out: WebSocket,
395-
product_billable: bool,
407+
is_product_billable: bool,
396408
api_request_context: APIRequestContext,
397409
product_url: AnyUrl,
398410
) -> Iterator[Callable[[tuple[RunningState], bool], dict[str, Any]]]:
@@ -411,7 +423,7 @@ def _(
411423
), "misuse of this fixture! only 1 study can be opened at a time. Otherwise please modify the fixture"
412424
with log_context(
413425
logging.INFO,
414-
f"Open project in {product_url=} as {product_billable=}",
426+
f"Open project in {product_url=} as {is_product_billable=}",
415427
) as ctx:
416428
waiter = SocketIOProjectStateUpdatedWaiter(expected_states=expected_states)
417429
timeout = (
@@ -473,7 +485,7 @@ def wait_for_done(response):
473485
...
474486
else:
475487
open_button.click()
476-
if product_billable:
488+
if is_product_billable:
477489
# Open project with default resources
478490
page.get_by_test_id("openWithResources").click()
479491
project_data = response_info.value.json()
@@ -512,7 +524,7 @@ def wait_for_done(response):
512524
for project_uuid in created_project_uuids:
513525
with log_context(
514526
logging.INFO,
515-
f"Delete project with {project_uuid=} in {product_url=} as {product_billable=}",
527+
f"Delete project with {project_uuid=} in {product_url=} as {is_product_billable=}",
516528
):
517529
response = api_request_context.delete(
518530
f"{product_url}v0/projects/{project_uuid}"

tests/e2e-playwright/tests/sim4life/test_sim4life.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_sim4life(
3131
log_in_and_out: WebSocket,
3232
service_key: str,
3333
use_plus_button: bool,
34-
autoscaled: bool,
34+
is_autoscaled: bool,
3535
check_videostreaming: bool,
3636
):
3737
if use_plus_button:
@@ -49,7 +49,11 @@ def test_sim4life(
4949
assert len(node_ids) == 1, "Expected 1 node in the workbench!"
5050

5151
resp = wait_for_launched_s4l(
52-
page, node_ids[0], log_in_and_out, autoscaled=autoscaled, copy_workspace=False
52+
page,
53+
node_ids[0],
54+
log_in_and_out,
55+
autoscaled=is_autoscaled,
56+
copy_workspace=False,
5357
)
5458
s4l_websocket = resp["websocket"]
5559
with web_socket_default_log_handler(s4l_websocket):

tests/e2e-playwright/tests/sim4life/test_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_template(
2424
create_project_from_template_dashboard: Callable[[str], dict[str, Any]],
2525
log_in_and_out: WebSocket,
2626
template_id: str,
27-
autoscaled: bool,
27+
is_autoscaled: bool,
2828
check_videostreaming: bool,
2929
):
3030
project_data = create_project_from_template_dashboard(template_id)
@@ -37,7 +37,7 @@ def test_template(
3737
assert len(node_ids) == 1, "Expected 1 node in the workbench!"
3838

3939
resp = wait_for_launched_s4l(
40-
page, node_ids[0], log_in_and_out, autoscaled=autoscaled, copy_workspace=True
40+
page, node_ids[0], log_in_and_out, autoscaled=is_autoscaled, copy_workspace=True
4141
)
4242
s4l_websocket = resp["websocket"]
4343
with web_socket_default_log_handler(s4l_websocket):

tests/e2e-playwright/tests/tip/test_ti_plan.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ def __call__(self, message: str) -> bool:
8686
return False
8787

8888

89-
def test_tip( # noqa: PLR0915
89+
def test_classic_ti_plan( # noqa: PLR0915
9090
page: Page,
9191
create_tip_plan_from_dashboard: Callable[[str], dict[str, Any]],
9292
log_in_and_out: WebSocket,
93-
autoscaled: bool,
93+
is_autoscaled: bool,
9494
):
9595
project_data = create_tip_plan_from_dashboard("newTIPlanButton")
9696
assert "workbench" in project_data, "Expected workbench to be in project data!"
@@ -108,7 +108,7 @@ def test_tip( # noqa: PLR0915
108108
websocket=log_in_and_out,
109109
timeout=(
110110
_ELECTRODE_SELECTOR_AUTOSCALED_MAX_STARTUP_TIME
111-
if autoscaled
111+
if is_autoscaled
112112
else _ELECTRODE_SELECTOR_MAX_STARTUP_TIME
113113
),
114114
press_start_button=False,
@@ -155,7 +155,7 @@ def test_tip( # noqa: PLR0915
155155
timeout=_OUTER_EXPECT_TIMEOUT_RATIO
156156
* (
157157
_JLAB_AUTOSCALED_MAX_STARTUP_TIME
158-
if autoscaled
158+
if is_autoscaled
159159
else _JLAB_MAX_STARTUP_MAX_TIME
160160
),
161161
) as ws_info:
@@ -165,7 +165,7 @@ def test_tip( # noqa: PLR0915
165165
websocket=log_in_and_out,
166166
timeout=(
167167
_JLAB_AUTOSCALED_MAX_STARTUP_TIME
168-
if autoscaled
168+
if is_autoscaled
169169
else _JLAB_MAX_STARTUP_MAX_TIME
170170
),
171171
press_start_button=False,
@@ -218,7 +218,7 @@ def test_tip( # noqa: PLR0915
218218
websocket=log_in_and_out,
219219
timeout=(
220220
_POST_PRO_AUTOSCALED_MAX_STARTUP_TIME
221-
if autoscaled
221+
if is_autoscaled
222222
else _POST_PRO_MAX_STARTUP_TIME
223223
),
224224
press_start_button=False,

0 commit comments

Comments
 (0)