Joe Biden was asked if he thinks
$$.as is a killer feature. «Mmm hmm, I do», — Biden answered.
This is a double release notes for Selenide 5.20.0 and Selenide 5.20.1.
We added operations with clipboard
assertEquals("Hello World", Selenide.clipboard().getText());
Note that clipboard doesn’t work on Linux without graphical environment.
Thanks to Dmitriy Budim for PR 1409.
NB!These methods are overridden in selenide-selenoid plugin to work correctly in Selenoid. We also released version 1.1.0 of the plugin.
headless mode for Microsoft Edge
Configuration.headless worked only for Chrome and Firefox, now it also works for Edge.
(Browsers IE, Opera and Safari afaik still don’t support headless mode)
See issue 1422 and PR 1424.
We added method $$.as() for giving collection an alias
As you probably remember, we added method
$.as() in Selenide 5.17.0. It allows to give an alias (human-readable name) to any
Now you can also given readable names to collections:
$(By.xpath("/long/ugly/xpath")).as("Login button").shouldBe(visible); $$(By.xpath("/long/ugly/xpath")).as("Login buttons").shouldHave(size(2));
See issue 1389 and PR 1431.
NB! Don’t rush with using this feature. I personally take it as a “last sort hack”.
It’s always better to see the real locator instead of a name which always may happen to be:
It’s always better to invest your time in readable locator, method names, well-organized tests etc. This is where the real power lies.
We added collection condition
$$.shouldHave(texts("a", "b", "c")) checks that the collection contains exactly these elements, and not any others.
But sometimes we want a less strict check. For example, you need to check that the traded currencies list contains EUR and USD - and any others.
Now we have a method for such check:
Thanks to Oleg Berezhnoy for PR 1426.
UPD In release Selenide 5.20.1 it was renamed to
$$.should(containExactTextsCaseSensitive("RUB", "EUR", "USD"));
Thanks to Oleg Berezhnoy for PR 1438 and PR 1439.
Fixed the lost FirefoxOptions
In some situations some of Firefox options could be lost. Now they are not lost anymore.
See issue 1436. Thanks to Dmitriy Budim for PR 1437.
Removed duplicate logging of “navigation” methods
SelenideElement has several methods to find other elements:
Such methods were logged twice: first when you call them, and second when you call another method of the the found element. Now we removed this duplication.
Thanks to Pavel Fokin for PR 1428.