easycare.cuke.pageObjects.patient.PatientPhysicianConfirmAddUserPage.java Source code

Java tutorial

Introduction

Here is the source code for easycare.cuke.pageObjects.patient.PatientPhysicianConfirmAddUserPage.java

Source

package easycare.cuke.pageObjects.patient;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import easycare.cuke.Alias;
import easycare.cuke.pageObjects.PageUrls;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Alias(PageUrls.PATIENT_PHYSICIAN_CONFIRM_ADD_USER_URL)
public class PatientPhysicianConfirmAddUserPage extends AbstractPatientPhysicianConfirmAddPage {

    @FindBy(id = "physicianName")
    protected WebElement physicianName;

    @FindBy(id = "physicianLicenseNumber")
    protected WebElement physicianLicenseNumber;

    @Override
    protected String getUrl() {
        throw new IllegalStateException("dynamic url");
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<Map<String, String>> getDetailsOnPage() {
        Map<String, String> detailsRow = Maps.newHashMap();

        addOrgDetailsToPageDetails(detailsRow);
        detailsRow.put("Physician Name", physicianName.getText());
        try {
            detailsRow.put("Physician License number", physicianLicenseNumber.getText());
        } catch (NoSuchElementException ex) {
            detailsRow.put("Physician License number", "<BLANK>");
        }

        return Lists.newArrayList(detailsRow);
    }

}