ruby - Passing parameter in "Examples:" table of "Scenario Outline:" in a feature file -


As you can see I get a value from in the .yml file Trying to bring> config / environment in the example: table.

But instead of bringing it, is this value sending?

Is it possible to pass the parameters like this? if so, how?

If not, the feature / concept of Ruby or Cucumber prevents the user from doing so and why?

  Feature: All test users can login to verify that all test users can log in. Scenario Outline: Sign in as the different users on the website I is given on the login page when I use "& lt; username & gt;" I enter the password and then I click on the login button and I want to "user & gt;" Appears successfully login example: | User | Username | Testuser1 | # {FigNewton.test1_email} | | Testuser2 | FigNewton.test2_email |  

Firstly this is a very bad feature, it would be better

  Scenario: Test users can log in to some test users when test users are logged in then all test users must be logged in  

or some such features show that What do you want to do and why, how do you work.

If you do the above, then all programming phase definitions will be done. With this you can do whatever you want.

You can apply it quite easily eg.

  given 'some test users' are '@test_users = create_test_users end when' test users login '@login_results = login_each (@test_users) Finally' all test users should be logged in 'Hopefully (check_for_resures (@ login_rates). Count.) At the end of Eql 0, then apply the methods you need in a step assistant such as Modules TestUsersLoginStepHelper def create_test_users ... def login_elect (user) users.each ... ... world test users log Nastem Helper  

By putting all the work into step definitions, you make your live much easier, because you have the full power of Ruby to fulfill your needs

< / Html>

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -