You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a single scenario, the framework (including the IntelliJ plugin) references the scenario by its line number. This creates issues when the scenario's definition line moves up or down due to code changes above it.
Ideally, given the file below, rather than using the line number, which can change:
-Dkarate.options=classpath:path/to/features/feature.feature:'Line changing scenario # this line number must change'"
Steps:
Using scenario file 1 below, run the 2nd scenario.
This can be done with keyboard shortcuts, using the gutter shortcut or by right-clicking on the scenario and selecting "Run...".
Scenario passes.
Change the file in any way such that the 2nd scenario is on a different line number, higher or lower.
ACTUAL: Scenario will not be found, and thus the test shows up as "Terminated".
EXPECTED: Scenario would be run by name, and thus would be found regardless of line number, as long as scenario name was unchanged.
Failure variation:
Run first test as normal.
Alter the file in such a way that the IntelliJ auto-formatter will alter the file.
Example: add 3 blank lines in between 1st and 2nd scenario.
Run the 2nd scenario by gutter or keyboard shortcut or right-click.
IntelliJ Karate Plugin is triggered to run based on current file conditions.
When the Run window receives focus, the auto-formatter is triggered.
The 2nd scenario moves up.
ACTUAL: Scenario will not be found, and thus the test shows up as "Terminated".
EXPECTED: Scenario would be run by name, and thus would be found regardless of line number, as long as scenario name was unchanged.
Feature: A simple Karate test that always passesScenario: Dummy Test* def foo = 1234
* def bar = 1234
* match foo == bar
# variations on this empty space will cause the issueScenario: Line changing scenario # this line number must change* def foo = 1234
* def bar = 1234
* match foo == bar
The text was updated successfully, but these errors were encountered:
(Original ticket here: karatelabs/intellij-plugin#32)
When running a single scenario, the framework (including the IntelliJ plugin) references the scenario by its line number. This creates issues when the scenario's definition line moves up or down due to code changes above it.
Ideally, given the file below, rather than using the line number, which can change:
we should do something like this:
Steps:
Failure variation:
The text was updated successfully, but these errors were encountered: