Ionic Protractor testing, making get requests

I am testing a login page that sends the credentials to an api, and returns either “error” if failed or "" on success. If the response is successful, i want it to redirect to another page. So far, this is all I wrote, can someone help me fix this? because now it displays the result of the request.

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

    username= element('username'));
    password= element('password'));
    loginButton= element('loginButton'));

it('should validate the credentials for a successful login and display the recommended view', function() {



this will change your browser url and you will not in your app anymore.

This request should be done inside of your app i think. so if you click the loginbutton your app should send any necessary requests, and if everything is okay it should redirect to your “menu.recommendedJobs” state

the thing is I alreay did it in my login controller to check credentials and move to the recommendedJobs page. But I feel that writing the test case has confused me and I am not sure what to write after the button is clicked

depends on what you want to test, if you want to check if the login worked --> check the current url.

remove the browser.get line

Because the url is an api, i want to make sure that whatever is passed, if it works, moves to the next page. But now, when i start protractor, it just gets the data frmo the url api and stops