Guest User

Untitled

a guest
Feb 21st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @pytest.fixture(scope='session')
  2. def app(request):
  3. fixture = Application()
  4. browser.open_url(home_url)
  5. request.addfinalizer(fixture.destroy)
  6. return fixture
  7.  
  8. class Application:
  9. def __init__(self):
  10. self.test = Test(self)
  11. self.test1 = Test1(self)
  12.  
  13. class Test:
  14. def __init__(self, app):
  15. self.app = app
  16.  
  17. def open_page(self):
  18. browser.find_element_by_css(x)
  19.  
  20. class Test1:
  21. def __init__(self, app):
  22. self.app = app
  23.  
  24. def open_page1(self):
  25. browser.find_element_by_css(y)
  26.  
  27. def test1(app):
  28. app.test.open_page()
  29.  
  30. def test2(app):
  31. app.test1.open_page1()
Add Comment
Please, Sign In to add comment