allure-framework / allure-framework/allure-java

Using steps in testNG @Factory throw error

Đang mở
#367 0 bình luận 5 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
376
Fork
240
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
45

Mô tả

#### I'm submitting a ...
- [x] bug report
#### What is the current behavior?

#### If you use the steps in the factory, the allures writes an error
```
18:34:28.258 ERROR io.qameta.allure.AllureLifecycle Could not start step: no test case running
18:34:28.259 ERROR io.qameta.allure.AllureLifecycle Could not start step: no test case running
18:34:28.702 ERROR io.qameta.allure.AllureLifecycle Could not add attachment: no test is running
18:34:30.011 ERROR io.qameta.allure.AllureLifecycle Could not add attachment: no test is running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not update step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not stop step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not update step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not stop step: no step running
```

#### Example:

```
public class CountersTestFactory {

@Factory
public synchronized Object[] factoryMethod() throws Exception {
// next two lines it @Steps
Campaign campaign = CampaignSteps.createDefault(user.get().getApiKey());
SocketIOSteps.waitForcampaignCollected(campaignId);

assertThat(
"campaign",
CampaignDataSteps.getList(user.get().getApiKey(), campaign.id).result.size(),
greaterThan(0));

return new Object[] {
new CountersCurrentTest(
user.get().getApiKey(),
campaign.id,
DateUtils.getTimestampMinusDays(90),
DateUtils.getTimestamp()),
}

```

#### What is the expected behavior?
@ Step displayed annotation text

#### Please tell us about your environment:

| Allure version | 2.12.1 |
| --- | --- |
| Test framework | testng@6.9.10 |
| Allure integration | allure-testng@2.12.1 |
| Generate report using | allure-maven@2.8 |

#### Other information

[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc
)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lỗi trong phương thức @Factory của TestNG được hiển thị, sử dụng các phiên bản Allure và TestNG được liệt kê cùng các lệnh gọi @Steps. Theo dõi vòng đời xung quanh factoryMethod và xác minh rằng văn bản bước dự kiến được hiển thị mà không có các lỗi no-test hoặc no-step đã báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
testing
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.