We have a scenario in which first we have to fill the form and then assert the values filled in the form. This can be achieved by two ways:
Call assertion step form submission step but both the steps should be under the same step definition file. If we have to assert some specific fields only then we cannot use this pattern for assertion.
The other way is to store the values in hooks.rb under a variable and then call that instance variable in any step definition.
Before('@TC029', '@TC030') do
@category = "Automation"
@blog_title = "Test title"
@dummy_text = "This is a dummy text for testing"
@dummy_tags = "Test"
end
Now the value of all the four variables are available for the scenarios that were tagged with @TC029 and @TC030. We can use these values in our step definitions in different files also.
0 Comment(s)