File tree 2 files changed +38
-5
lines changed
2 files changed +38
-5
lines changed Original file line number Diff line number Diff line change 248
248
print(f"Filling field {testCfg['passwordFieldLabelRegex']} with {u['password']}")
249
249
page.get_by_label(re.compile(testCfg['passwordFieldLabelRegex'])).fill(u['password'])
250
250
251
- print(f"Clicking button {testCfg['loginButtonNameRegex']}")
252
- page.get_by_role("button", name=re.compile(testCfg['loginButtonNameRegex'])).click()
251
+ # Assumes we don't need to login, so skip this.
252
+ if u['username'] is not None and u['password'] is not None:
253
+ print(f"Clicking button {testCfg['loginButtonNameRegex']}")
254
+ page.get_by_role("button", name=re.compile(testCfg['loginButtonNameRegex'])).click()
253
255
254
256
for line in u['nextPageExpect']:
255
257
print(f"Running: {line}")
Original file line number Diff line number Diff line change 43
43
} ;
44
44
45
45
basic = appname : { config , ... } : {
46
+ imports = [
47
+ testLib . baseModule
48
+ ../../modules/services/arr.nix
49
+ ] ;
50
+
46
51
test = {
47
52
subdomain = appname ;
48
53
} ;
55
60
} ;
56
61
} ;
57
62
63
+ clientLogin = appname : { config , ... } : {
64
+ imports = [
65
+ testLib . baseModule
66
+ testLib . clientLoginModule
67
+ ] ;
68
+
69
+ test = {
70
+ subdomain = appname ;
71
+ } ;
72
+
73
+ test . login = {
74
+ startUrl = "http://${ config . test . fqdn } " ;
75
+ usernameFieldLabelRegex = "[Uu]sername" ;
76
+ passwordFieldLabelRegex = "^ *[Pp]assword" ;
77
+ loginButtonNameRegex = "[Ll]og [Ii]n" ;
78
+ testLoginWith = [
79
+ { nextPageExpect = [
80
+ "expect(page).to_have_title(re.compile('${ appname } ', re.IGNORECASE))"
81
+ ] ; }
82
+ ] ;
83
+ } ;
84
+ } ;
85
+
58
86
basicTest = appname : cfgPathFn : pkgs . testers . runNixOSTest {
59
87
name = "arr_${ appname } _basic" ;
60
88
61
- nodes . server = { config , pkgs , ... } : {
89
+ nodes . client = {
90
+ imports = [
91
+ ( clientLogin appname )
92
+ ] ;
93
+ } ;
94
+ nodes . server = {
62
95
imports = [
63
- testLib . baseModule
64
- ../../modules/services/arr.nix
65
96
( basic appname )
66
97
] ;
67
98
} ;
You can’t perform that action at this time.
0 commit comments