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()); }
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'); });
it('bootstraps as expected', function () { expect(element(by.css('#message')).getText()).toEqual('Hello world'); });
it('has outputs', function () { element.all(by.buttonText('Delete')).first().click(); expect(element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!'); });
it('can be projected into', function () { expect(element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds'); });
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'); });
it('should have only one "Hip!" (the other is erased)', function () { const paragraph = element.all(by.cssContainingText('p', 'Hip!')); expect(paragraph.count()).toEqual(1); });
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'); });
function addToHeroName(text: string): promise.Promise<void> { let input = element(by.css('input')); return input.sendKeys(text); }