package web.test;       // update this line based on where you put your test file

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

class maintenanceTest_template 
{
   private WebDriver driver;
   private String url = "https://www.cs.virginia.edu/~up3f/cs3250/assigns/sut/maintenance-request.php";

   @BeforeEach
   public void setUp() 
   {
       // uncomment the following based on your web browser

//     System.setProperty("webdriver.gecko.driver", "/path/to/your-gecko-driver");
//     driver = new FirefoxDriver();
//     
//     System.setProperty("webdriver.chrome.driver", "/path/to/your-chrome-driver");
//     driver = new ChromeDriver();   
	
      driver.get(url);      		   	   

   }

   @AfterEach
   public void teardown()
   { 
      driver.close();   
   }

   @Test
   public void test_pageTitle()
   {
      assertEquals(driver.getTitle(), "Maintenance Services");	
   }
   
   @Test
   public void test_pageContainRequestedDate()
   {
      assertTrue(driver.getPageSource().contains("Description of work/repair:"));
   }   

}

