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');
- });
- });
- describe("Login form behaviour keeping all field blank", function () {
- it('should display error message', function () {
- return browser
- .url(url)
- .waitForExist("#login").click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', function (err, spans) {
- expect(spans).to.equal("Please enter your email");
- });
- });
- });
- // You have to register firslty
- 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.addValue('#username', 'agata.wisniewska.skygate+admin@gmail.com')
- .addValue('#password','test1')
- .click('#login')
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', 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.addValue('#username','agata.wisniewska.skygate+admin@gmail.com')
- .addValue('#password', 'test0')
- .click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', 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.addValue('#username','agata.wisniewska@gmail.com')
- .addValue('#password', 'test1')
- .click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', function (err, spans) {
- expect(spans).to.equal('email or/and password is incorrect');
- });
- });
- });
- 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.addValue('#username','agata.wisniewska@gmail.com')
- .addValue('#password', 'test1')
- .click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', function (err, spans) {
- expect(spans).to.equal('email or/and password is incorrect');
- });
- });
- });
- describe('Unsuccessful login to application keeeping 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.addValue('#username','agata.wisniewska@gmail.com')
- .addValue('#password', '')
- .click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', 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.addValue('#username','')
- .addValue('#password', 'test1')
- .click('#login')
- .waitForExist(".notification-wrapper");
- });
- it("should have proper error text", function () {
- return browser.getText('.notification-wrapper', 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')
- .getTitle().should.eventually.be.equal('Logowanie – Konta Google');
- });
- it ('should be successfully log in'), function () {
- return browser.addValue('#Email', 'agata.wisniewska.skygate@gmail.com')
- .click('#next')
- .addValue('#Passwd', 'Test_123')
- .click('#signIn')
- .click('#submit_approve_access');
- });
- describe('Log out', function () {
- // Test of log out the app.
- describe('Log out Google ', function () {
- // Test of logging out - google account- junction account
- // 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
- it('Logged in junction account by your personal google account', function () {
- });
- it('To log out click on human` s shape on the right corner of page and click on log out', function () {
- });
- 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 () {
- });
- });
- describe('Log out Junction', function () {
- // Test of logging out of your junction account
- // 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.
- it('Click on human`s shape on the top right corner, and then click on log out button', function () {
- });
- it('You should be logged out of the course and redirected to login page. ', function () {
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement