當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。