0

I have webpage designed for different Screen Variations like Full, small (640), medium (1024), large (1440) and xlarge (1920). By Default it displays Screen Variations Full and I want to test same webpage same functionalities for different screen Variations. In my case my feature file is as given below:

Background Outline:
Given Home page is displayed.
When I navigates to "abc" inside "xyz" menu
And user click on <screenVariation> tab
Examples:
| screenVariation|
| Full |
| small (640)   |
| medium (1024) |
| large (1440)  |
| xlarge (1920) |

Scenairo 1: abc...

Scenairo 2: xyz...

However It has give me error at Given tag only: Error: required (...)+ loop did not match anything at input 'Given '.

My background Outline will be followed by multiple scenarios, and I need to test each and ever scenarios for different screen screenVariation.

user861594
  • 5,733
  • 3
  • 29
  • 45
Priya P
  • 123
  • 1
  • 4
  • 11
  • `Scenario Outline`, not Background Outline. https://github.com/cucumber/cucumber/wiki/Scenario-Outlines – meatspace Dec 06 '16 at 03:22
  • Yes, That I know. I was trying for some way by which I can can add that common step with examples in background. As per my knowledge it is not do able to execute background similar to scenario outline, because, firstly there is no such keyword in cucumber as 'Background Outline'. and background is just to perform pre-requisite task before performing actual scenario steps. However if someone knows any other way by which my above requirement can be achieved except scenario outline do let me know. – Priya P Dec 06 '16 at 05:55

2 Answers2

1

Cucumber uses Gherkin syntax and Gherkin and hence Cucumber doesn't supports Background Outline. So what you are getting is syntax error while parsing gherkin which is expected as you are not following gherkin syntax. It may be at Given instead of Background Outline because it may not consider Background Outline is not Gherkin keyword and that's why ignoring it or considered as feature description and complaining Given which is reserved keyword at wrong place! In short, examples with background is not supported.

You can refer below similar questions:

user861594
  • 5,733
  • 3
  • 29
  • 45
0

The message reports that a token is missing from source code and the parser has reached the end of file ("EOF") without finding a required repeatable token (...)+.

Can you start typing in your feature file or use the available feature template (CTRL+space to get a prompt of available templates): as soon as the file starts to represent a valid feature file the error goes away.

Abhinav
  • 1,037
  • 6
  • 20
  • 43
  • But dose cucumber support Background Outline: ? as in CTRL+space it is not showing me any such prompt. – Priya P Dec 05 '16 at 12:11