-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTestPageFactory.java
More file actions
82 lines (73 loc) · 2.78 KB
/
Copy pathTestPageFactory.java
File metadata and controls
82 lines (73 loc) · 2.78 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
80
81
82
package testcase;
import helper.ButtonHelper;
import helper.StartWebDriver;
import helper.WindowHelper;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
* @project - Webdriver
* @package - testcase
* @file name - TestPageFactory.java
*/
public class TestPageFactory extends StartWebDriver {
@Test(priority=1)
public void testLogin() throws Exception {
WindowHelper.navigateToPage(file.getUrl());
file_a_Bug.click();
/*username_text_box.sendKeys("rahul@bugzila.com");
password_textbox.sendKeys("welcome");
login_button.click();*/
Bugzilla_login.sendKeys(file.getUsername());
Bugzilla_password.sendKeys(file.getPassword());
log_in.click();
/*LinkHelper.clickLink("File");
TextBoxHelper.typeInTextBox("Bugzilla_login", "rahul@bugzila.com");
TextBoxHelper.typeInTextBox("Bugzilla_password", "welcome");
ButtonHelper.clickButton("log_in");*/
Assert.assertTrue(driver.getTitle().contains("Enter Bug"));
//ButtonHelper.clickButton("//div[@id='header']/ul[1]/li[11]/a");
logout_button.click();
}
@Test(priority=2)
public void testPreferences() throws Exception {
/*LinkHelper.clickLink("File");
TextBoxHelper.typeInTextBox("Bugzilla_login", "rahul@bugzila.com");
TextBoxHelper.typeInTextBox("Bugzilla_password", "welcome");
ButtonHelper.clickButton("log_in");*/
WindowHelper.navigateToPage(file.getUrl());
file_a_Bug.click();
/*username_text_box.sendKeys("rahul@bugzila.com");
password_textbox.sendKeys("welcome");
login_button.click();*/
Bugzilla_login.sendKeys(file.getUsername());
Bugzilla_password.sendKeys(file.getPassword());
log_in.click();
Assert.assertTrue(driver.getTitle().contains("Enter Bug"));
ButtonHelper.clickButton("//div[@id='header']/ul[1]/li[8]/a");
Assert.assertTrue(driver.getTitle().contains("Preferences"));
//ButtonHelper.clickButton("//div[@id='header']/ul[1]/li[11]/a");
logout_button.click();
}
@Test(priority=3)
public void testAdministration() throws Exception {
/*LinkHelper.clickLink("File");
TextBoxHelper.typeInTextBox("Bugzilla_login", "rahul@bugzila.com");
TextBoxHelper.typeInTextBox("Bugzilla_password", "welcome");
ButtonHelper.clickButton("log_in");*/
WindowHelper.navigateToPage(file.getUrl());
file_a_Bug.click();
/*username_text_box.sendKeys("rahul@bugzila.com");
password_textbox.sendKeys("welcome");
login_button.click();*/
Bugzilla_login.sendKeys(file.getUsername());
Bugzilla_password.sendKeys(file.getPassword());
log_in.click();
Assert.assertTrue(driver.getTitle().contains("Enter Bug"));
ButtonHelper.clickButton("//div[@id='header']/ul[1]/li[9]/a");
Assert.assertTrue(driver.getTitle().contains("Administer"));
//ButtonHelper.clickButton("//div[@id='header']/ul[1]/li[11]/a");
logout_button.click();
}
}