Skip to content

Commit

Permalink
background macro fix (#28)
Browse files Browse the repository at this point in the history
* background macro fix
* e2e test
  • Loading branch information
judit-nahaj authored and szikszail committed Feb 13, 2018
1 parent 4ecb519 commit 9c1b401
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/builtIn/Macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class Macro extends DefaultConfig {
* @returns {boolean|*} FALSE if the given element should be filtered out.
*/
preFilterScenario(scenario, parent, i) {
if (!scenario.tags) {
return;
}
const macroTag = scenario.tags.find(tag => /^@macro\(.*\)/.test(tag.name));

if (macroTag) {
Expand Down
3 changes: 3 additions & 0 deletions test/data/input/macro.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Feature: Test for macro

Background: Background
Given step

@macro(not_used_macro)
Scenario: Macro not used
Given the Index pages is opened
Expand Down
3 changes: 3 additions & 0 deletions test/data/output/macro.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Feature: Test for macro

Background: Background
Given step

Scenario: Logging in
Given the Login pages is opened
When the username field is filled with the username of user_1
Expand Down

0 comments on commit 9c1b401

Please sign in to comment.