allure-framework / allure-framework/allure-java
Using steps in testNG @Factory throw error
- Lingua principale
- Java
- Stelle
- 376
- Fork
- 240
- Merge medio
- 1g 7h
- PR unite (30g)
- 45
Descrizione
#### 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
)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il malfunzionamento nel metodo @Factory di TestNG mostrato, utilizzando le versioni elencate di Allure e TestNG e le chiamate a @Steps. Traccia il ciclo di vita attorno a factoryMethod e verifica che il testo dello step previsto venga visualizzato senza gli errori no-test o no-step segnalati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100