当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ElementFinder.sendKeys方法代码示例

本文整理汇总了TypeScript中protractor.ElementFinder.sendKeys方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ElementFinder.sendKeys方法的具体用法?TypeScript ElementFinder.sendKeys怎么用?TypeScript ElementFinder.sendKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.ElementFinder的用法示例。


在下文中一共展示了ElementFinder.sendKeys方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: createMovimiento

 createMovimiento(date, importe, tipo, categoria) {
   this.searchElements(categoria);
   this.fecha.sendKeys(date);
   this.importe.sendKeys(importe);
   this.tipos.get(1).click();
   this.categoria.click();
   element(by.css('button')).click();
 }
开发者ID:AgoraBinaria,项目名称:cash-flow,代码行数:8,代码来源:nuevo-movimiento.po.ts

示例2: expect

        browser.manage().logs().get('browser').then(() => {
          trigger.sendKeys(protractor.Key.ENTER).then(() => {
            browser.sleep(5000).then(() => {
              // At the end of the time the scrolling should be at the specific target position
              page.getScrollPos().then((pos: number) => {
                expect(pos).toBeCloseTo(headingLocation.y, Closeness.ofByOne);
              });
              // Inspect the console logs, they should contain all in between scroll positions
              // Using the browser.sleep() to execute some code while the animation is running does not work
              // consistently across browser, especially causing problems with the CI server
              browser.manage().logs().get('browser').then(browserLog => {
                const scrollPositionHistory = browserLog
                  .filter(log => log.message.indexOf('Scroll Position: ') >= 0) // only take scroll position logs
                  .map(log => parseInt(log.message.split(' ').reverse()[0], 10)); // parse scroll logs into ints

                expect(scrollPositionHistory.length).toBeGreaterThan(0);
                // Iterate over all scroll position logs and make sure the increment is always nearly the same
                // (as it should be the case for linear easing)

                const totalScrollDistance = headingLocation.y - initialPos;
                const averageScrollPosChange = scrollPositionHistory[scrollPositionHistory.length - 1]
                  / scrollPositionHistory.length;
                // Allow some variation (the exact absolute value is made to depend on the total scroll distance)
                const closeToEpsilon = Closeness.ofBy(totalScrollDistance * 0.0075);

                for (let i = 0; i < scrollPositionHistory.length - 2; i++) {
                  const scrollPosChange = scrollPositionHistory[i + 1] - scrollPositionHistory[i];
                  expect(scrollPosChange).toBeCloseTo(averageScrollPosChange, closeToEpsilon);
                }
              });
            });
          });
        });
开发者ID:Nolanus,项目名称:ng2-page-scroll,代码行数:33,代码来源:easing-functions.e2e-spec.ts

示例3: it

  it('should report the validity correctly', () => {
    expect(paragraphs.get(1).getText()).toEqual('Valid: false');
    input.click();
    input.sendKeys('a');

    expect(paragraphs.get(1).getText()).toEqual('Valid: true');
  });
开发者ID:Cammisuli,项目名称:angular,代码行数:7,代码来源:simple_ng_model_spec.ts

示例4: it

    it('should show the error when the form is invalid', () => {
      firstInput.click();
      firstInput.clear();
      firstInput.sendKeys('a');

      expect(element(by.css('div')).getText()).toEqual('Name is too short.');
    });
开发者ID:AlmogShaul,项目名称:angular,代码行数:7,代码来源:simple_form_group_spec.ts

示例5: it

 it('should display Clickers when Clickers link is selected', () => {
   element(by.css('.bar-button-menutoggle')).click();
   element.all(by.css('ion-label')).first().click();
   clickerField.sendKeys('deal with protractor');
   clickerButton.click();
   expect(clickerList.getText()).toContain('deal with protractor');
 });
开发者ID:BilelKrichen,项目名称:clicker,代码行数:7,代码来源:clickerList.e2e.ts

示例6: sendKeysOnElement

 async sendKeysOnElement(xpath:string, data:string, timeOut=this.timeOut) {
     console.log("Sending key to element " + xpath)
     var ele:ElementFinder = await this.curBrowser.element(by.xpath(xpath));
     await this.curBrowser.wait(this.until.presenceOf(ele), timeOut, 'Element ' + xpath +' takes too long to appear in the DOM');
     await this.curBrowser.wait(this.until.visibilityOf(ele), timeOut, 'Element '+ xpath +' is not visible');
     await ele.sendKeys(data)
 }
开发者ID:AnhPhamIT,项目名称:Protractor,代码行数:7,代码来源:actionSupport.ts

示例7:

 elemFinder.getAttribute('value').then((value: string) => {
     let index: number = value.indexOf('@');
     if(index > 0) {
         value = value.substring(0, index);
     }
     elemFinder.clear();
     elemFinder.sendKeys(value + timestamp);
 });
开发者ID:GeoscienceAustralia,项目名称:gnss-site-manager,代码行数:8,代码来源:test.utils.ts

示例8: it

    it('should show the correct validity state', () => {
      expect(statusP.getText()).toEqual('Validation status: VALID');

      input.click();
      input.clear();
      input.sendKeys('a');
      expect(statusP.getText()).toEqual('Validation status: INVALID');
    });
开发者ID:Cammisuli,项目名称:angular,代码行数:8,代码来源:simple_form_control_spec.ts

示例9: it

    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
      () => {});
    });
开发者ID:angular,项目名称:protractor-cookbook,代码行数:19,代码来源:spec.ts


注:本文中的protractor.ElementFinder.sendKeys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。