Add product-specific session and token setup
This commit is contained in:
@@ -1,26 +1,19 @@
|
||||
import pytest
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
from tests.config_reader import is_combined_setup_enabled, load_config
|
||||
from tests.config_reader import get_setup_configs
|
||||
from tests.helpers import login, logout, save_session_backup
|
||||
from tests.setup.sessions.test_session import create_session
|
||||
from tests.setup.tokens.test_trading_token import create_and_activate_token, get_product_codes
|
||||
from tests.step_actions import StepActions
|
||||
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
not is_combined_setup_enabled(),
|
||||
reason="Combined setup requires setup.run_session and setup.run_token to both be true",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.session
|
||||
@pytest.mark.trading_token
|
||||
def test_session_and_token_setup(driver, test_context):
|
||||
@pytest.mark.parametrize("config", get_setup_configs("combined"), ids=lambda c: c["product_name"])
|
||||
def test_session_and_token_setup(driver, test_context, config):
|
||||
|
||||
config = load_config()
|
||||
token = config.get("trading_token_idas")
|
||||
assert token, "Add trading_token_idas in config.json before running token setup."
|
||||
token = config["token"]
|
||||
|
||||
wait = WebDriverWait(driver, 20)
|
||||
step = StepActions(driver, wait, test_context)
|
||||
|
||||
Reference in New Issue
Block a user