package integration;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static com.codeborne.selenide.CollectionCondition.size;
import static com.codeborne.selenide.Condition.visible;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;
import static com.codeborne.selenide.Selenide.close;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

public class UnopenedBrowserTest {
  @BeforeEach
  void givenNoOpenedBrowsers() {
    close();
  }

  @Test
  void dollarShouldNotOpenBrowser() {
    assertThatThrownBy(() ->
      $("div").shouldBe(visible)
    ).isInstanceOf(IllegalStateException.class)
      .hasMessageStartingWith("No webdriver is bound to current thread")
      .hasMessageEndingWith("You need to call open(url) first.");
  }

  @Test
  void dollarsShouldNotOpenBrowser() {
    assertThatThrownBy(() ->
      $$("div").shouldHave(size(666))
    ).isInstanceOf(IllegalStateException.class)
      .hasMessageStartingWith("No webdriver is bound to current thread")
      .hasMessageEndingWith("You need to call open(url) first.");
  }
}

@@ -15,16 +15,63 @@
 ation;%0A%0A
+import com.codeborne.selenide.WebDriverRunner;%0A
 import o
@@ -103,16 +103,16 @@
 reEach;%0A
-
 import o
@@ -304,17 +304,17 @@
 elenide.
-$
+*
 ;%0Aimport
@@ -325,95 +325,50 @@
 tic 
-com.codeborne.selenide.Selenide.$$;%0Aimport static com.codeborne.selenide.Selenide.close
+org.assertj.core.api.Assertions.assertThat
 ;%0Aim
@@ -510,24 +510,24 @@
 rowsers() %7B%0A
-
     close();
@@ -524,32 +524,156 @@
   close();%0A  %7D%0A%0A
+  @Test%0A  void openWoParamsCreatesNewDriver()%7B%0A    open();%0A    assertThat(WebDriverRunner.getWebDriver()).isNotNull();%0A  %7D%0A%0A
   @Test%0A  void d

Add test for Selenide.open()