Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple test using behave and selenium
from selenium import webdriver
def before_all(context):
context.browser = webdriver.Firefox()
def after_all(context):
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 |
| | Crash Data for Firefox |
@when('we visit')
def step(context):
@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