You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

homepage_steps.py 614B

1234567891011121314151617181920212223242526
  1. from behave import *
  2. from nose.tools import *
  3. @when('I view the homepage')
  4. def step(context):
  5. br = context.browser
  6. context.response = br.get('/')
  7. @when('I view a silly page')
  8. def step(context):
  9. br = context.browser
  10. context.response = br.get('/silly/', status='*')
  11. @then('I get a {code} response')
  12. def step(context, code):
  13. eq_(int(code), context.response.status_code,
  14. "Response did not return a %s code" % code)
  15. @then('page includes "{text}"')
  16. def step(context, text):
  17. ok_(text.encode('utf8') in context.response.content.decode('utf8'),
  18. "%r not page content" % text)