Created
November 14, 2016 20:55
-
-
Save Xotabu4/4e5ef8b62399d6bb794a5c0e7e42249f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('Should delete one note', function() { | |
| browser.get(URL) | |
| //заметь что мы вызываем count() сразу. Так мы запомним количество правильно | |
| let countBefore = element.all(by.css('todo-list .small-12')).count() | |
| element($("input[type='checkbox']").click()) | |
| //важно поспать после клика чтобы элемент успел пропасть | |
| browser.sleep(2000) | |
| //Запоминаем количество после клика | |
| let countAfter = element.all(by.css('todo-list .small-12')).count() | |
| //Нельзя использовать === внутри expect, это связано с асинхронностью, если в двух словах - то ты сравниваешь два обьекта, а не числа, и они всегда будут false - твой тест никогда не упадет | |
| //expect(countAfter.count() === countBefore.count()).toBe(false) | |
| expect(countBefore).not.toBe(countAfter) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment