Details
-
Type: New Feature
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
We have a UI functionality that repeats on many pages (say it is a JSPF component that is reusable, with configurable variation). But it is important to test this on all pages since the functionality is slightly different on each of these pages.
How we have to code this today:
Scenario: Food widget in Home page
Given I am on Home page
When I enter <food_item> in the menu field
Then I see <related_food_items> in the dropdown
Examples:
food_item | related_food_items |
pizza | "cheese, chicken, bacon" |
fruit_salad | "mangoes, strawberry, grapes" |
rice | "brown, white, fried" |
The exact same test will repeat on a different page like below
Scenario: Food widget in OrderFood page
Given I am on OrderFood page
When I enter <food_item> in the menu field
Then I see <related_food_items> in the dropdown
Examples:
food_item | related_food_items |
pizza | "cheese, chicken, bacon" |
fruit_salad | "mangoes, strawberry, grapes" |
rice | "brown, white, fried" |
Problem Statement: We want to run a particular scenario with 'examples' over another parametrized value (e.g 'Page' here).
Proposed solution: foreach meta-tag at scenario level that has processing implications.
Scenario:
Meta:
@foreach Page: Home, OrderFood, CheckStatus, CancelOrder
Given I am on the <Page> page
When I enter <food_item> in the menu field
Then I see <related_food_items> in the dropdown
Examples:
food_item | related_food_items |
pizza | "cheese, chicken, bacon" |
fruit_salad | "mangoes, strawberry, grapes" |
rice | "brown, white, fried" |
Activity
Field | Original Value | New Value |
---|---|---|
Description |
We have a UI functionality that repeats on many pages. But it is important to test this on all pages since the functionality is slightly different on each of these pages.
For eg. Scenario: Given I am on Home page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| The exact same test will repeat on a different page like below Scenario: Given I am on OrderFood page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| h2. Problem Statement: We want to run a particular test with examples over another parametrized value (e.g 'Page' here). h2. Proposed solution Scenario: Meta: @foreach Page: Home, OrderFood, CheckStatus, CancelOrder Given I am on the Page page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| |
We have a UI functionality that repeats on many pages (say it is a JSPF component that is reusable, with configurable variation). But it is important to test this on all pages since the functionality is slightly different on each of these pages.
h2. How we have to code this today: Scenario: Food widget in Home page Given I am on Home page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| The exact same test will repeat on a different page like below Scenario: Food widget in OrderFood page Given I am on OrderFood page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| h2. Problem Statement: We want to run a particular scenario with 'examples' over another parametrized value (e.g 'Page' here). h2. Proposed solution: foreach meta-tag at scenario level that has processing implications. Scenario: Meta: @foreach Page: Home, OrderFood, CheckStatus, CancelOrder Given I am on the <Page> page When I enter <food_item> in the menu field Then I see <related_food_items> in the dropdown Examples: |food_item|related_food_items| |pizza|"cheese, chicken, bacon"| |fruit_salad|"mangoes, strawberry, grapes"| |rice|"brown, white, fried"| |
This sounds like an interesting use case, but I would not use a meta property to drive it. Rather, we could enhance the Examples: syntax. E.g.
Examples:
{foreach Page: Home, OrderFood, CheckStatus, CancelOrder}... table as usual
The advantage is that we keep the parameters of the examples self-contained in the ExamplesTable (which can parse the directives too)