sign_yourself_spec.rb 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. require 'rspec'
  2. require 'selenium-webdriver'
  3. require_relative '../page_objects/login_page'
  4. require_relative '../page_objects/abstract_page'
  5. describe 'Testing sign_yourself' do
  6. wait = Selenium::WebDriver::Wait.new(timeout: 60)
  7. app = nil
  8. before(:each) do
  9. app = AbstractPage.new(Selenium::WebDriver.for :chrome)
  10. end
  11. after(:each) do
  12. app.quit
  13. end
  14. it 'will go through SignYourself and this should be successful' do
  15. app
  16. .navigateToLoginPage #Cause Navigation
  17. .fillInEmail("eric.cheng@kdanmobile.com")
  18. .clickBtnAfterFillingEmail
  19. .fillInPassword("ratherwoman5796",wait)
  20. .clickBtnAfterFillingPassword #Cause Navigation
  21. .clickPurpleCircle(wait)
  22. .clickSignYourself(wait) #Cause Navigation
  23. .uploadPdfFile(wait)
  24. .clickNextStep #Cause Navigation
  25. .assignName(wait)
  26. .assignTime(wait)
  27. .assignText(wait)
  28. .assignCheckbox(wait)
  29. .assignRadioBtn(wait)
  30. .clickNextStep
  31. .comfirmCreateDocument(wait) #Cause Navigation
  32. .backMainPage(wait) #Cause Navigation
  33. .clickCompletedPage(wait)
  34. .clickNewestDocument(wait) #Cause Navigation
  35. .takeScreenshotAndNotify("Task 1: Sign Yourself","SUCCESS")
  36. end
  37. # it "will go through GetSignature and it will be successful" do
  38. # app
  39. # .navigateToLoginPage #Cause Navigation
  40. # .fillInEmail("eric.cheng@kdanmobile.com")
  41. # .clickBtnAfterFillingEmail
  42. # .fillInPassword("ratherwoman5796",wait)
  43. # .clickBtnAfterFillingPassword #Cause Navigation
  44. # .clickPurpleCircle(wait)
  45. # .clickGetSignature(wait) #Cause Navigation #Here's the difference.
  46. # .uploadPdfFile(wait)
  47. # .clickNextStep #Cause Navigation
  48. # end
  49. end