Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. import pytest
  2. from lib import public
  3. from lib import environment
  4. from pages import login
  5. from pages import performance
  6.  
  7.  
  8. def setup_module(module):
  9.  
  10. # grab the config
  11. public.config = environment.load_config()
  12.  
  13. # store these to help readability below
  14. public.user = public.config['account']['user']
  15. public.password = public.config['account']['password']
  16.  
  17. # pub url
  18. public.hub_url = public.config['hub']['url']
  19.  
  20. # start the driver
  21. public.driver = environment.init_driver(public.config)
  22.  
  23. #login to hub
  24. lg = login.LoginPage(public)
  25. lg.login(public.user, public.password)
  26.  
  27.  
  28. def teardown_module(module):
  29.  
  30. # throw away the driver
  31. public.driver.quit()
  32.  
  33.  
  34. @pytest.mark.keyflow
  35. def test_date_picker():
  36.  
  37. #click on performance button to open performance page
  38. pm = performance.PerformancePage(public)
  39. pm.click_performancebutton()
  40. pm.click_datepicker()
  41. pm.click_thisyear()
  42. pm.click_apply()
  43.  
  44. @pytest.mark.keyflow
  45. def test_merchant_report():
  46.  
  47. #Test Merchant report
  48. pm = performance.PerformancePage(public)
  49. pm.click_merchant()
  50. pm.check_page_loaded()
  51.  
  52. @pytest.mark.keyflow
  53. def test_merchant_mousehoverpages():
  54.  
  55. #test merchant report mouse hover pages icon
  56. pm = performance.PerformancePage(public)
  57. pm.merchant_pages_mousehover()
  58.  
  59. @pytest.mark.keyflow
  60. def test_merchant_mousehoverpagessehoverproduct():
  61.  
  62. #test merchant report mouse hover pages icon
  63. pm = performance.PerformancePage(public)
  64. pm.merchant_product_mousehover()
  65.  
  66. @pytest.mark.keyflow
  67. def test_pages_revenue_report():
  68.  
  69. #test pages by revenue report
  70. pm = performance.PerformancePage(public)
  71. pm.click_pages()
  72. pm.check_page_loaded_pages()
  73. pm.check_page_loaded_pagestabs()
  74.  
  75. @pytest.mark.nokeyflow
  76. def test_pages_mousehoverproduct():
  77.  
  78. #test pages report mouse hover product icon
  79. pm = performance.PerformancePage(public)
  80. pm.pages_product_mousehover()
  81.  
  82. @pytest.mark.keyflow
  83. def test_pages_activity_report():
  84.  
  85. #test pages by activity report
  86. pm = performance.PerformancePage(public)
  87. pm.click_pages_by_activity()
  88. pm.check_page_loaded_pagestabs()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement