Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/step/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Step {
processingStep = this

while (processingStep.metaStep) {
if (processingStep.metaStep.actor?.match(/^(Given|When|Then|And)/)) {
if (processingStep.metaStep.actor?.match(/^(Given|When|Then|And|But)/)) {
hasBDD = true
break
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/step/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MetaStep extends Step {

/** @return {boolean} */
isBDD() {
if (this.actor && this.actor.match && this.actor.match(/^(Given|When|Then|And)/)) {
if (this.actor && this.actor.match && this.actor.match(/^(Given|When|Then|And|But)/)) {
return true
}
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Feature: HTML Reporter BDD Test
When I perform an action
Then I should see the expected result
And everything should work correctly
But I should see the expected result

@regression @critical
Scenario: Test with data table
Expand Down
2 changes: 1 addition & 1 deletion test/runner/html-reporter-plugin_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('CodeceptJS html-reporter-plugin', function () {
expect(reportContent).toContain('data-type=')

// Should contain scenario steps with proper keywords
expect(reportContent).toMatch(/Given|When|Then|And/)
expect(reportContent).toMatch(/Given|When|Then|And|But/)

done()
})
Expand Down
2 changes: 1 addition & 1 deletion test/unit/steps_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('Steps', () => {
})

describe('#isBDD', () => {
;['Given', 'When', 'Then', 'And'].forEach(key => {
;['Given', 'When', 'Then', 'And', 'But'].forEach(key => {
it(`[${key}] #isBdd should return true if it BDD style`, () => {
const metaStep = new MetaStep(key, 'I need to open Google')
expect(metaStep.isBDD()).to.be.true
Expand Down
Loading