Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

inconsistent variable or key not found #23

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 4 additions & 0 deletions tests/acceptance/GherkinParam.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Feature: Parametrize Gherkin Feature
Then I should see "{{test}}" equals "42"
Then I should see "{{ test }}" equals "42"

Scenario: variable does not exist (exception)
Given I have a parameter "first" with value "42"
Then I should see "{{second}}" is null

Scenario: Scenario using table parameter
Given I have a parameter "my_param" with value "This is a test"
And I have a parameter "another_param" with value "3.14"
Expand Down
4 changes: 4 additions & 0 deletions tests/acceptance/GherkinParamArray.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Feature: Parametrize Gherkin Feature (Array)
And I should see "{{test[3]}}" equals to "IV"
And I should see "{{test[4]}}" equals to "101"

Scenario: variable does not exist (exception)
Given I have an array "test" with values [1, two, 3.14, IV, 101]
Then I should see "{{second}}" is null

Scenario: Key not exist (exception)
Given I have an array "test" with values [1, two, 3.14, IV, 101]
Then I should see "{{test[9999]}}" is null
Expand Down
27 changes: 27 additions & 0 deletions tests/acceptance/GherkinParamConfig.feature
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,30 @@ Feature: Parametrize Gherkin Feature (Config)
"""
When I execute a scenario calling the parameter 'config:not_a_param'
Then I should see "{{config:not_a_param}}" is null

Scenario: Config key not exists (expect null)
Given I have a configuration file "codeception.yml"
"""
actor: Tester

paths:
tests: tests
log: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs

settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 512M
my_edgecase:
0:
user: 'edgecase'

extensions:
enabled:
- Codeception\Extension\GherkinParam
"""
When I execute a scenario calling the parameter 'my_edgecase:1:user'
Then I should see "{{config:my_edgecase:1:user}}" equals "edgecase"