Protractor for Angularjs で非常に単純な Cookie の追加と取得のテストを行うのに問題があります。これはテストブロックです:
describe("Homepage", function () {
var ptor;
beforeEach(function () {
ptor = protractor.getInstance();
browser.get('/');
ptor.manage().addCookie("test", "testValue");
});
it('should have cookie with name test and value textValue', function () {
ptor.manage().getCookie("test").then(function(data){
expect(data.value).toBe("testValue");
});
});
});
このテストは失敗し、データが null であると表示されます。印刷getCookies()
すると、すべての Cookie が印刷されますが、テスト Cookie はそこにありません。これについての助けを本当に感謝します!ありがとう!