Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

ptor.getCurrentUrl() is not working correct #57

Closed
@apankov1

Description

@apankov1

Hello,

I've just started looking at protractor for our angularjs apps and looks very promising.

I want to use ptor.getCurrentUrl() to get url after login to make sure that I actually got logged in. My code looks something like this:

var util = require('util');

describe('Sign In Page', function() {
    var ptor;

    beforeEach(function() {
        ptor = protractor.getInstance();
        ptor.get('#/login/');
        ptor.waitForAngular();
    });

    it ('Login', function(){
        ptor.findElement(protractor.By.css('input[name=email]')).sendKeys("***");
        ptor.findElement(protractor.By.css('input[name=password]')).sendKeys("***");
        ptor.waitForAngular();
        var currentUrl = ptor.getCurrentUrl();
        console.log(currentUrl);
    }, 20000);

    it('afterAll', function(){
    });
});

I'm using

    var currentUrl = ptor.getCurrentUrl();
    console.log(currentUrl);

to see what exactly gets stored and in console I see following result:

APankov$ node_modules/.bin/protractor conf.js
Using the selenium server at http://localhost:4444/wd/hub
{ then: [Function: then],
  cancel: [Function: cancel],
  isPending: [Function: isPending] }

What am doing wrong in this case?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions