本文整理匯總了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');
});
});
示例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');
});
});
示例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);
});
示例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');
});
});
示例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');
});
});
示例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');
});
});
示例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');
});
示例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.');
});
示例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" }');
});
示例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);
});