-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgentHRPage.java
More file actions
34 lines (27 loc) · 1.08 KB
/
AgentHRPage.java
File metadata and controls
34 lines (27 loc) · 1.08 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
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class AgentHRPage {
private WebDriver driver;
public AgentHRPage(WebDriver driver)
{
if(driver.getTitle().equals("Invitations"))
this.driver = driver;
else
throw new IllegalStateException("This is not the agent HR page page:" + driver.getCurrentUrl());
}
public LoginPage logout()
{
driver.get("https://alpha.insynctiveapps.com/Insynctive.Hub/Logout.aspx");
return new LoginPage(driver);
}
public void addPerson(String name, String surname, String email, boolean selfservice)
{
driver.findElement(By.id("tds_body_mainTab_TPTCR_btnAddPerson_0")).click();
driver.findElement(By.id("tds_body_popupAddPerson_txtFirstName_I")).sendKeys(name);
driver.findElement(By.id("tds_body_popupAddPerson_txtLastName_I")).sendKeys(surname);
driver.findElement(By.id("tds_body_popupAddPerson_txtEmail_I")).sendKeys(email);
if(selfservice)
driver.findElement(By.id("tds_body_popupAddPerson_chkInvite_S_D")).click();
driver.findElement(By.id("tds_body_popupAddPerson_btnAddHRAdmin_CD")).click();
}
}