I'm using ngStorage
to deal with local storage and Protractor to e2e specs in an AngularJS app.
describe('Test', function() {
beforeEach(function () {
browser.driver.manage().window().setSize(1280, 1024)
browser.get('http://localhost:9000/#/test/first-test')
})
it("keeps the alternative marked", function () {
element(by.id('element')).click()
browser.refresh()
expect(element(by.id('element')).isSelected()).toBe(true)
})
})
Result:
1) Test keeps the alternative marked
Message:
Expected false to be true.
Stacktrace:
Error: Failed expectation
at [object Object].<anonymous> (path/spec/test_spec.js:12:52)
I think that browser.refresh()
clears the local storage. Is there a way to keep it or another way to test the same thing?