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
I have two feature files and two steps groovy files.
Defined the Before method on both steps files, the issue I'm having is the test execution calls both Before methods, before executing steps on each file.
The expected behavior would be, if Before is defined on env.groovy, to run for any steps file, but if the Before is defined on a specific steps file, that Before should run just for those steps.
The issue this generates, for instance, is when a variable should be initialized and has the same name. like this.myvar, on both Before methods, the myvar gets assigned to the value set by the steps file which Before is called last, getting the wrong value on when running the first steps file.
I know this can be easily avoided by making the names of the vars unique between steps files, but it would be better to isolate Before methods when declared on a steps file.
I think the same happens with the After methods.
The text was updated successfully, but these errors were encountered:
I have two feature files and two steps groovy files.
Defined the Before method on both steps files, the issue I'm having is the test execution calls both Before methods, before executing steps on each file.
The expected behavior would be, if Before is defined on env.groovy, to run for any steps file, but if the Before is defined on a specific steps file, that Before should run just for those steps.
The issue this generates, for instance, is when a variable should be initialized and has the same name. like this.myvar, on both Before methods, the myvar gets assigned to the value set by the steps file which Before is called last, getting the wrong value on when running the first steps file.
I know this can be easily avoided by making the names of the vars unique between steps files, but it would be better to isolate Before methods when declared on a steps file.
I think the same happens with the After methods.
The text was updated successfully, but these errors were encountered: