-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecuritytests.cs
More file actions
48 lines (37 loc) · 1.57 KB
/
Copy pathSecuritytests.cs
File metadata and controls
48 lines (37 loc) · 1.57 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
using NUnit.Framework;
using Securitytesting.Factories;
using Securitytesting.Helpers;
using Securitytesting.Pages;
namespace Securitytesting
{
[TestFixture]
public class Securitytests : SecuritytestsBase
{
[Test]
public void VulnerabilityScanBeforeLogin()
{
Client.Pscan.EnableAllScanners(ApiKey);
Driver.Navigate().GoToUrl(Target);
var apiResponse = ScanHelper.StartSpider(Client);
ScanHelper.WaitForTaskToComplete(apiResponse, Client.Spider.GetStatus);
apiResponse = ScanHelper.StartAscan(Client);
ScanHelper.WaitForTaskToComplete(apiResponse, Client.Ascan.GetStatus);
AlertHelper.PrintAlertsToConsole(Client.Core.GetAlerts(Target));
}
[Test]
public void VulnerabilityScanAfterLogin()
{
Client.Pscan.EnableAllScanners(ApiKey);
Driver.Navigate().GoToUrl(Target + "insecure/public/Login.jsp");
var loginPage = PageObjectFactory.GetInitializedPageObject<LoginPage>(Driver);
loginPage.SendKeysToLoginField("admin");
loginPage.SendKeysToPasswordField("secret");
loginPage.PressLoginButton();
var apiResponse = ScanHelper.StartSpider(Client);
ScanHelper.WaitForTaskToComplete(apiResponse, Client.Spider.GetStatus);
apiResponse = ScanHelper.StartAscan(Client);
ScanHelper.WaitForTaskToComplete(apiResponse, Client.Ascan.GetStatus);
AlertHelper.PrintAlertsToConsole(Client.Core.GetAlerts(Target));
}
}
}