You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doug Morgan edited this page Dec 8, 2016
·
4 revisions
Building a PageObject
frompage_objectimportPageObjectclassExamplePage(PageObject):
defdefine_elements(self):
self.page_url='http://pageurl'self.button(name='example_save', identifier={'css': "[type='submit']"})
self.table(name='example_table', identifier={ 'id': 'example_id'})
definitialize_page(self):
# wait for the submit button to be presentself.button_element().when_present()
Using PageFactory methods in step definitions
frompage_objectimportvisit, on@when('I view the example form')defvisit_example(context):
visit(ExamplePage)
@when('I save the form')defvisit_example(context):
on(ExamplePage).example_save()