Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url = 'http://junction.dev.skygate.pl/';
- describe('Check main page', function () {
- it('should have right title', function () {
- return browser.url(url).getTitle().should.eventually.be.equal('Junction');
- });
- it('should display error message', function () {
- return browser.waitForVisible('#login').click('#login').waitForVisible('.notification-wrapper span');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('Please enter your email');
- });
- });
- });
- describe('Unsuccessful login to application using correct email and incorrect password', function () {
- // Make a mistake in one data.
- // You have to be registered to the app first
- it('Should display error message', function () {
- return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska.skygate+admin@gmail.com').addValue('#loginCtrl #password', 'test0').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('email or/and password is incorrect');
- });
- });
- });
- describe('Unsucceful login to application using incorrect email and correct password', function () {
- // Make a mistake in email address -> you can miss a dot, miss @/ or enter not existing email.
- // You have to own your account on junction
- it('Should display error message', function () {
- return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska@gmail.com').addValue('#loginCtrl #password', 'test1').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('user does not exist');
- });
- });
- });
- describe('Unsuccessful login to application using invalid both email address and password', function () {
- // Test the behaviour of app while entering both wrong email address and wrong password
- // You have to be registered
- it('Should display error message', function () {
- 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');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('user does not exist');
- });
- });
- });
- describe('Unsuccessful login to application keeping password field blank', function () {
- // Fill only one field / password or email, and the other keep blank.
- // You have to be registered to app first.
- it('Should display error message', function () {
- return browser.url(url).addValue('#loginCtrl #username', 'agata.wisniewska@gmail.com').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('Please enter your password');
- });
- });
- });
- //
- describe('Unsuccessful login to application keeeping email field blank', function () {
- // Fill only one field / password or email, and the other keep blank.
- // You have to be registered to app first.
- it('Should display error message', function () {
- return browser.url(url).addValue('#loginCtrl #password', 'test1').click('#loginCtrl #login').waitForVisible('.notification-wrapper span');
- });
- it('should have proper error text', function () {
- return browser.getText('.notification-wrapper span', function (err, spans) {
- expect(spans).to.equal('Please enter your email');
- });
- });
- });
- //
- describe('Log in with Google', function () {
- // 1. You have to have your own google account2. You have to choose this option by clicking on button "sign in with google"
- // Choose an option to sign in with google
- // 1. You have to own your personal google account2. Fill the fields email and password with correct data
- it('Should be redirected to Google page', function () {
- return browser.click('#googlelogin').waitForVisible('#Email').getTitle().should.eventually.be.equal('Logowanie \u2013 Konta Google');
- });
- it('should be successfully log in', function () {
- 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');
- });
- });
- describe('Successful login with Junction valid email and password', function () {
- //To be successfully logged in you need to enter valid email and valid password.
- // 1. You have to be registered to the application first.
- it('Should be redirected to my courses view', function () {
- 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()"]');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement