Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49164

E2E, cannot read property of 'whenGet'

$
0
0

@nooreo92 wrote:

I am testing a login page that sends the credentials to an api, and returns either "error" if failed or "user@email.com" on success.

the senario.js

describe('clicking on the login button', function()
{
    var username, password, loginbutton,httpBackend, result

    beforeEach(function(){
        browser.get('#/loginPage');
        username= element(by.id('username'));
        password= element(by.id('password'));
        loginButton= element(by.id('loginButton'));
    });

    // checks credentials
    it('should validate the credentials for a successful login', function() {
        username.sendKeys('user@gmail.com');
        password.sendKeys('12345');

        loginButton.click().then(function($httpBackend)
        {
            $httpBackend.whenGET('http://website.com/api/login?email=user@gmail.com&password=12345').respond('1 - user@gmail.com'
            )
        })
    })
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>