-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBHGContingentApprovalTwoPricingGroupsSteps.cs
325 lines (282 loc) · 16.3 KB
/
BHGContingentApprovalTwoPricingGroupsSteps.cs
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
using System;
using BHG.Test.MasterFramework.BHGBaseObjects;
using BHG.Test.MasterFramework.BHGHelpers;
using BHG.Test.MasterFramework.Utilities;
using BHGVision.Pages;
using System.Configuration;
using NUnit.Framework;
namespace BHGVision.Test
{
public class BHGContingentApprovalTwoPricingGroupsSteps : BHGBaseSteps
{
public void Setup()
{
DatabaseHelper._visionDBConnect();
}
//Go to Vision Created loan application
//[Given(@"I have created loan application")]
public void GivenIHaveCreatedLoanApplication()
{
Browser.Current.Navigate().GoToUrl(ConfigurationManager.AppSettings["seleniumBaseUrl"]);
Browser.Current.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
_CurrentPage = GetInstance<BHGLogin>();
_CurrentPage.As<BHGLogin>().ClickAutoLogin();
_CurrentPage = GetInstance<BHGMenu>();
DriverWait.WaitForPageLoaded();
_CurrentPage.As<BHGMenu>().ViewApplicationsAll.Click();
DriverWait.WaitForPageLoaded();
_CurrentPage.As<BHGMenu>().QuickSearchValueLastName.SendKeys("222680");//This is for the application Number
_CurrentPage.As<BHGMenu>().QuickSearchGo.Click();
}
//[Given(@"I Complete the Gaurantor information with pricing group one fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupOneFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0"
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
// [When(@"I click the score button")]
public void WhenIClickTheScoreButton()
{
_CurrentPage.As<BHGApplicationPage>().ClickScoreButton();
DriverWait.WaitForPageLoaded();
_CurrentPage.As<BHGApplicationPage>().ClickScoreButton();
DriverWait.WaitForPageLoaded();
}
// [Then(@"the result should be pricing group one")]
public void ThenTheResultShouldBePricingGroupOne()
{
//Assert pricing group 1
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupOne();
}
//Test to cover the pricing group two
// [Given(@"I Complete the Gaurantor information with pricing group two fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupTwoFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0" ///Change CBR request to match gaurantor on app
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
// [Then(@"the result should be pricing group two")]
public void ThenTheResultShouldBePricingGroupTwo()
{
//Assert pricing group 2
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupTwo();
}
//Test to cover the pricing group three
// [Given(@"I Complete the Gaurantor information with pricing group three fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupThreeFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0" ///Change CBR request to match gaurantor on app
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
//[Then(@"the result should be pricing group three")]
public void ThenTheResultShouldBePricingGroupThree()
{
//Assert pricing group 3
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupThree();
}
//Test to cover the pricing group four
// [Given(@"I Complete the Gaurantor information with pricing group four fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupFourFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0" ///Change CBR request to match gaurantor on app
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
// [Then(@"the result should be pricing group four")]
public void ThenTheResultShouldBePricingGroupFour()
{
//Assert pricing group 4
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupFour();
}
//Test to cover the pricing group six
// [Given(@"I Complete the Gaurantor information with pricing group six fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupSixFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0" ///Change CBR request to match gaurantor on app
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
//[Then(@"the result should be pricing group six")]
public void ThenTheResultShouldBePricingGroupSix()
{
//Assert pricing group 6
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupSix();
}
//Test to cover the pricing group seven
// [Given(@"I Complete the Gaurantor information with pricing group seven fico")]
public void GivenICompleteTheGaurantorInformationWithPricingGroupSevenFico()
{
//Clear program filters
clearFilters();
//Set active credit app to 0
noActiveCBRGaurantor();
//Set active gaurantor on credit app non active
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"PDATE dbo.tGuarantorCBReport
SET active = 1
WHERE ApplicationNum = '222680' and
CBRRequestGUID = '1165192' and Active = 0" ///Change CBR request to match gaurantor on app
);
//Clear gaurantor details
_CurrentPage = GetInstance<BHGApplicationPage>();
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorSSN.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorPostalCode.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorAddress1.Clear();
_CurrentPage.As<BHGApplicationPage>().guarantorCity.Clear();
//Guarantor Application details
_CurrentPage.As<BHGApplicationPage>().guarantorFirstName.SendKeys("JAIME");
_CurrentPage.As<BHGApplicationPage>().guarantorLastName.SendKeys("LLAMAS");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorPersonalInformation("President", "07/11/1980", "666189203", "[email protected]");
_CurrentPage.As<BHGApplicationPage>().CompleteGuarantorAddress("364 BOONE AV", "WINCHESTER", "Kentucky", "40391");
}
// [Then(@"the result should be pricing group seven")]
public void ThenTheResultShouldBePricingGroupSeven()
{
//Assert pricing group 7
_CurrentPage.As<BHGApplicationPage>().VerifyContingentTwoPricingGroupSeven();
}
#region
public void clearFilters()
{
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@" DECLARE @ApplicationNum int = 222680
UPDATE sub8900.tApplication8900
SET ScreenResultCore = NULL,
PaystubQualified = NULL,
ScreenResultAF = NULL,
ScreenResultAMI = NULL,
ScreenResultNewLogic = NULL,
SBAQualified = NULL,
ScreenResultWeekly = NULL,
ScreenResultTPFMessage = NULL,
DTIfromCBR = NULL,
ScreenResultCreditCard = NULL,
ScreenResultNote = NULL
WHERE ApplicationNum = @ApplicationNum
UPDATE sub8900.tGuarantor8900
SET ScreenResultCreditCard = NULL,
DTIPlain = NULL
WHERE ApplicationNum = @ApplicationNum");
}
public void noActiveCBRGaurantor()
{
DatabaseHelper.SqlExecuteCommand("Data Source=BHG-DC1-STGSQL;" + "Initial Catalog=Vision;" + "Integrated Security=True;",
@"UPDATE dbo.tGuarantorCBReport
SET active =0
WHERE ApplicationNum='222680' and Active=1"
);
}
#endregion
}
}