package com.packtpublishing.tddjava.ch02friendships;

import org.junit.Test;
import org.openqa.selenium.By;

import static com.codeborne.selenide.Selenide.*;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;

public class SelenideTest {
    @Test
    public void wikipediaSearchFeature() throws InterruptedException {
        // Otwieranie strony Wikipedii
        open("http://en.wikipedia.org/wiki/Main_Page");

        // Wyszukiwanie wyrażenia "Test-driven development"
        $(By.name("search")).setValue("Test-driven development");

        // Kliknięcie przycisku wyszukiwania
        $(By.name("go")).click();

        // Sprawdzanie
        assertThat(title(), startsWith("Test-driven development"));
    }
}
