當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript protractor.ElementArrayFinder類代碼示例

本文整理匯總了TypeScript中protractor.ElementArrayFinder的典型用法代碼示例。如果您正苦於以下問題:TypeScript ElementArrayFinder類的具體用法?TypeScript ElementArrayFinder怎麽用?TypeScript ElementArrayFinder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ElementArrayFinder類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: describe

describe('radioButtons example', () => {
  afterEach(verifyNoBrowserErrors);
  let inputs: ElementArrayFinder;
  let paragraphs: ElementArrayFinder;

  beforeEach(() => {
    browser.get('/radioButtons');
    inputs = element.all(by.css('input'));
    paragraphs = element.all(by.css('p'));
  });

  it('should populate the UI with initial values', () => {
    expect(inputs.get(0).getAttribute('checked')).toEqual(null);
    expect(inputs.get(1).getAttribute('checked')).toEqual('true');
    expect(inputs.get(2).getAttribute('checked')).toEqual(null);

    expect(paragraphs.get(0).getText()).toEqual('Form value: { "food": "lamb" }');
    expect(paragraphs.get(1).getText()).toEqual('myFood value: lamb');
  });

  it('update model and other buttons as the UI value changes', () => {
    inputs.get(0).click();

    expect(inputs.get(0).getAttribute('checked')).toEqual('true');
    expect(inputs.get(1).getAttribute('checked')).toEqual(null);
    expect(inputs.get(2).getAttribute('checked')).toEqual(null);

    expect(paragraphs.get(0).getText()).toEqual('Form value: { "food": "beef" }');
    expect(paragraphs.get(1).getText()).toEqual('myFood value: beef');
  });
});
開發者ID:Cammisuli,項目名稱:angular,代碼行數:31,代碼來源:radio_button_spec.ts

示例2: describe

describe('formBuilder example', () => {
  afterEach(verifyNoBrowserErrors);
  let inputs: ElementArrayFinder;
  let paragraphs: ElementArrayFinder;

  beforeEach(() => {
    browser.get('/forms/ts/formBuilder/index.html');
    inputs = element.all(by.css('input'));
    paragraphs = element.all(by.css('p'));
  });

  it('should populate the UI with initial values', () => {
    expect(inputs.get(0).getAttribute('value')).toEqual('Nancy');
    expect(inputs.get(1).getAttribute('value')).toEqual('Drew');
  });

  it('should update the validation status', () => {
    expect(paragraphs.get(1).getText()).toEqual('Validation status: VALID');

    inputs.get(0).click();
    inputs.get(0).clear();
    inputs.get(0).sendKeys('a');
    expect(paragraphs.get(1).getText()).toEqual('Validation status: INVALID');
  });

});
開發者ID:AlmogShaul,項目名稱:angular,代碼行數:26,代碼來源:form_builder_spec.ts

示例3: it

 it('should can post a movimiento when logged in and display it on Lista Movimientos', () => {
   nuevoMovimientoPage.navigateTo();
   nuevoMovimientoPage.createMovimiento('27/03/2017', '20', 'Gasto', 'Compras');
   listaMovimientosPage.navigateTo();
   const listaMovimientos: ElementArrayFinder = listaMovimientosPage.searchListaMovimientos();
   expect(listaMovimientos.count()).toBe(1);
 });
開發者ID:AgoraBinaria,項目名稱:cash-flow,代碼行數:7,代碼來源:app.e2e-spec.ts

示例4: describe

describe('nestedFormArray example', () => {
  afterEach(verifyNoBrowserErrors);
  let inputs: ElementArrayFinder;
  let buttons: ElementArrayFinder;

  beforeEach(() => {
    browser.get('/nestedFormArray');
    inputs = element.all(by.css('input'));
    buttons = element.all(by.css('button'));
  });

  it('should populate the UI with initial values', () => {
    expect(inputs.get(0).getAttribute('value')).toEqual('SF');
    expect(inputs.get(1).getAttribute('value')).toEqual('NY');
  });

  it('should add inputs programmatically', () => {
    expect(inputs.count()).toBe(2);

    buttons.get(1).click();
    inputs = element.all(by.css('input'));

    expect(inputs.count()).toBe(3);
  });

  it('should set the value programmatically', () => {
    buttons.get(2).click();
    expect(inputs.get(0).getAttribute('value')).toEqual('LA');
    expect(inputs.get(1).getAttribute('value')).toEqual('MTV');
  });

});
開發者ID:Cammisuli,項目名稱:angular,代碼行數:32,代碼來源:nested_form_array_spec.ts

示例5: describe

describe('ngModelGroup example', () => {
  afterEach(verifyNoBrowserErrors);
  let inputs: ElementArrayFinder;
  let buttons: ElementArrayFinder;

  beforeEach(() => {
    browser.get('/forms/ts/ngModelGroup/index.html');
    inputs = element.all(by.css('input'));
    buttons = element.all(by.css('button'));
  });

  it('should populate the UI with initial values', () => {
    expect(inputs.get(0).getAttribute('value')).toEqual('Nancy');
    expect(inputs.get(1).getAttribute('value')).toEqual('Drew');
  });

  it('should show the error when name is invalid', () => {
    inputs.get(0).click();
    inputs.get(0).clear();
    inputs.get(0).sendKeys('a');

    expect(element(by.css('p')).getText()).toEqual('Name is invalid.');
  });

  it('should set the value when changing the domain model', () => {
    buttons.get(1).click();
    expect(inputs.get(0).getAttribute('value')).toEqual('Bess');
    expect(inputs.get(1).getAttribute('value')).toEqual('Marvin');
  });

});
開發者ID:charlesyxh,項目名稱:angular,代碼行數:31,代碼來源:ng_model_group_spec.ts

示例6: describe

describe('simpleForm example', () => {
  afterEach(verifyNoBrowserErrors);
  let inputs: ElementArrayFinder;
  let paragraphs: ElementArrayFinder;

  beforeEach(() => {
    browser.get('/simpleForm');
    inputs = element.all(by.css('input'));
    paragraphs = element.all(by.css('p'));
  });

  it('should update the domain model as you type', () => {
    inputs.get(0).click();
    inputs.get(0).sendKeys('Nancy');

    inputs.get(1).click();
    inputs.get(1).sendKeys('Drew');

    expect(paragraphs.get(0).getText()).toEqual('First name value: Nancy');
    expect(paragraphs.get(2).getText()).toEqual('Form value: { "first": "Nancy", "last": "Drew" }');
  });

  it('should report the validity correctly', () => {
    expect(paragraphs.get(1).getText()).toEqual('First name valid: false');
    expect(paragraphs.get(3).getText()).toEqual('Form valid: false');
    inputs.get(0).click();
    inputs.get(0).sendKeys('a');

    expect(paragraphs.get(1).getText()).toEqual('First name valid: true');
    expect(paragraphs.get(3).getText()).toEqual('Form valid: true');
  });

});
開發者ID:Cammisuli,項目名稱:angular,代碼行數:33,代碼來源:simple_form_spec.ts

示例7: 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

示例8: it

  it('should show the error when name is invalid', () => {
    inputs.get(0).click();
    inputs.get(0).clear();
    inputs.get(0).sendKeys('a');

    expect(element(by.css('p')).getText()).toEqual('Name is invalid.');
  });
開發者ID:charlesyxh,項目名稱:angular,代碼行數:7,代碼來源:ng_model_group_spec.ts

示例9: it

  it('should populate the UI with initial values', () => {
    expect(inputs.get(0).getAttribute('checked')).toEqual(null);
    expect(inputs.get(1).getAttribute('checked')).toEqual('true');
    expect(inputs.get(2).getAttribute('checked')).toEqual(null);

    expect(element(by.css('p')).getText()).toEqual('Form value: { "food": "lamb" }');
  });
開發者ID:Cammisuli,項目名稱:angular,代碼行數:7,代碼來源:reactive_radio_button_spec.ts

示例10: it

  it('should add inputs programmatically', () => {
    expect(inputs.count()).toBe(2);

    buttons.get(1).click();
    inputs = element.all(by.css('input'));

    expect(inputs.count()).toBe(3);
  });
開發者ID:Cammisuli,項目名稱:angular,代碼行數:8,代碼來源:nested_form_array_spec.ts


注:本文中的protractor.ElementArrayFinder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。