Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created June 9, 2014 11:07
Show Gist options
  • Save trikitrok/59b6ce45108ab53080c6 to your computer and use it in GitHub Desktop.
Save trikitrok/59b6ce45108ab53080c6 to your computer and use it in GitHub Desktop.
describe("A project landings list page", function () {
var TestTools = require('./TestTools'),
Navigation = require('./Navigation'),
ptor;
beforeEach(function () {
TestTools.resetTestData();
ptor = protractor.getInstance();
ptor.get('/ebo/#/projects/excecutive-education');
Navigation.logIn(ptor);
TestTools.waitForElementByCssToBePresent('.project-item__title', ptor);
});
it("lists all landings and mailings", function () {
var landingsAndMailings = element.all(
by.repeater('landing in project.landings')),
mailings = element.all(
by.repeater('mailing in project.landings | filter:{mailing:true}'));
landingsAndMailings.count().then(function (landingsAndMailingsNumber) {
mailings.count().then(function (mailingsNumber) {
var landingsNumbers = landingsAndMailingsNumber - mailingsNumber;
expect(mailingsNumber).toBe(4);
expect(landingsNumbers).toBe(2);
});
});
});
it("removes a landing", function () {
element.all(by.css('.delete')).first().click(); // <- the problem happens here
expect(
element.all(
by.repeater('landing in project.landings')).count()
).toBe(5);
});
// some other tests
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment