behave_manners.site module¶
-
class
ChromeWebContext
(context, config=None)¶ Bases:
behave_manners.site.WebContext
Web context for Chromium browser
-
class
FakeContext
¶ Bases:
object
Dummy behave context
Will substitute a proper behave context for when manners stuff is run outside of a behave test suite.
-
add_cleanup
(fn, *args)¶
-
close
()¶
-
log
= <Logger context (WARNING)>¶
-
-
class
FirefoxWebContext
(context, config=None)¶ Bases:
behave_manners.site.WebContext
Web context for Chromium browser
-
class
GenericWebContext
(context, config=None)¶
-
class
IExploderWebContext
(context, config=None)¶ Bases:
behave_manners.site.WebContext
Web context for Chromium browser
-
exception
RemoteNetworkError
(message, **kwargs)¶
-
exception
RemoteSiteError
(message, **kwargs)¶ Bases:
Exception
Raised on errors detected at remote (browser) side
-
class
SiteContext
(context, config=None)¶ Bases:
object
Holds (web)site information in a behave context
- A SiteContext is attached to behave’s context like
- context.site = SiteContext(…)
and from there on tests can refer to site-wide attributes through that context.site object.
-
base_url
¶
-
init_collection
(loader=None)¶
-
class
WebContext
(context, config=None)¶ Bases:
behave_manners.site.SiteContext
Site context when a browser needs to be launched
-
fourOfours
= ('/favicon.ico',)¶
-
get_cur_title
(context)¶ Return pretty title of page currently loaded on the browser
-
launch_browser
(context)¶ Launch a browser, attach it to context.browser
Open a URL, by pretty title
-
process_logs
(context, consumer=None)¶ Fetch logs from browser and process them
Parameters: silent – suppress exceptions arising from logs
-
update_cur_page
(context)¶ Update context.cur_page when URL may have changed
-
validate_cur_page
(context, max_depth=10000)¶ Validates current browser page against pagelem template
Current page will be checked by url and the page template will be traversed all the way down.
-
-
current_context
()¶ Discover current behave context from caller stack
Use this inside an object that has no reference to behave context, but need to use it. Note that the context may be deliberately omitted, but in some exceptional cases would be useful to have.