Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attached screenshot looks weird ( grey content instead of actual website ) #365

Open
art1988 opened this issue Jun 21, 2024 · 1 comment
Labels

Comments

@art1988
Copy link

art1988 commented Jun 21, 2024

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

Win 10.
I use Selenide 7.2.3, TestNG, maven.

I've installed Jenkins on local machine ( version Jenkins 2.452.2 ) and install Allure plugin:
a6f8a0fff9685973ab34a44a7200023a42c70949

Reproduction steps

  1. I use the following code to attach screenshot:
import com.codeborne.selenide.Screenshots;
import com.google.common.io.Files;
import io.qameta.allure.Attachment;

import java.io.File;
import java.io.IOException;

public class Screenshoter
{
    @Attachment(value = "Page screenshot", type = "image/png")
    public static byte[] screenshot()
    {
        File screenshot = Screenshots.takeScreenShotAsFile();
        byte[] result = null;

        try
        {
            result = Files.toByteArray(screenshot);
        }
        catch (IOException e)
        {
            System.err.println(e);
        }

        return result;
    }
}
  1. The test itself looks like this:
@Test(priority = 5)
    public void openByUsingEnvParam() throws IOException
    {
        Selenide.open("https://www.google.com/");

        $(withText("text")).shouldBe(Condition.visible, Condition.enabled);
        Screenshoter.screenshot();
    }

Expected Results

Attached screenshot in the Allure Report should be the homepage of Google.

Actual Results

What I want to see is actual content of web page, not the grey rectangle.
Refer to screenshot:
43723e547c536002a0085187c3c1c00ffb107c0f

Anything else?

What's more interesting is that if I run the same test via mvn clean test and then run mvn allure:serve then screenshot looks fine.

So my guess is that the issue is in allure jenkins plugin.

Are you interested in contributing a fix?

No response

@art1988 art1988 added the bug label Jun 21, 2024
@StasiukMarian
Copy link

Hello.
Same happens with me. Reported in #366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants