auto-OrangeHRM / src / test / java / pages / DashBoardPage.java
DashBoardPage.java
Raw
package pages;

import org.openqa.selenium.WebDriver;

public class DashBoardPage extends BasePage {
	
	private String topBar = "//div[@class='oxd-topbar-header-title']";
	private String userDropdown = "//span[@class='oxd-userdropdown-tab']";
	private String logOutButton = "//a[normalize-space()='Logout']";
	private String modulePIM = "//body[1]/div[1]/div[1]/div[1]/aside[1]/nav[1]/div[2]/ul[1]/li[2]/a[1]";
	private String rightArrow = "//i[@class='oxd-icon bi-chevron-right']";
	private String adminSection = "//span[normalize-space()='Admin']";
	private String leaveSection = "//span[normalize-space()='Leave']";
	private String timeSection = "//span[normalize-space()='Time']";
	private String recruitmentSection = "//span[normalize-space()='Recruitment']";
	private String myInfoSection = "//span[normalize-space()='My Info']";
	private String performanceSection = "//span[normalize-space()='Performance']";
	private String directorySection = "//span[normalize-space()='Directory']";
	private String maintenanceSection = "//span[normalize-space()='Maintenance']";
	private String claimSection = "//span[normalize-space()='Claim']";
	private String buzzSection = "//span[normalize-space()='Buzz']";
	
	
	public DashBoardPage(WebDriver driver){
		super(driver);
	}

	/**
	 * Metodo que permite el cierre de sesión, no utiliza etiqueta "Select" sino "Span"
	 */
	public void logOut() {
		clickElement(userDropdown);
		clickElement(logOutButton);
	}

	public void clickRightArrow() {
		clickElement(rightArrow); 
	}
	
	public void clickModulePIM() {
		clickElement(modulePIM);
	}

	public void clickAdminSection() {
		clickElement(adminSection);		
	}

	public void clickLeaveSection() {
		clickElement(leaveSection);		
	}

	public void clickTimeSection() {
		clickElement(timeSection);
	}

	public void clickRecruitmentSection() {
		clickElement(recruitmentSection);
	}

	public void clickMyInfoSection() {
		clickElement(myInfoSection);
	}

	public void clickPerformanceSection() {
		clickElement(performanceSection);
		
	}

	public void clickDirectorySection() {
		clickElement(directorySection);
	}

	public void clickMaintenanceSection() {
		clickElement(maintenanceSection);
	}

	public void clickClaimSection() {
		clickElement(claimSection);
	}

	public void clickBuzzSection() {
		clickElement(buzzSection);
		
	}
	
	public String textFromTopBar() {
		return textFromElement(topBar);
	}
	
}