Skip to content

Instantly share code, notes, and snippets.

@ck1125
Created March 1, 2011 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ck1125/849681 to your computer and use it in GitHub Desktop.
Save ck1125/849681 to your computer and use it in GitHub Desktop.
Feature file with scenarios for hub page selenium tests
Feature: Sample Page loading test
On /programmes want to see if Cucumber can be used to make a selenium testing DSL
Scenario: A brand hub page can be loaded
When I open '/programmes/skins'
Then the title should be 'Skins - Channel 4'
Then click an item with xpath '//html/body/div/div[3]/div/div[3]/div/ul/li[2]/h3/a'
Then browser location should be 'http://www.e4.com/skins/quizzes.html'
Scenario: A brand hub page can be loaded and elements found on the page
When I open '/programmes/the-it-crowd'
Then the title should be 'The IT Crowd - Channel 4'
Then element with id 'heroImage' should be present
Then click an item with xpath '//div[@id='brandInfoBox']/a[@class='watch-now-large']'
And browser location should be 'http://www.channel4.com/programmes/the-it-crowd/4od'
Scenario: A brand hub page can be loaded and a search done
When I open '/programmes/the-it-crowd'
Then the title should be 'The IT Crowd - Channel 4'
Then element with id 'heroImage' should be present
Then fill form field with id '//*[@id="c4navSearchTxt"]' using value 'city'
Then submit form with id 'c4navSearch'
Then element with id 'BrandResultContainer' should be present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment