package com.nuevaeps.webapp.test;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.support.ui.Select;

public class some {

    @Test
    public static void AutorizacionesFecha() {
        

    System.setProperty("webdriver.chrome.driver", "C:\\Users\\dariza\\Trabajo\\greenSQA\\NuevaEPS\\Java\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    String frdate = "1";
    String todate = "10";
    driver.get("https://nepsqa.nuevaeps.com.co/#/Authorizations");
    // wait of 2 seconds
    driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
    WebElement e = driver.findElement(By.xpath("//*[@id='birthdatef']/iframe"));
    driver.switchTo().frame(e);
    // choose from date
    driver.findElement(By.xpath("//input[@id='from']")).click();
    //Thread.sleep(1000);
    // choose month from dropdown
    WebElement m = driver
    .findElement(By.xpath("//div/select[@class='ui− datepicker−month']"));
    Select s = new Select(m);
    s.selectByVisibleText("Nov");
    //Thread.sleep(1000);
    // select day
    driver.findElement(By.xpath("//td[not(contains(@class,'ui−datepicker− month'))]/a[text()='"+frdate+"']")).click();
    //Thread.sleep(1000);
    // choose to date
    driver.findElement(By.xpath("//input[@id='to']")).click();
    //Thread.sleep(1000);
    // choose month from dropdown
    WebElement n = driver
    .findElement(By.xpath("//div/select[@class='ui− datepicker−month']"));
    Select sel = new Select(n);
    sel.selectByVisibleText("Jan");
    //Thread.sleep(1000);
    // select day
    driver.findElement(By.xpath("//td[not(contains(@class,'ui−datepicker− month'))]/a[text()='"+todate+"']")).click();
    //Thread.sleep(1000);
        
    }
    
}
