-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserRegisterationTest.java
52 lines (40 loc) · 1.54 KB
/
UserRegisterationTest.java
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
package tests;
import java.time.Duration;
import org.testng.Assert;
import org.testng.annotations.Test;
import pages.HomePage;
import pages.LoginPage;
import pages.UserRegisterationPage;
public class UserRegisterationTest extends TestBase {
HomePage homeObject;
UserRegisterationPage registerObject;
LoginPage loginObject;
@Test(priority=1,alwaysRun=true)
public void UserCanRegisterSuccessfully()
{
//Go to Home Page
homeObject=new HomePage(driver);
homeObject.openRegisterationPage();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
// Go to Register Page
registerObject=new UserRegisterationPage(driver);
registerObject.userRegistration("ahmedali","ahmedss70@gmail.com","01003331700","123456789");
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
// Go to Profile Data
loginObject=new LoginPage(driver);
loginObject.clickProfileLink();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
//Verify Name from profile data is displayed
Assert.assertTrue(loginObject.verifyName.getText().contains("ahmedali"));
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
}
// User can logout from web site
@Test(dependsOnMethods= {"UserCanRegisterSuccessfully"})
public void RegisteredUserCanLogout()
{
loginObject.userLogout();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
loginObject.clickProfileLink();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
}
}