Last active
December 31, 2015 15:54
-
-
Save sayems/09d0d1ce2e15095474a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.namely.selectors.id; | |
| import org.openqa.selenium.By; | |
| import java.util.function.Supplier; | |
| import static org.openqa.selenium.By.id; | |
| /** | |
| * Created by sayem on 12/30/15. | |
| */ | |
| public enum EmployeeId implements Supplier<By> { | |
| FIRST_NAME(""), | |
| LAST_NAME(""), | |
| SSN(""), | |
| GENDER(""), | |
| MARITAL_STATUS(""), | |
| EMPLOYEE_NUMBER(""), | |
| BIRTH_DATE(""), | |
| HIRE_DATE(""), | |
| REHIRE_DATE(""), | |
| TERMINATION_DATE(""), | |
| TERMINATION_REASON(""), | |
| REVIEW_DATE(""), | |
| STREET_ONE(""), | |
| STREET_TWO(""), | |
| CITY(""), | |
| STATE(""), | |
| ZIP_CODE(""), | |
| ALLOW_LOGIN(""), | |
| INCLUDE_IN_PAYROLL(""), | |
| JOB_TITLE(""), | |
| POSITION(""), | |
| PAY_GROUP(""), | |
| EEOC(""), | |
| WORKER_COMP(""), | |
| EMPLOYEE_TAX_TYPE(""), | |
| TAX_TYPE_ACCOUNT_NUMBER(""), | |
| RACE_ETHINICITY(""), | |
| TEXT_EMPLOYEE(""); | |
| private final By by; | |
| EmployeeId(String id) { | |
| this.by = id(id); | |
| } | |
| /** | |
| * @return the by instance variable which is a ById. | |
| */ | |
| @Override | |
| public By get() { | |
| return by; | |
| } | |
| @Override | |
| public String toString() { | |
| return by.toString(); | |
| } | |
| } | |
| Page.class | |
| ========== | |
| default Locator<Element, Element> mouseOver() { | |
| return element -> { | |
| mouseOver(element); | |
| return element; | |
| }; | |
| } | |
| @Override | |
| default void mouseOver(Element element) { | |
| Actionable.super.mouseOver(element); | |
| } | |
| default void dragAndDrop(Supplier<By> from, Supplier<By> to) { | |
| dragAndDrop(from.get(), to.get()); | |
| } | |
| default String getTitle() { | |
| try { | |
| return Locators.<Page<T>>optionalElement(ClassName.PAGE_TITLE) | |
| .andThen(OptionalGetter.GET).andThen(GetText.TEXT).locate(this); | |
| } catch (Exception e) { | |
| return ""; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment