如何检查 selenide 中的页面标题

Ale*_*.K. 2 java selenide

如何使用shouldHave断言检查 Selenide 中的页面标题?

在“Selenium”中,它将是下一个代码:

Assert.assertEquals(title(), "Your page title");
Run Code Online (Sandbox Code Playgroud)

Ale*_*.K. 5

我在文档中没有找到任何代码示例,但下一个代码解决了我的问题:

$("title").shouldHave(attribute("text", "Your page title"));
Run Code Online (Sandbox Code Playgroud)