session token fix for captcha

This commit is contained in:
2026-10-09 12:39:32 +05:30
parent 385a9e22cc
commit d9218709f0
8 changed files with 76 additions and 23 deletions
+7 -1
View File
@@ -44,7 +44,13 @@ def create_session(driver, step, config):
@pytest.mark.session
@pytest.mark.parametrize("config", get_setup_configs("session"), ids=lambda c: c["product_name"])
def test_session(driver, test_context, config):
def test_session(driver, test_context, config, request):
# The full setup command runs session-only products (such as RA) through
# test_combined_setup.py so they share the same browser/login context.
invocation = " ".join(str(arg).replace("\\", "/") for arg in request.config.invocation_params.args)
if "tests/setup" in invocation and "tests/setup/sessions" not in invocation and "test_session.py" not in invocation:
pytest.skip("Handled by the shared full setup flow")
wait = WebDriverWait(driver, 20)
+5 -4
View File
@@ -31,8 +31,9 @@ def test_session_and_token_setup(driver, test_context, config):
if config.get("setup", {}).get("run_session", True):
create_session(driver, step, config)
for product_code in get_product_codes(token):
product_token = dict(token)
product_token["product_code"] = product_code
run_token_setup(driver, step, product_token)
if config.get("setup", {}).get("run_token", True):
for product_code in get_product_codes(token):
product_token = dict(token)
product_token["product_code"] = product_code
run_token_setup(driver, step, product_token)
+7 -1
View File
@@ -339,7 +339,13 @@ def create_and_activate_token(driver, step, token):
@pytest.mark.trading_token
@pytest.mark.parametrize("config", get_setup_configs("token"), ids=lambda c: c["product_name"])
def test_trading_token_creation(driver, test_context, config):
def test_trading_token_creation(driver, test_context, config, request):
# The full setup command runs token-enabled products through the combined
# flow so session and token creation use one browser/login context.
invocation = " ".join(str(arg).replace("\\", "/") for arg in request.config.invocation_params.args)
if "tests/setup" in invocation and "tests/setup/tokens" not in invocation and "test_trading_token.py" not in invocation:
pytest.skip("Handled by the shared full setup flow")
config, step, token = get_token_context(driver, test_context, config)
open_app_and_login(driver, step, config)