Hello, people!
We released a small update Selenide 6.16.1.
- Added conditions
allOf
andanyOf
- Added checks for cookies
- Updated WebDriverManager
- Fixed support for
<tspan>
in SVG
Added conditions allOf
and anyOf
Now you can check one of conditions (OR):
$("#president").shouldHave(anyOf(text("Lowlife"), text("Cowardly bum")));
(in fact, Selenide already had method Condition.or
for the same purpose, but anyOf
seems to be easier to use).
Also, you can check all conditions (AND):
$("#president").shouldHave(allOf(text("a catastrophic character"), text("another six years of this cowardly bum in power")));
(in fact, itโs the same as just $("#president").shouldHave(text(..), text(..))
,
but the result of allOf
can be extracted to a variable or method and reused, thus creating your own DSL).
Thanks to Evgenii Plugatar and PR 2368.
Added checks for cookies
Now you can check cookies in browser:
import static com.codeborne.selenide.Selenide.webdriver;
webdriver().shouldHave(cookie("session_id"));
webdriver().shouldHave(cookie("session_id", "1234567890"));
webdriver().shouldHave(cookie("session_id", "1234567890", Duration.ofSeconds(10)));
With built-in waiting, custom timeout, automated screenshot - everything you like.
Updated WebDriverManager from 5.4.0 to 5.4.1
Among others, it has support for Chrome 115 which caused a problem for many users.
See PR 2374.
P.S. On macOS, Chrome 115 still causes a error:
SessionNotCreatedException: Could not start a new session.
Response code 500.
Message: unknown error: cannot find Chrome binary
Itโs a known chromedriver bug. They promised to fix it soon.
Fixed support for <tspan>
in SVG
Have you ever checked texts inside SVG? Me neither. And it turns out SVG can contain texts!
<svg>
<text x="10" y="30" class="small">
People want to see <tspan>gratitude</tspan>.
</text>
<text x="10" y="60" class="small">
We are not <tspan>Amazon</tspan> warehouse.
</text>
<text x="10" y="90" class="small">
Thank you, <tspan>Ben Wallace</tspan>!
</text>
</svg>
Now you can check these texts again:
$$("svg tspan").shouldHave(texts("gratitude", "Amazon", "Ben Wallace"));
See issue 2377 and PR 2379.

selenide.org
24.07.23