- Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathSeleniumTest.java
More file actions
Latest commit
79 lines (62 loc) · 2.43 KB
/
Copy pathSeleniumTest.java
File metadata and controls
79 lines (62 loc) · 2.43 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
packagecom.sdet.auto;
importcom.sdet.auto.PageObjects.*;
importcom.sdet.auto.TestHelper.AccessibilityHelper;
importorg.junit.FixMethodOrder;
importorg.junit.Test;
importorg.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
publicclassSeleniumTestextendsTestBaseClass{
@Test
publicvoidTC0001_SmokeTest() {
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.VerifyOnHomePage(testAssert);
GuiHelper.closeWebBrowser();
}
@Test
publicvoidTC0002_ForgetPasswordTest() {
finalStringemail = "sdet.testautomation@gmail.com";
finalStringexpectedMsg = "Your e-mail's been sent!";
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.ClickForgetPassword();
ForgetPasswordPage.EnterEmail(email);
ForgetPasswordPage.ClickRetrieveButton();
EmailSentPage.VerifyEmailSent(testAssert, expectedMsg);
GuiHelper.closeWebBrowser();
}
@Test
publicvoidTC0003_FormAuthentication() {
finalStringuserId = "tomsmith";
finalStringpassword = "SuperSecretPassword!";
finalStringexpectedLoginMsg = "You logged into a secure area!";
finalStringexpectedLogoutMsg = "You logged out of the secure area!";
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.clickFormAuthentication();
LoginPage.enterCredentials(userId, password);
SecureAreaPage.verifyMessage(testAssert, expectedLoginMsg);
SecureAreaPage.clickLogoutButton();
LoginPage.verifyMessage(testAssert, expectedLogoutMsg);
GuiHelper.closeWebBrowser();
}
@Test
publicvoidTC0004_FormAuthenticationBadInfo() {
finalStringuserId = "sdetAutomatiom";
finalStringpassword = "pass@word";
finalStringexpectedMsg = "Your username is invalid!";
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.clickFormAuthentication();
LoginPage.enterCredentials(userId, password);
LoginPage.verifyMessage(testAssert, expectedMsg);
GuiHelper.closeWebBrowser();
}
@Test
publicvoidTC0005_A11y_Accessibility() {
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
AccessibilityHelper.basicAccessibilityCheck(testAssert);
GuiHelper.closeWebBrowser();
}
}