allure-framework / allure-framework/allure-java

Using steps in testNG @Factory throw error

Abierto
#367 0 comentarios 5 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
376
Forks
240
Merge medio
1 d 7 h
PR fusionados (30 d)
45

Descripción

#### 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
)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza reproduciendo el fallo en el método @Factory de TestNG mostrado, utilizando las versiones indicadas de Allure y TestNG y las llamadas a @Steps. Traza el ciclo de vida alrededor de factoryMethod y verifica que el texto de paso esperado se muestre sin los errores no-test o no-step indicados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
testing
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.