Skip to main content
deleted 6 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

iI am stuck with jasmine. I read/youtubed/googled but seems like iI am on the wrong track... Here

Here is what iI have so far. I've used protractor --elementExplorer to pull items from http://www.angular.io:

    i used protractor --elementExplorer to pull items from 
    http://www.angular.io
    > element.all(by.css('.nav-link')).getText()
    [ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]

Here 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 it appears the elementExplorer return an Array... How do i use it to create my locator and expect statements?

i am stuck with jasmine I read/youtubed/googled but seems like i am on the wrong track... Here is what i have so far:

    i used protractor --elementExplorer to pull items from 
    http://www.angular.io
    > element.all(by.css('.nav-link')).getText()
    [ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]

Here 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 it appears the elementExplorer return an Array... How do i use it to create my locator and expect statements?

I am stuck with jasmine. I read/youtubed/googled but seems like I am on the wrong track.

Here is what I have so far. I've used protractor --elementExplorer to pull items from http://www.angular.io:

> element.all(by.css('.nav-link')).getText()
[ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]

Here is my test:

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 it appears the elementExplorer return an Array... How do i use it to create my locator and expect statements?

deleted 1274 characters in body
Source Link

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?

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.

Here 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

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 get the names with count of 5...

It seems so trivial when watching videos, but when i try to implement it, nothing works.

Thanks

i am stuck with jasmine I read/youtubed/googled but seems like i am on the wrong track... Here is what i have so far:

    i used protractor --elementExplorer to pull items from 
    http://www.angular.io
    > element.all(by.css('.nav-link')).getText()
    [ '', 'FEATURES', 'DOCS', 'RESOURCES', 'EVENTS', 'BLOG' ]

Here 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 it appears the elementExplorer return an Array... How do i use it to create my locator and expect statements?

Source Link

Please help with simple test case in jasmine

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.

Here 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

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 get the names with count of 5...

It seems so trivial when watching videos, but when i try to implement it, nothing works.

Thanks