Last active
August 4, 2018 15:51
-
-
Save GabiThume/5880058 to your computer and use it in GitHub Desktop.
A simple test using behave and selenium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
def before_all(context): | |
context.browser = webdriver.Firefox() | |
def after_all(context): | |
context.browser.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: testing browser title | |
Scenario Outline: visit <browser page> and check | |
When we visit <browser page> | |
Then it should have a title "<browser title>" | |
Examples: Browser | |
| browser page | browser title | | |
| https://crash-stats.mozilla.com/ | Crash Data for Firefox | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@when('we visit https://crash-stats.mozilla.com/') | |
def step(context): | |
context.browser.get("https://crash-stats.mozilla.com/") | |
@then('it should have a title "Crash Data for Firefox"') | |
def step(context): | |
assert context.browser.title == "Crash Data for Firefox" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment