Question

I tried the following but got an error : expect undefined toBe "/"

    browser().navigateTo('/');
    expect(browser().location().url()).toBe("/");
    expect(document.title).toBe("something");

Page does have a title "something".

Was it helpful?

Solution

Since the test website runs in a frame, document.title would not work.

However, you can use this:

expect(element('title').text()).toBe("something");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top