А причём тут Allure плагин-то? Он только берёт файлы и рисует отчёт. Я раньше у вас спрашивал про сами файлы скриншотов. Вы сказали, что они там тоже “испорченные”, т.е. проблема в том как был сделан скриншот. Странные у вас выводы или я вас ранее неправильно понял.
Вам надо найти в чём разница между работой из Jenkins и обычным локальным запуском. В этом и будет скрываться проблема. Возможно, есть какой-то баг или дефект в конкретных версиях ПО или библиотек. Ваш конкретный случай можете исследовать только вы сами.
88Post1
(Arthur Khasanov)
22.Июнь.2024 16:20:20
#22
Отличие именно в запуске из под Jenkins:
файл, который я получаю после запуска из под Jenkins, выглядит вот так ( специально его сохраняю на hdd строкой
byte[] content = Screenshoter.screenshot();
FileUtils.writeByteArrayToFile(new File("D:\\screenshot.png"), content);
):
Если же запускаю локально (mvn clean test …), то он выглядит так:
Ну и разве не плагин виноват ?
88Post1
(Arthur Khasanov)
28.Июнь.2024 11:32:06
#23
Неужели у меня у одного такая проблема ?
Здравствуйте, у меня такая же проблема появилась буквально месяц назад. Раньше все работало - то бишь код я никак не менял.
88Post1
(Arthur Khasanov)
02.Июль.2024 15:44:24
#25
Первый раз — случайность, второй — совпадение, третий — закономерность
Этот баг уже репортили:
opened 04:24PM - 21 Jun 24 UTC
bug
### Jenkins and plugins versions report
<details>
<summary>Environment</su… mmary>
```text
Paste the output here
```
</details>
### 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:

### 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;
}
}
```
2. 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:

### 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_
Я так же создал еще один баг репорт:
opened 03:02PM - 03 Jul 24 UTC
bug
### Jenkins and plugins versions report
<details>
I deployed Jenkins locally a… nd configured the necessary plugins.
I take a screenshot during execution and in allure I see that screenshot is empty (black screen) in the report
</details>
<details>
<summary>Environment</summary>
Allure Jenkins Plugin - Version 2.31.1
Selenide version - 7.3.2
Chrome version - 126.0.6478.127
</details>
### What Operating System are you using (both controller, and any agents involved in the problem)?
Controller: Windows 11
Agents: Windows 11
### Reproduction steps
1. I configured code to take a screenshot which was working previosly:
```
@Listeners({TextReport.class})
public class BaseTest {
@BeforeClass
public void configuration() {
SelenideLogger.addListener("AllureSelenide", new AllureSelenide()
.screenshots(true)
.savePageSource(false));
}
}
```
also attached pom.xml file:
[pom.txt](https://github.com/user-attachments/files/16086779/pom.txt)
2. I created locally freestyle job with a:
Source code management - Git,
Build Steps - Invoke top-level Maven targets - Goals: clean install
Post-build Actions - Allure report
### Expected Results
After bulid done should be created allure report with a screenshot if test failed:
Local execution from IntelliJIdea:

### Actual Results
After bulid done created allure report with a screenshot if test failed:
Execution from Jenkins - Screenshot is empty (black screen if download):

Screenshot:

### Anything else?
Notes:
With the same code everything works month ago.
After installing a new version Jenkins with Allure Jenkins Plugin - Version 2.31.1 this issue happens.
Also attaching github project:
https://github.com/StasiukMarian/sep-2023-aqa.git
### Are you interested in contributing a fix?
_No response_
Похоже пофиксили в последней версии Jenkins - 2.452.3.
88Post1
(Arthur Khasanov)
15.Июль.2024 14:30:23
#28
Так же обновился.
У меня без изменений.
@Mar_yan_Stasyuk вы как скриншот делаете ? Покажите код.
перед классом @Listeners ({TextReport.class})
код:
Configuration.screenshots = true;
SelenideLogger.addListener(“AllureSelenide”, new AllureSelenide()
.screenshots(true)
.savePageSource(false));
версия allure: <allure.version>2.27.0</allure.version>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-selenide</artifactId>
<version>${allure.version}</version>
</dependency>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.12.0</version>
<configuration>
<reportVersion>2.14.0</reportVersion>
</configuration>
</plugin>
88Post1
(Arthur Khasanov)
20.Июль.2024 15:28:41
#30
У меня ничего не изменилось…