-
Notifications
You must be signed in to change notification settings - Fork 622
Expand file tree
/
Copy pathPages.fs
More file actions
221 lines (182 loc) · 5.79 KB
/
Pages.fs
File metadata and controls
221 lines (182 loc) · 5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
module Pages
open canopy
module TopMenu =
let private Campaigns = "Campaigns"
let private Admin = "li.dropdown-admin a"
let private AdminCampaigns = "a[href='/Admin/Campaign']"
let private AdminOrganizations = "a[href='/Admin/Organization']"
let SelectAdminCampaigns _ =
hover Admin
sleep 1
click AdminCampaigns
let SelectAdminOrganizations _ =
hover Admin
sleep 1
click AdminOrganizations
let SelectCampaigns _ =
click Campaigns
module AdminOrganizations =
let RelativeUrl = "Admin/Organization"
module Campaigns =
let RelativeUrl = "Campaign"
let private CreateNew = "Create Campaign"
let SelectCreateNew _ =
click CreateNew
module AdminCampaigns =
let RelativeUrl = "Admin/Campaign"
let private CreateNew = "#CreateNew"
let SelectCreateNew _ =
click CreateNew
module AdminCampaignCreate =
type CampaignDetails = {
Name:string
Description:string
Headline:string
FullDescription:string
OrganizationName:string
Address1:string
City:string
State:string
PostalCode:int
Country:string
}
let DefaultCampaignDetails = {
Name = ""
Description = ""
FullDescription = ""
Headline = ""
OrganizationName = ""
Address1="1 Microsoft Way"
City="Redmond"
State="WA"
PostalCode=98052
Country="US"
}
let private createBtn = "Create"
let Submit _ =
click createBtn
let PopulateCampaignDetails details =
"#Name" << details.Name
"#Description" << details.Description
"#Headline" << details.Headline
press tab
let insertFullDescriptionScript = sprintf "tinyMCE.activeEditor.setContent('%s')" details.FullDescription
js(insertFullDescriptionScript) |> ignore
"#OrganizationId" << details.OrganizationName
check "#Published"
"#Location_Address1" << details.Address1
"#Location_City" << details.City
"#Location_State" << details.State
"#Location_PostalCode" << details.PostalCode.ToString()
"#Location_Country" << details.Country
module AdminCampaignDetails =
let RelativeUrl = "Admin/Campaign/Details"
let private createNew = "a[href^='/Admin/Event/Create/']"
let CreateNewEvent _ =
click createNew
module AdminOrganizationCreate =
let privicyPolicyFieldVisible () =
(elements "#pp-url").Length = 1
type OrganizationDetails = {
Name:string
WebUrl:string
LogoUrl:string
Address1:string
City:string
State:string
PostalCode:int
Country:string
PrivacyPolicyUrl:string
}
let DefaultOrganizationDetails = {
Name = ""
WebUrl=""
LogoUrl=""
Address1="1 Microsoft Way"
City="Redmond"
State="WA"
PostalCode=98052
Country="US"
PrivacyPolicyUrl="http://putsomethinghere.com"
}
let PopulateOrganizationDetails details =
"#LogoUrl" << details.LogoUrl
"#Name" << details.Name
"#WebUrl" << details.WebUrl
"#Location_Address1" << details.Address1
"#Location_City" << details.City
"#Location_State" << details.State
"#Location_PostalCode" << details.PostalCode.ToString()
"#Location_Country" << details.Country
click "#show-pp-url"
waitFor <| fadedIn "#PrivacyPolicyUrl"
"#PrivacyPolicyUrl" << details.PrivacyPolicyUrl
let Save _ =
click "Create"
module AdminEventCreate =
type EventDetails = {
Name:string
StartDate:System.DateTime
EndDate:System.DateTime
EventType: int
City:string
State:string
PostalCode:int
Country:string
Address1:string
}
let DefaultEventDetails = {
Name = ""
StartDate = System.DateTime.Now.AddDays(1.0)
EndDate = System.DateTime.Now.AddDays(5.0)
EventType = 2
City="Redmond"
State="WA"
PostalCode=98052
Country="US"
Address1="Address Goes Here"
}
let PopulateEventdetails details =
"#Name" << details.Name
"#StartDateTime" << details.StartDate.ToString("MM/dd/yyyy")
"#EndDateTime" << details.EndDate.ToString("MM/dd/yyyy")
"#EventType" << details.EventType.ToString()
"#Location_City" << details.City
"#Location_State" << details.State
"#Location_PostalCode" << details.PostalCode.ToString()
"#Location_Country" << details.Country
"#Location_Address1" << details.Address1
let private createBtn = ".submit-form"
let Create _ =
click createBtn
module AdminTaskCreate =
type TaskDetails = {
Name:string
Description:string
VolunteersRequired:int
StartDate:System.DateTime
EndDate:System.DateTime
}
let DefaultTaskDetails = {
Name = ""
Description = ""
VolunteersRequired = 1
StartDate = System.DateTime.Now.AddDays(1.0)
EndDate = System.DateTime.Now.AddDays(4.0)
}
let PopulateTaskDetails details =
"#Name" << details.Name
"#Description" << details.Description
"#NumberOfVolunteersRequired" << details.VolunteersRequired.ToString()
"#StartDateTime" << details.StartDate.ToString("MM/dd/yyyy h:mm tt")
"#EndDateTime" << details.EndDate.ToString("MM/dd/yyyy h:mm tt")
let private createBtn = "Save"
let Create _ =
click createBtn
module AdminEventDetails =
let RelativeUrl = "Admin/Event/Details"
let private createNew = "Create Task"
let CreateNewTask _ =
click createNew
module AdminTaskDetails =
let RelativeUrl = "Admin/Task/Details"