This test does a login on a non-angular site, then switches to angular app and performs the testing. I found that regular bindings by.css work, but custom ones like by.binding don't.

describe('show-rights: TC15269-restrictions', function () {

    var page = new Page();

    it('should display the restrictions', function () {
        //login on a non-angular site
        browser.ignoreSynchronization = true;
        //redirects to the user login
        element(by.css('#username')).sendKeys = 'User1';
        //this click will do 2 redirects, the last one being the angular app 
        browser.wait(function () {
            return browser.getCurrentUrl().then(function (currentUrl) {
                return currentUrl.indexOf('channel/moonlight-1202275') > -1;
           }, 15000));
        //mark app as Angular
        browser.ignoreSynchronization = false;
        //this will fail


the html

    <p>{{ formattedType }}</p>

(Protractor version 2.5.1, angular 1.3.17)

To fix it, I'm refreshing the page:

//mark app as Angular
browser.ignoreSynchronization = false;

//this fixes the custom selectors issue:
//this now works

Is there another solution?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.