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 5.63 KB | None | 0 0
  1. var url = 'http://junction.dev.skygate.pl/';
  2. describe('Check main page', function () {
  3. it('should have right title', function () {
  4. return browser.url(url).getTitle().should.eventually.be.equal('Junction');
  5. });
  6. it('should display error message', function () {
  7. return browser.waitForVisible('#login').click('#login').waitForVisible('.notification-wrapper span');
  8. });
  9. it('should have proper error text', function () {
  10. return browser.getText('.notification-wrapper span', function (err, spans) {
  11. expect(spans).to.equal('Please enter your email');
  12. });
  13. });
  14. });
  15.  
  16. describe('Unsuccessful login to application using correct email and incorrect password', function () {
  17. // Make a mistake in one data.
  18. // You have to be registered to the app first
  19. it('Should display error message', function () {
  20. return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska.skygate+admin@gmail.com').addValue('#loginCtrl #password', 'test0').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
  21. });
  22. it('should have proper error text', function () {
  23. return browser.getText('.notification-wrapper span', function (err, spans) {
  24. expect(spans).to.equal('email or/and password is incorrect');
  25. });
  26. });
  27. });
  28. describe('Unsucceful login to application using incorrect email and correct password', function () {
  29. // Make a mistake in email address -> you can miss a dot, miss @/ or enter not existing email.
  30. // You have to own your account on junction
  31. it('Should display error message', function () {
  32. return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska@gmail.com').addValue('#loginCtrl #password', 'test1').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
  33. });
  34. it('should have proper error text', function () {
  35. return browser.getText('.notification-wrapper span', function (err, spans) {
  36. expect(spans).to.equal('user does not exist');
  37. });
  38. });
  39. });
  40. describe('Unsuccessful login to application using invalid both email address and password', function () {
  41. // Test the behaviour of app while entering both wrong email address and wrong password
  42. // You have to be registered
  43. it('Should display error message', function () {
  44. return browser.url(url).waitForVisible('#loginCtrl #username').addValue('#loginCtrl #username', 'agata.wisniewska@gmail.com').addValue('#loginCtrl #password', 'test1').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
  45. });
  46. it('should have proper error text', function () {
  47. return browser.getText('.notification-wrapper span', function (err, spans) {
  48. expect(spans).to.equal('user does not exist');
  49. });
  50. });
  51. });
  52. describe('Unsuccessful login to application keeping password field blank', function () {
  53. // Fill only one field / password or email, and the other keep blank.
  54. // You have to be registered to app first.
  55. it('Should display error message', function () {
  56. return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska@gmail.com').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
  57. });
  58. it('should have proper error text', function () {
  59. return browser.getText('.notification-wrapper span', function (err, spans) {
  60. expect(spans).to.equal('Please enter your password');
  61. });
  62. });
  63. });
  64. //
  65. describe('Unsuccessful login to application keeeping email field blank', function () {
  66. // Fill only one field / password or email, and the other keep blank.
  67. // You have to be registered to app first.
  68. it('Should display error message', function () {
  69. return browser.url(url).addValue('#loginCtrl #password', 'test1').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
  70. });
  71. it('should have proper error text', function () {
  72. return browser.getText('.notification-wrapper span', function (err, spans) {
  73. expect(spans).to.equal('Please enter your email');
  74. });
  75. });
  76. });
  77. //
  78. describe('Log in with Google', function () {
  79. // 1. You have to have your own google account2. You have to choose this option by clicking on button "sign in with google"
  80. // Choose an option to sign in with google
  81. // 1. You have to own your personal google account2. Fill the fields email and password with correct data
  82. it('Should be redirected to Google page', function () {
  83. return browser.click('#googlelogin').waitForVisible('#Email').getTitle().should.eventually.be.equal('Logowanie \u2013 Konta Google');
  84. });
  85. it('should be successfully log in', function () {
  86. return browser.addValue('#Email', 'agata.wisniewska.skygate@gmail.com').click('#next').waitForVisible('#Passwd').addValue('#Passwd', 'Test_123').click('#signIn').waitForVisible('#submit_approve_access').click('#submit_approve_access');
  87. });
  88. });
  89.  
  90. describe('Successful login with Junction valid email and password', function () {
  91. //To be successfully logged in you need to enter valid email and valid password.
  92. // 1. You have to be registered to the application first.
  93. it('Should be redirected to my courses view', function () {
  94. return browser.url(url).waitForVisible('#loginCtrl #username').addValue('#loginCtrl #username', 'agata.wisniewska.skygate+admin@gmail.com').addValue('#loginCtrl #password', 'test1').waitForVisible('#loginCtrl #login').click('#loginCtrl #login').waitForVisible('.profile-toggle').click('.profile-toggle').click('[ng-click="logout()"]');
  95. });
  96. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement