本文整理汇总了TypeScript中@stencil/core/testing.E2EElement.getProperty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript E2EElement.getProperty方法的具体用法?TypeScript E2EElement.getProperty怎么用?TypeScript E2EElement.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@stencil/core/testing.E2EElement
的用法示例。
在下文中一共展示了E2EElement.getProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should clear value, set pristine and untouched when input set reset', async () => {
await input.press('A');
element.callMethod('reset');
await page.waitForChanges();
expect(element).toHaveClasses(['dot-pristine', 'dot-untouched', 'dot-valid']);
expect(await input.getProperty('value')).toBe('');
});
示例2: checkComponentModeClasses
export async function checkComponentModeClasses(el: E2EElement, selector?: string) {
// If passed a selector to use, use that, else grab the nodeName
// of the element and remove the ion prefix to get the class selector
const component = selector !== undefined ? selector : el.nodeName.toLowerCase().replace('ion-', '');
const mode = await el.getProperty('mode');
expect(el).toHaveClass(`${component}-${mode}`);
}
示例3: it
it('should clear value, set pristine and untouched when input set reset', async () => {
element.callMethod('reset');
await page.waitForChanges();
expect(element.classList.contains('dot-pristine')).toBe(true);
expect(element.classList.contains('dot-untouched')).toBe(true);
expect(element.classList.contains('dot-invalid')).toBe(true);
expect(await input.getProperty('value')).toBe('');
});
示例4: it
it('should reset event', async () => {
const resetBtn = await element.find('button[type="button"]');
const expectedStatus = Object.assign({}, formStatus);
Object.keys(expectedStatus).forEach(e => expectedStatus[e] = '');
resetBtn.click();
await page.waitForChanges();
const data = await element.getProperty('value');
expect(data).toEqual(expectedStatus);
});
示例5: 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; });
});
示例6: checkModeClasses
export async function checkModeClasses(el: E2EElement) {
const mode = await el.getProperty('mode');
expect(el).toHaveClass(`${mode}`);
}