Advertisement
Guest User

Untitled

a guest
Sep 8th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.90 KB | None | 0 0
  1. var url = 'http://junction.dev.skygate.pl/';
  2.  
  3. describe('Check main page', function () {
  4. it('should have right title', function () {
  5. return browser
  6. .url(url)
  7. .getTitle().should.eventually.be.equal('Junction');
  8. });
  9. });
  10.  
  11. describe("Login form behaviour keeping all field blank", function () {
  12. it('should display error message', function () {
  13. return browser
  14. .url(url)
  15. .waitForExist("#login").click('#login')
  16. .waitForExist(".notification-wrapper");
  17. });
  18.  
  19. it("should have proper error text", function () {
  20. return browser.getText('.notification-wrapper', function (err, spans) {
  21. expect(spans).to.equal("Please enter your email");
  22. });
  23. });
  24. });
  25.  
  26. // You have to register firslty
  27. describe('Successful login with Junction valid email and password', function () {
  28. // To be successfully logged in you need to enter valid email and valid password.
  29. // 1. You have to be registered to the application first.
  30. it('Should be redirected to my courses view', function () {
  31. return browser.addValue('#username', 'agata.wisniewska.skygate+admin@gmail.com')
  32. .addValue('#password','test1')
  33. .click('#login')
  34. });
  35. it("should have proper error text", function () {
  36. return browser.getText('.notification-wrapper', function (err, spans) {
  37. expect(spans).to.equal('Please enter your email\×');
  38. });
  39. });
  40. });
  41.  
  42. describe('Unsuccessful login to application using correct email and incorrect password', function () {
  43. // Make a mistake in one data.
  44. // You have to be registered to the app first
  45. it('Should display error message', function () {
  46. return browser.addValue('#username','agata.wisniewska.skygate+admin@gmail.com')
  47. .addValue('#password', 'test0')
  48. .click('#login')
  49. .waitForExist(".notification-wrapper");
  50. });
  51.  
  52. it("should have proper error text", function () {
  53. return browser.getText('.notification-wrapper', function (err, spans) {
  54. expect(spans).to.equal('email or/and password is incorrect');
  55. });
  56. });
  57. })
  58.  
  59.  
  60. describe('Unsucceful login to application using incorrect email and correct password', function () {
  61. // Make a mistake in email address -> you can miss a dot, miss @/ or enter not existing email.
  62. // You have to own your account on junction
  63. it('Should display error message', function () {
  64. return browser.addValue('#username','agata.wisniewska@gmail.com')
  65. .addValue('#password', 'test1')
  66. .click('#login')
  67. .waitForExist(".notification-wrapper");
  68. });
  69.  
  70. it("should have proper error text", function () {
  71. return browser.getText('.notification-wrapper', function (err, spans) {
  72. expect(spans).to.equal('email or/and password is incorrect');
  73. });
  74. });
  75. });
  76.  
  77. describe('Unsuccessful login to application using invalid both email address and password', function () {
  78. // Test the behaviour of app while entering both wrong email address and wrong password
  79. // You have to be registered
  80. it('Should display error message', function () {
  81. return browser.addValue('#username','agata.wisniewska@gmail.com')
  82. .addValue('#password', 'test1')
  83. .click('#login')
  84. .waitForExist(".notification-wrapper");
  85. });
  86.  
  87. it("should have proper error text", function () {
  88. return browser.getText('.notification-wrapper', function (err, spans) {
  89. expect(spans).to.equal('email or/and password is incorrect');
  90. });
  91. });
  92. });
  93.  
  94. describe('Unsuccessful login to application keeeping password field blank', function () {
  95. // Fill only one field / password or email, and the other keep blank.
  96. // You have to be registered to app first.
  97. it('Should display error message', function () {
  98. return browser.addValue('#username','agata.wisniewska@gmail.com')
  99. .addValue('#password', '')
  100. .click('#login')
  101. .waitForExist(".notification-wrapper");
  102. });
  103.  
  104. it("should have proper error text", function () {
  105. return browser.getText('.notification-wrapper', function (err, spans) {
  106. expect(spans).to.equal('Please enter your password');
  107. });
  108. });
  109. });
  110.  
  111. describe('Unsuccessful login to application keeeping email field blank', function () {
  112. // Fill only one field / password or email, and the other keep blank.
  113. // You have to be registered to app first.
  114. it('Should display error message', function () {
  115. return browser.addValue('#username','')
  116. .addValue('#password', 'test1')
  117. .click('#login')
  118. .waitForExist(".notification-wrapper");
  119. });
  120.  
  121. it("should have proper error text", function () {
  122. return browser.getText('.notification-wrapper', function (err, spans) {
  123. expect(spans).to.equal('PLease enter your email');
  124. });
  125. });
  126. });
  127.  
  128. describe('Log in with Google', function () {
  129. // 1. You have to have your own google account2. You have to choose this option by clicking on button "sign in with google"
  130. // Choose an option to sign in with google
  131. // 1. You have to own your personal google account2. Fill the fields email and password with correct data
  132. it('Should be redirected to Google page', function () {
  133. return browser.click('#googlelogin')
  134. .getTitle().should.eventually.be.equal('Logowanie – Konta Google');
  135. });
  136.  
  137. it ('should be successfully log in'), function () {
  138. return browser.addValue('#Email', 'agata.wisniewska.skygate@gmail.com')
  139. .click('#next')
  140. .addValue('#Passwd', 'Test_123')
  141. .click('#signIn')
  142.  
  143. .click('#submit_approve_access');
  144. });
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. describe('Log out', function () {
  169. // Test of log out the app. 
  170. describe('Log out Google ', function () {
  171. // Test of logging out - google account- junction account
  172. // 1. No matter who you are (the student/the professor) the logging out is the same.2. Depends on the account you are logged in, the way of logging out is different:- google account- junction
  173. it('Logged in junction account by your personal google account', function () {
  174. });
  175. it('To log out click on human` s shape on the right corner of page and click on log out', function () {
  176. });
  177. it('You should be logged out of the system and be presented with the login screen, but you should not be logged out of your google account', function () {
  178. });
  179. });
  180. describe('Log out Junction', function () {
  181. // Test of logging out of your junction account
  182. // 1. You need to have your junction account.2. You need to be logged in.3. You can be both a student and a professor.
  183. it('Click on human`s shape on the top right corner, and then click on log out button', function () {
  184. });
  185. it('You should be logged out of the course and redirected to login page. ', function () {
  186. });
  187. });
  188. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement