Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cucumberjs): support steps' attachments #689

Merged
merged 3 commits into from May 26, 2023

Conversation

ilya2010ujl
Copy link
Contributor

@ilya2010ujl ilya2010ujl commented May 24, 2023

Closes #688

Please check linked issue to get more information about the problem

Context

Allure attachments are place outside the cucumber steps

Checklist

…ramework#688

Closes allure-framework#688

Please check linked issue to get more information about the problem
@github-actions github-actions bot added the theme:cucumberjs CucumberJS related issue label May 24, 2023
Copy link
Member

@baev baev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test?

@baev baev added the type:bug Something isn't working label May 24, 2023
@ilya2010ujl
Copy link
Contributor Author

Hello
Test:

import { Given, setWorldConstructor } from "@cucumber/cucumber"
import { CucumberAllureWorld } from "allure-cucumberjs"

SetWorldConstructor(CucumberAllureWorld)

Given(/my step/, async function () {
  await this.step("step can have anonymous body function", async function () {
    await this.label("label_name", "label_value")
    await this.attach(JSON.stringify({ foo: "bar "}), "application/json")
  })

  await this.step("by the way, body function can be arrow one", async (step) => {
    await step.label("label_name", "label_value")
    await step.attach(JSON.stringify({ foo: "bar "}), "application/json")
 })

After start run the command "allure serve"
ER:
image

@epszaw
Copy link
Member

epszaw commented May 24, 2023

Hello Test:

import { Given, setWorldConstructor } from "@cucumber/cucumber"
import { CucumberAllureWorld } from "allure-cucumberjs"

SetWorldConstructor(CucumberAllureWorld)

Given(/my step/, async function () {
  await this.step("step can have anonymous body function", async function () {
    await this.label("label_name", "label_value")
    await this.attach(JSON.stringify({ foo: "bar "}), "application/json")
  })

  await this.step("by the way, body function can be arrow one", async (step) => {
    await step.label("label_name", "label_value")
    await step.attach(JSON.stringify({ foo: "bar "}), "application/json")
 })

After start run the command "allure serve" ER: image

Could you add a unit test (into the package) to cover the provided code?

@ilya2010ujl
Copy link
Contributor Author

Can you please tell me if this is a required condition for the merge in the master? Or is it possible without unit tests?)

@CLAassistant
Copy link

CLAassistant commented May 25, 2023

CLA assistant check
All committers have signed the CLA.

@ilya2010ujl
Copy link
Contributor Author

@epszaw Hello
Unit tests have been updated. Please review the MRs

@ilya2010ujl ilya2010ujl requested a review from baev May 26, 2023 07:32
@baev baev changed the title Fix: Allure attachments are place outside the cucumber steps #688 fix(cucumberjs): support steps' attachments May 26, 2023
@baev baev merged commit 3a49189 into allure-framework:master May 26, 2023
5 checks passed
@baev
Copy link
Member

baev commented May 26, 2023

@ilya2010ujl thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:cucumberjs CucumberJS related issue type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allure attachments are place outside the cucumber steps
4 participants