├── build.gradle └── src └── test └── java └── SearchTests.java /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | testImplementation ( 11 | "com.codeborne:selenide:6.19.1", 12 | "org.junit.jupiter:junit-jupiter:5.9.3") 13 | } 14 | 15 | tasks.withType(JavaCompile) { 16 | options.encoding = 'UTF-8' 17 | } 18 | 19 | test { 20 | useJUnitPlatform() 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/SearchTests.java: -------------------------------------------------------------------------------- 1 | import org.junit.jupiter.api.Test; 2 | 3 | import static com.codeborne.selenide.Condition.text; 4 | import static com.codeborne.selenide.Selenide.$; 5 | import static com.codeborne.selenide.Selenide.open; 6 | 7 | public class SearchTests { 8 | @Test 9 | void successfulSearchTest() { 10 | open("https://www.google.com/"); 11 | $("[name=q]").setValue("selenide").pressEnter(); 12 | $("[id=search]").shouldHave(text("https://selenide.org")); 13 | } 14 | } 15 | --------------------------------------------------------------------------------