package integration;

import org.junit.jupiter.api.Test;

import static com.codeborne.selenide.Condition.disabled;
import static com.codeborne.selenide.Condition.enabled;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Condition.value;

final class DoubleClickTest extends ITest {
  @Test
  void userCanDoubleClickOnElement() {
    openFile("page_with_double_clickable_button.html");

    $("#double-clickable-button")
      .shouldHave(value("double click me"))
      .shouldBe(enabled);

    $("#double-clickable-button")
      .doubleClick()
      .shouldHave(value("do not click me anymore"))
      .shouldBe(disabled);

    $("h2").shouldHave(text("Double click worked"));
  }
}

@@ -416,24 +416,54 @@
 on.html%22);%0A%0A
+    withLongTimeout(() -%3E %7B%0A  
     $(%22#doub
@@ -480,24 +480,26 @@
 le-button%22)%0A
+  
       .shoul
@@ -528,32 +528,34 @@
 ick me%22))%0A      
+ 
+ 
 .shouldBe(enable
@@ -555,24 +555,26 @@
 (enabled);%0A%0A
+  
     $(%22#doub
@@ -601,16 +601,18 @@
 )%0A      
+  
 .doubleC
@@ -620,24 +620,26 @@
 ick()%0A      
+ 
+ 
 .shouldHave(
@@ -674,24 +674,26 @@
 re%22))%0A      
+  
 .shouldBe(di
@@ -706,16 +706,18 @@
 );%0A%0A    
+ 
+ 
 $(%22h2%22).
@@ -757,14 +757,22 @@
 ked%22));%0A
+    %7D);%0A
   %7D%0A%7D%0A

fix random test