i am stuck with jasmine and need help.
I read/youtubed/googled but seems like i am on the wrong track...
I am learning protractor to automate angular pages written with typescript.
in the 1st example, I used angularjs page to pull few things and they seem to be passing.
I am trying 2nd example to pull items from angular.io page and i am not sure... anything i try fails.
HereHere is what i have so far:
i used protracto --elementExplorer to pull items from http://www.angular.io
element(by.css('.nav-link')).getText()
[20:31:44] W/element - more than one element found for locator By(css selector,
.nav-link) - the first result will be used
5 center links
element.all(by.css('.nav-link')).getText()
[ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]
search textbox
element(by.tagName("input")).getText().click().clear().sendKeys("tutorial")
null
element.all(by.css(".button.hero-cta")).getText()
[ 'GET STARTED' ]
element(by.css(".button")).getText()
[20:45:35] W/element - more than one element found for locator By(css selector,.button) - the first result will be used
GET STARTED
element.all(by.css(".button")).getText()
[ 'GET STARTED', 'LEARN MORE' ]
links on bottom footer blocks
element.all(by.css(".footer-block")).getText()
[ 'RESOURCES\nAbout\nResource Listing\nPress Kit\nBlog',
'HELP\nStack Overflow\nGitter\nReport Issues\nCode of Conduct',
'COMMUNITY\nEvents\nMeetups\nTwitter\nGitHub\nContribute',
'LANGUAGES\n???' ]
firstSpec.ts works fine for angularjs page
i added secondspec.ts below
i used protractor --elementExplorer to pull items from
http://www.angular.io
> element.all(by.css('.nav-link')).getText()
[ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]
import { ElementFinder, browser, by, element } from 'protractor';
describe('angulario homepage verify list', function () { //Suite in Jasmine
it('should check top 5 link buttons', function () { // Test in Jasmine
browser.get('https://angular.io'); // Entering application url in browser
element.all(by.css('.nav-link')).getText()); {
//expect statement goes hereHere is my test
});
});
});
secondspec.ts
import { ElementFinder, browser, by, element } from 'protractor';
describe('angulario homepage verify list', function () { //Suite in Jasmine
it('should check top 5 link buttons', function () { // Test in Jasmine
browser.get('https://angular.io'); // Entering application url in browser
element.all(by.css('.nav-link')).getText()); {
//expect statement goes here
});
});
});
i am trying to ensure 5 links on the center top are present and getit appears the names with count of 5elementExplorer return an Array...
It seems so trivial when watching videos, but when How do i try to implementuse it, nothing works.
Thanks to create my locator and expect statements?