codeceptjs / codeceptjs/CodeceptJS

BDD one step per feature (filtering steps per feature)

Open
#1,761 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.2k
Forks
757
Avg merge
2d 9h
Merged PRs (30d)
16

Description

#### What are you trying to achieve?

I would like to create multiples step files for my BDD. One step file per feature. It's more organized for me but if i have the same steps in different feature files I cant have two step files with the same steps. i would like to filter the steps by feature file

#### What do you get instead?

ex:
```feature
Feature: My first feature

Scenario: My first scenario
Give first given
When first when
Then first then

Scenario: My second scenario
Give first given
When second when
Then second then
```
```feature
Feature: My second feature

Scenario: My third scenario
Give first given
When second when
Then third then
```

filtering feature and scenario

```js
Feature('My first feature', () => {
Scenario('My first scenario',() => {
Give('first given')
When('first when')
Then('first then')
})
Scenario('My second scenario',() => {
Give('first given')
When('second when')
Then('second then')
})
})

Feature('My second feature', () => {
Scenario('My first scenario',() => {
Give('first given')
When('second when')
Then('third then')
})
})
```

or filtering feature only

```js
Feature('My first feature', () => {
Give('first given')
When('first when')
When('second when')
Then('first then')
Then('second then')
})

Feature('My second feature', () => {
Give('first given')
When('second when')
Then('third then')
})
```

or as is at now

```js
Give('first given')
When('first when')
When('second when')
Then('first then')
Then('second then')
Then('third then')
```

It's possible?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.