Skip to content

Commit b649a64

Browse files
committed
Fix Duration.ofSeconds(3) in closeBurgerMenu().
1 parent d5a64be commit b649a64

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/qa/autotest/framework/pages/BasePage.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import io.qameta.allure.Step;
66
import lombok.extern.slf4j.Slf4j;
77

8-
import java.time.Duration;
98

109
import static com.codeborne.selenide.Selenide.$;
1110

@@ -95,16 +94,19 @@ public BasePage openBurgerMenu() {
9594
/**
9695
* Closes the burger menu.
9796
*
98-
* <p>Precondition: the menu must be open. If it is not, Selenide will throw
97+
* <p>Precondition: the menu must be open. Uses global {@code Configuration.timeout}
98+
* (default: 10 s) — tolerates slow CSS animations in headless CI.
99+
*
100+
* <p>If it is not open, Selenide will throw
99101
* a timeout exception — this is intentional (fail-fast on wrong test state).
100102
*
101103
* @return current page instance
102104
*/
103105
@Step("Close burger menu")
104106
public BasePage closeBurgerMenu() {
105107
log.info("Closing burger menu");
106-
closeMenuButton().click();
107-
sidebarMenu().shouldNotBe(Condition.visible, Duration.ofSeconds(3));
108+
closeMenuButton().shouldBe(Condition.visible).click();
109+
sidebarMenu().shouldNotBe(Condition.visible);
108110
return this;
109111
}
110112

0 commit comments

Comments
 (0)