test: allow to set login button selector
This commit is contained in:
parent
798aa29b45
commit
ff60a64131
1 changed files with 6 additions and 2 deletions
|
|
@ -295,6 +295,10 @@ in
|
||||||
type = str;
|
type = str;
|
||||||
default = "[Ll]ogin";
|
default = "[Ll]ogin";
|
||||||
};
|
};
|
||||||
|
loginButtonSelector = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = ''get_by_role("button", name=re.compile('${cfg.loginButtonNameRegex}'))'';
|
||||||
|
};
|
||||||
loginSpawnsNewPage = mkOption {
|
loginSpawnsNewPage = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
@ -412,8 +416,8 @@ in
|
||||||
|
|
||||||
# Assumes we don't need to login, so skip this.
|
# Assumes we don't need to login, so skip this.
|
||||||
if u['username'] is not None or u['password'] is not None:
|
if u['username'] is not None or u['password'] is not None:
|
||||||
print(f"Clicking button {testCfg['loginButtonNameRegex']}")
|
print("Clicking login button")
|
||||||
page.get_by_role("button", name=re.compile(testCfg['loginButtonNameRegex'])).click()
|
page.${cfg.loginButtonSelector}.click()
|
||||||
|
|
||||||
for line in u['nextPageExpect']:
|
for line in u['nextPageExpect']:
|
||||||
print(f"Running: {line}")
|
print(f"Running: {line}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue