Created
March 4, 2019 13:32
-
-
Save ksakae1216/3e398abf2965bfbc90fb7a1c3834314c to your computer and use it in GitHub Desktop.
This file contains 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
import { ElementFinder, browser, by, element } from 'protractor'; | |
describe('angularjs homepage todo list', function () { //Suite in Jasmine | |
it('should add a todo', function () { // Test in Jasmine | |
browser.get('https://angularjs.org'); // Entering application url in browser | |
// Enter text under TODO | |
element(by.model('todoList.todoText')).sendKeys('write first protractor test'); | |
element(by.css('[value="add"]')).click(); // Clicks on 'Add' button | |
// Getting all Todo lists displayed | |
element.all(by.repeater('todo in')).then(function (todoList) { | |
// Asserting the TODO's count as 3 | |
expect(todoList.length.toString()).toEqual('3'); | |
todoList[2].getText().then(function (text) { | |
//Verifying newly entered TODO is added | |
expect(text).toEqual('write first protractor test'); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment