Example #1
0
  describe('different timings', () => {

    let host: ElementFinder;

    beforeEach(() => {
      host = element(by.css('app-hero-list-timings'));
    });

    it('adds and removes element', () => {
      addInactiveHero();

      let li = host.element(by.css('li'));
      expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX);
      expect(li.getCssValue('opacity')).toMatch('1');

      removeHero();
      expect(li.isPresent()).toBe(false);
    });

  });
Example #2
0
  describe('opening and closing', () => {
    let sidenav: ElementFinder;

    beforeEach(() => {
      browser.get('/sidenav');
      sidenav = element(by.tagName('md-sidenav'));
    });

    it('should be closed', () => {
      expect(sidenav.isDisplayed()).toBeFalsy();
    });

    it('should open', () => {
      element(by.buttonText('Open sidenav')).click();
      expect(sidenav.isDisplayed()).toBeTruthy();
    });

    it('should close again', () => {
      element(by.buttonText('Open sidenav')).click();
      element(by.buttonText('Open sidenav')).click();
      expect(sidenav.isDisplayed()).toBeFalsy();
    });
  });
Example #3
0
    it('should fill the memory with past results', () => {
      first.sendKeys('1');
      second.sendKeys('1');
      goButton.click();

      first.sendKeys('10');
      second.sendKeys('20');
      goButton.click();

      let memory = element.all(by.repeater('result in memory').
          column('result.value'));
      memory.then((arr) => {
        expect(arr.length).toEqual(2);
        expect(arr[0].getText()).toEqual('30'); // 10 + 20 = 30
        expect(arr[1].getText()).toEqual('2'); // 1 + 1 = 2
      },
      // TODO: remove optional error fn
      () => {});
    });
 .then(() => {
     return elm.click();
 });
 getTimeElement(time: Number) {
   console.error(`[data-value=${time}]`);
   return this.dtp.element(by.css(`[data-value="${time}"]`));
 }
Example #6
0
 it('should delete a Clicker', () => {
   removeButton.click();
   element.all(by.className('clickerList')).count()
     .then((count) => expect(count).toEqual(0));
 });
Example #7
0
 'test clicker one'.split('').forEach((c) => clickerField.sendKeys(c));
Example #8
0
 function getOffsetWidth(el: ElementFinder): promise.Promise<number> {
   return browser.executeScript(
     'return arguments[0].offsetWidth',
     el.getWebElement()
   );
 }
Example #9
0
 private fillForm(email, password) {
   this.searchElements();
   this.email.sendKeys(email);
   this.password.sendKeys(password);
 }
 it('should populate the form control values in the DOM', () => {
   expect(firstInput.getAttribute('value')).toEqual('Nancy');
   expect(lastInput.getAttribute('value')).toEqual('Drew');
 });