deleteComment() {
   let scrollToEle = element.all(by.css('.comment-container')).get(0);
   let trashIcon = element.all(by.css('.fa.fa-trash-o')).get(0);
   browser.actions().mouseMove(scrollToEle).perform().then(() => waitForElementVisibility(trashIcon))
   .then(() => element.all(by.css('.fa.fa-trash-o')).get(0).click());
 }
Example #2
0
 it('allows ng1 routes', function () {
   browser.get('/index-divide-routes.html#/villain');
   expect(element(by.css('h2')).getText()).toBe('Mr. Nice - No More Mr. Nice Guy');
 });
Example #3
0
 it('bootstraps as expected', function () {
   expect(element(by.css('#message')).getText()).toEqual('Hello world');
 });
Example #4
0
 it('has outputs', function () {
   element.all(by.buttonText('Delete')).first().click();
   expect(element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!');
 });
Example #5
0
 it('can be projected into', function () {
   expect(element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
 });
Example #6
0
 it('first li should show hero name with *ngFor', function () {
   const allLis = element.all(by.tagName('li'));
   expect(allLis.get(0).getText()).toEqual('Mr. Nice');
 });
Example #7
0
 it('should have only one "Hip!" (the other is erased)', function () {
   const paragraph = element.all(by.cssContainingText('p', 'Hip!'));
   expect(paragraph.count()).toEqual(1);
 });
Example #8
0
 it(`selects ${targetHero.name} from hero list`, function () {
   let hero = element(by.cssContainingText('li span.badge', targetHero.id.toString()));
   hero.click();
   // Nothing specific to expect other than lack of exceptions.
 });
		it('"Getting Started" button should route to /help', () => {
			element(by.buttonText('Getting Started')).click();
			expect(browser.getCurrentUrl()).toContain('/help');
		});
Example #10
0
function addToHeroName(text: string): promise.Promise<void> {
  let input = element(by.css('input'));
  return input.sendKeys(text);
}
Example #11
0
function expectHeading(hLevel: number, expectedText: string): void {
    let hTag = `h${hLevel}`;
    let hText = element(by.css(hTag)).getText();
    expect(hText).toEqual(expectedText, hTag);
};
 getCommentsText() {
   return element.all(by.css('.comment-container .comment')).getText();
 }
 getAlertStatus(previousText) {
   let alertStatusElement = element.all(by.css('.metron-slider-pane-details .form .row')).get(0).all(by.css('div')).get(1);
   return this.waitForTextChange(alertStatusElement, previousText).then(() => {
     return alertStatusElement.getText();
   });
 }
 .then(() => element.all(by.css('.fa.fa-trash-o')).get(0).click());
Example #15
0
 getCurrentYear() {
   return element(by.css('.signature .year')).getText();
 }
		it('Page should load', () => {
			element(by.cssContainingText('a', 'Home')).click();
			expect(browser.getCurrentUrl()).toContain('/home');
		});
Example #17
0
 it('first div should show hero name with *ngIf', function () {
   const allDivs = element.all(by.tagName('div'));
   expect(allDivs.get(0).getText()).toEqual('Mr. Nice');
 });
Example #18
0
 beforeEach(() => {
   browser.get('/tabs');
   tabGroup = element(by.css('mat-tab-group'));
   tabLabels = element.all(by.css('.mat-tab-label'));
   tabBodies = element.all(by.css('mat-tab-body'));
 });
Example #19
0
 it('ngSwitch have three <happy-hero> instances', function () {
   const happyHeroEls = element.all(by.tagName('happy-hero'));
   expect(happyHeroEls.count()).toEqual(3);
 });
Example #20
0
 saveButton.click().then(function(){
   expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
 });
Example #21
0
 getParagraphText() {
   return element(by.css('app-root h1')).getText();
 }
 it('should render a spinner', async () => {
   expect(await element(by.css('mat-spinner')).isPresent()).toBe(true);
 });
Example #23
0
 it('supports ng-repeat', function () {
   expect(element.all(by.css('hero-detail')).count()).toBe(3);
 });
 it('should render an indeterminate progress spinner', async () => {
   expect(await element(by.css('mat-progress-spinner[mode="indeterminate"]')).isPresent())
       .toBe(true);
 });
Example #25
0
 it('works', function () {
   expect(element(by.css('h2')).getText()).toBe('1: Windstorm');
 });
Example #26
0
 getParagraphText() {
   return element(by.css('pap-review-root h1')).getText();
 }
Example #27
0
 it('allows ng2 routes', function () {
   browser.get('/index-divide-routes.html#/hero');
   expect(element(by.css('h2')).getText()).toBe('Windstorm - Specific powers of controlling winds');
 });
Example #28
0
 getAllMenus() {
   return element
     .all(by.css('mat-toolbar button.nav-button'))
     .map(elm => elm.getText());
 }
Example #29
0
 it('renders', function () {
   expect(element(by.css('h2')).getText()).toEqual('Windstorm details!');
 });
 closeDetailPane() {
   element(by.css('app-alert-details .close-button')).click();
   browser.sleep(2000);
 }