What problem should this solve?
Currently, when AllureSelenide takes a screenshot after an assertion failure, it uses WebDriverRunner.getWebDriver() to fetch the underlying Selenium WebDriver and take a screenshot. This means that plugin libraries like com.codeborne:selenide-full-screenshot which change the Photographer don't apply to screenshots added to Allure.
What would you like to happen?
io.qameta.allure.selenide.AllureSelenide.getScreenshotBytes() should use Selenide.screenshot(OutputType.BYTES) instead of the current implementation: ((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES), so that Selenide plugins like selenide-full-screenshot apply correctly and consistently across a test suite and reports.
Alternatives considered
We currently workaround this by using the following custom AllureSelenide subclass, which demonstrates how the Selenide.screenshot() method can effectively replace the direct WebDriver approach:
public final class AllureSelenideFullScreenshot extends AllureSelenide {
public AllureSelenideFullScreenshot() {
super.screenshots(false); // disable parent class screenshot behavior; full-page screenshot is taken instead
}
@Override
public void afterEvent(final @NonNull LogEvent event) {
if (event.getStatus().equals(LogEvent.EventStatus.FAIL)) {
byte[] screenshot = Selenide.screenshot(OutputType.BYTES);
if (screenshot != null) {
Allure.attachment("Screenshot", "image/png", new ByteArrayInputStream(screenshot), AttachmentOptions.empty());
}
}
super.afterEvent(event);
}
}
Additional context
No response
What problem should this solve?
Currently, when AllureSelenide takes a screenshot after an assertion failure, it uses
WebDriverRunner.getWebDriver()to fetch the underlying Selenium WebDriver and take a screenshot. This means that plugin libraries likecom.codeborne:selenide-full-screenshotwhich change the Photographer don't apply to screenshots added to Allure.What would you like to happen?
io.qameta.allure.selenide.AllureSelenide.getScreenshotBytes()should useSelenide.screenshot(OutputType.BYTES)instead of the current implementation:((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES), so that Selenide plugins likeselenide-full-screenshotapply correctly and consistently across a test suite and reports.Alternatives considered
We currently workaround this by using the following custom
AllureSelenidesubclass, which demonstrates how theSelenide.screenshot()method can effectively replace the direct WebDriver approach:Additional context
No response