JS Assertions
describe('',function(){
it('',function(){
console.log('Hello how are you');
browser.get('http://juliemr.github.io/protractor-demo/');
element(by.model('first')).sendKeys('12').then(function(){
browser.sleep('3000');
});
element(by.css("input[ng-model='second']")).sendKeys('14').then(function(){
browser.sleep('4000');
});
element(by.id('gobutton')).click().then(function(){
browser.sleep('6000');
})
//get text from page
element(by.css("h2[class='ng-binding']")).getText().then(function(text){
console.log(text);
console.log(typeof(text));
})
//assertions
expect(element(by.css("h2[class='ng-binding']")).getText()).toBe('26');
//literals numbers
expect(element(by.css("h2[class='ng-binding']")).getText()).toEqual('26');
})
})
describe('hello world',function(){
it('JavaScript world',function(){
var a= 12;
var b=12;
expect(a).toEqual(b);
expect(null).toBe(null);
expect(a).toBe(null);
})
})
Comments
Post a Comment