Below is the list of steps that should be performed as part of my scenario.
Verify the file generated at S3 location with Redshift DB
Verify the duplicate between the original script with latest script
Verify the newly added column in latest script
Verify that old column data is intact in original script and latest script
And I have the below feature to cover the same.
Feature:Add # of times PDP browsed to search and sort output files User Story CDH-3311
#regression
Scenario Outline: :Validation of file being generated at S3 location after job run
Given user has the json file with <country> and <brand>
Then user execute the Generic-extract-Batch job
Then user verify the file is generated successfully at S3 location
Then user verify the data in Redshift db with generated file
Then user verify the duplicate data in latest sql script
And user verify the duplicate data in original sql script
And user verify PDP_VIEWS column in latest sql script
And user verify <old coulmn> data of original script
And user compare it with the latest sql script
Examples:
| country | brand | old column |
| US | test1 | test6 |
| US | test2 | STORE |
| US | test3 | test7 |
| US | test4 | SALESUNITSCORE |
| US | test5 | TOTALSCORE |
Kindly verify that the outline adhere to best practices and is the correct representation of the things that needs to be done for the above mentioned tests
Not sure about the business flow, but make sure there are not spaces in the examples table columns. so the last column should be old_column.
Related
I need to verify bunch of sites that are using our templates. After login in I need to verify many info which I will put in the second table. How to write the gherkin code so that For each item in table "userinfo" it goes through All the items in table "siteinfo". I am seeing error calling them by userinfo.url or siteMenu.menuiitem. I am using python-bdd.
Scenario Outline: Login to SAP
Given User is on login page url <url>
When User enters username <username> and passwrod <password>
Then user should see <menuitem> <title> and <description>
Example: usefinfo
| url | username| password |
| siteA | Userx | pass1 |
| siteB | UserY | pass1 |
Example: siiteInfo
|menuitem | title | description |
|Community Managment | T1 | Text1 |
|User Managment | T2 | Text2 |
|Environment Management | T3 | Text3 |
|Loggin | T4 | Text4 |
|Miscellaneous | T5 | Text5 |
Use a different approach. Instead of trying to write one hugely complex low quality Cuke, write several simple high quality cukes.
Once you have a set of cukes that verify correctly that one particular site works correctly with your templates, then run that set of cukes against your other sites. You can do this by externalising site, perhaps as an environment variable, or by modifying cuke config, or by running the same set of cukes in different places.
This will be a much more sustainable solution in the medium term particularly when
you get asked to add new tests for each site
you get asked to add a site specific test.
I would like to use steps from one feature file in another feature file with additional steps
feature file 1
secenario outline: sample test
Given step 1 with id
then step 2 with name
and step 3 with address
|id | name | address|
|1 | rahul | usa |
feature file 2
secenario outline: sample test
Given step 1 with id
then step 2 with name
when step 3 with id and name and location
and step 3 with address
|id | name | address| location |
|1 | rahul | usa | hyd|
in practiacal i have more 23 steps to validate in my process. but when it comes to some other client i need to execute some additional steps to validate.
I am not able to skip the steps based on client. so i planned to create new feature file and copy the same steps again. but i have following issue
bheave.step_registry.Ambiguousstep
Please guide me how to resolve the issue
I have some documents to upload it. For that, I wrote a scenario. I need to run the same feature file multiple times. How can I run the feature file Multiple times?
Instead of using multiple feature file use scenario outline which will execute the same scenario multiple time as per the example table you will provide to it
Example:
Scenario Outline: Create ABC
Given I open the application
When I enter username as <username>
And I enter password as <password>
Then I enter title as <title>
And press submit
Examples:
| username | password | title |
| Rob | xyz1 | title1 |
| Bob | xyz1 | title2 |
So here the same scenario will run 2 times as example table have 2 data, you can add as many data table and cucumber will execute that number of times
I have the following two scenarios in my feature file:
#system-A #updating-dob
Scenario: Updating customers dob
Given an account from system A
When I save the dob
Then I should see the dob is updated successfully
#system-B #updating-dob
Scenario: Updating customers dob
Given an account from system B
When I save the dob
Then I should see the dob is updated successfully
As you can see I have two scenarios in the same file but only the Given is different. Is there a way I can combine these two scenarios using Scenario Outline?
BTW, the step definition for
Given an account from system A
Given an account from system B
is 10 lines of code.
Yes, you can use a scenario outline:
#updating-dob
Scenario Outline: Updating customer's dob
Given an account from system <system>
When I save the dob
Then I should see the dob is updated successfully
Examples:
| system |
| A |
| B |
You can't have #system-A on the example that tests system A and #system-B on the example that tests system B, however.
I would like to use the Examples in the code below in the "When I sign up with the following information" line without having to specify every single parameter and without having to repeat the table in the examples.
Is this possible?
Scenario Outline: signing up a user that already exists
Given I am registered as "<username>" with password "<password>"
When I sign up with the following information
Then I should be on the sign up page
And I should see "user already registered"
Examples:
| email | username | name | password | password_confirmation | city | mobile_numbers |
| foo#bar.com | existent | some user | temp123 | temp123 | foobar | 70 707070 |
When you generate the cucumber project folder, the structure will contain a ruby file called env.rb within the support directory inside the features folder (along with the step_definitions folder). Here you can define your methods, variables, etc. that will serve as a common source for all your other tests inside the same project.
Since Cucumber is a Ruby gem, the data is defined in Ruby's format. You can define them as methods or variables. I prefer to define them as methods (in ruby, methods return their last line). So your methods will look like
def email
"foo#bar.com" # returns this when email is called
end
def username
"existent"
end
and so on...
You can optimize it to suit your needs. You will call them in your ste_definition files just like any normal ruby function would be called.