vendredi 23 janvier 2015

Protractor testing with ngStorage

I'm just started with angularjs and need some help. 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. There's a way to keep it or another way to test the same thing?


Thanks for advanced.


Aucun commentaire:

Enregistrer un commentaire