-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathSeleniumTest.java
More file actions
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
package com.sdet.auto;
import com.sdet.auto.PageObjects.*;
import com.sdet.auto.TestHelper.AccessibilityHelper;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class SeleniumTest extends TestBaseClass{
@Test
public void TC0001_SmokeTest() {
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.VerifyOnHomePage(testAssert);
GuiHelper.closeWebBrowser();
}
@Test
public void TC0002_ForgetPasswordTest() {
final String email = "sdet.testautomation@gmail.com";
final String expectedMsg = "Your e-mail's been sent!";
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.ClickForgetPassword();
ForgetPasswordPage.EnterEmail(email);
ForgetPasswordPage.ClickRetrieveButton();
EmailSentPage.VerifyEmailSent(testAssert, expectedMsg);
GuiHelper.closeWebBrowser();
}
@Test
public void TC0003_FormAuthentication() {
final String userId = "tomsmith";
final String password = "SuperSecretPassword!";
final String expectedLoginMsg = "You logged into a secure area!";
final String expectedLogoutMsg = "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
public void TC0004_FormAuthenticationBadInfo() {
final String userId = "sdetAutomatiom";
final String password = "pass@word";
final String expectedMsg = "Your username is invalid!";
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
HomePage.clickFormAuthentication();
LoginPage.enterCredentials(userId, password);
LoginPage.verifyMessage(testAssert, expectedMsg);
GuiHelper.closeWebBrowser();
}
@Test
public void TC0005_A11y_Accessibility() {
GuiHelper.openWebBrowser();
Navigation.navToWebPageUnderTest();
AccessibilityHelper.basicAccessibilityCheck(testAssert);
GuiHelper.closeWebBrowser();
}
}