Guest User

Untitled

a guest
Apr 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from selenium.webdriver.firefox.webdriver import WebDriver
  3. from selenium.webdriver.common.action_chains import ActionChains
  4. import time, unittest
  5. import pytest
  6. from group import Group
  7. from application import Application
  8.  
  9.  
  10. def is_alert_present(wd):
  11. try:
  12. wd.switch_to_alert().text
  13. return True
  14. except:
  15. return False
  16.  
  17. @pytest.fixture
  18. def app(request):
  19. fixture = Application()
  20. request.addfinalizer(fixture.destroy)
  21. return fixture
  22.  
  23.  
  24.  
  25. def test_python_lesson_1_task_1(app):
  26. app.open_home_page()
  27. app.login(username="admin", password="secret")
  28. app.open_groups_page()
  29. app.create_group(Group(name="ccc", header="ccc", footer="ccc"))
  30. app.return_to_group_page()
  31. app.logo
  32. def python_lesson_empty_1_task_1(app):
  33. app.open_home_page()
  34. app.login(username="admin", password="secret")
  35. app.open_groups_page()
  36. app.create_group(Group(name="", header="", footer=""))
  37. app.return_to_group_page()
  38. app.logo
  39.  
  40. if __name__ == '__main__':
  41. unittest.main()
Add Comment
Please, Sign In to add comment