allure-framework / allure-framework/allure-java
Using steps in testNG @Factory throw error
- 主要言語
- Java
- スター
- 376
- フォーク
- 240
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 45
説明
#### 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
)
コントリビューションガイド
調査の方向性
まず、示されているTestNGの@Factoryメソッドで、記載されているAllureおよびTestNGのバージョンと@Steps呼び出しを使用して失敗を再現します。factoryMethod周辺のライフサイクルを追跡し、報告されているno-testまたはno-stepエラーなしに、期待されるステップテキストが表示されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- testing
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100