-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.java
More file actions
33 lines (26 loc) · 1.42 KB
/
Copy pathHomePage.java
File metadata and controls
33 lines (26 loc) · 1.42 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
package com.mitigram.web.pages;
import com.mitigram.web.framework.LocatorObject;
import com.mitigram.web.framework.browser.BrowserActions;
public class HomePage {
private final BrowserActions browserActions;
private static final String HOME_PAGE = "Home page ";
private static final String HOME_PAGE_URL = "https://mitigram.com/";
private static final LocatorObject LOGIN_LINK_HEADER = new LocatorObject("//header/nav[@class='right']//a[text()='Login']", LocatorObject.XPATH, HOME_PAGE + "> Header section > Login link");
private static final LocatorObject LOGIN_LINK_FOOTER = new LocatorObject("//footer/nav[@class='menu']//a[text()='Login']", LocatorObject.XPATH, HOME_PAGE + "> Footer section > Login link");
private static final LocatorObject CAREERS_LINK_HEADER = new LocatorObject("//header/nav//a[text()='Careers']", LocatorObject.XPATH, HOME_PAGE + "> Header section > Careers link");
public HomePage(BrowserActions browserActions) {
this.browserActions = browserActions;
}
public void goToMitigramHomePageByURL() {
browserActions.openURL(HOME_PAGE_URL);
}
public void navigateToLoginPageUsingHeader() {
browserActions.click(LOGIN_LINK_HEADER);
}
public void navigateToLoginPageUsingFooter() {
browserActions.click(LOGIN_LINK_FOOTER);
}
public void navigateToCareersPageUsingHeader() {
browserActions.click(CAREERS_LINK_HEADER);
}
}