package com.agile611.testng.webdriver;

import java.io.File;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class StatusCodesTest {
    WebDriver driver;

    @BeforeMethod
    public void setUp() {
        FirefoxOptions options = new FirefoxOptions();
        System.setProperty("webdriver.gecko.driver",
                "src" + File.separator + "main"
                        + File.separator + "resources"
                        + File.separator + "geckodriver-macos");
        driver = new FirefoxDriver(options);
    }

    @AfterMethod
    public void tearDown() {
        driver.quit();
    }

    @Test
    public void ResourceNotFound404() {
        driver.navigate().to("http://the-internet.herokuapp.com/status_codes/404");
        // Simplified test, no proxy
    }

    @Test
    public void ResourceFound200() {
        driver.navigate().to("http://the-internet.herokuapp.com/status_codes/200");
        // Simplified test, no proxy
    }

    @Test
    public void ResourceRedirect301() {
        driver.navigate().to("http://the-internet.herokuapp.com/status_codes/301");
        // Simplified test, no proxy
    }

    @Test
    public void ResourceError500() {
        driver.navigate().to("http://the-internet.herokuapp.com/status_codes/500");
        // Simplified test, no proxy
    }
}