package com.agile611.testng.webdriver;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test;

public class DuckDuckGoTest extends BaseTest {
    @FindBy(id = "searchbox_input")
    public WebElement searchBox;

    @FindBy(className = "react-results--main")
    public WebElement resultsList;

    @Test
    public void testSearch() throws Exception {
        PageFactory.initElements(driver, this);
        driver.get("https://duckduckgo.com/");
        Thread.sleep(2000);
        searchBox.sendKeys("pizza hawaiana");
        searchBox.submit();
        Thread.sleep(2000);
        assertTrue(resultsList.isDisplayed());
    }
}


