本文整理匯總了TypeScript中@stencil/core/testing.E2EElement.setProperty方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript E2EElement.setProperty方法的具體用法?TypeScript E2EElement.setProperty怎麽用?TypeScript E2EElement.setProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@stencil/core/testing.E2EElement
的用法示例。
在下文中一共展示了E2EElement.setProperty方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should show Regex validation message', async () => {
element.setProperty('regexCheck', '^[A-Za-z ]+$');
element.setProperty('validationMessage', 'Invalid Address');
await input.press('@');
await page.waitForChanges();
const errorMessage = await page.find('.dot-field__error-meessage');
expect(errorMessage.innerHTML).toBe('Invalid Address');
});
示例2: it
it('should show invalid range validation message', async () => {
element.setProperty('value', '2015-10-01');
await input.press('2');
await page.waitForChanges();
const errorMessage = await page.find('.dot-field__error-meessage');
expect(errorMessage.innerHTML).toBe('Invalid Date Range');
});
示例3: beforeEach
beforeEach(async () => {
page = await newE2EPage();
await page.setContent(
`<dot-form submit-label="Saved" reset-label="Reseted"></dot-form>`
);
element = await page.find('dot-form');
element.setProperty('fields', fields);
await page.waitForChanges();
const txtFields = await element.findAll('dot-textfield');
txtFields.forEach((field, index) => {
field.triggerEvent('valueChange', {
bubbles: true,
cancelable: false,
detail: {
name: fields[index].name,
value: fields[index].value
}
});
});
await page.waitForChanges();
element.getProperty('value').then((data) => { formStatus = data; });
});
示例4: it
it('it should have required as false', async () => {
element.setProperty('required', 'false');
await page.waitForChanges();
const required = await element.getProperty('required');
expect(required).toBeFalsy();
});