当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript E2EPage.find方法代码示例

本文整理汇总了TypeScript中@stencil/core/testing.E2EPage.find方法的典型用法代码示例。如果您正苦于以下问题:TypeScript E2EPage.find方法的具体用法?TypeScript E2EPage.find怎么用?TypeScript E2EPage.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@stencil/core/testing.E2EPage的用法示例。


在下文中一共展示了E2EPage.find方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: 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');
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:7,代码来源:dot-date.e2e.ts

示例2: 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');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:9,代码来源:dot-textarea.e2e.ts

示例3: beforeEach

    beforeEach(async () => {
        page = await newE2EPage({
            html: `
              <dot-textfield
                    label='Name:'
                    name='fullName'
                    value='John'
                    hint='this is a hint'
                    placeholder='Enter Name'
                    regex-check='^[A-Za-z ]+$'
                    validation-message="Invalid Name"
                    required
                    required-message="Required Name"
                ></dot-textfield>`
        });

        spyStatusChangeEvent = await page.spyOnEvent('statusChange');
        spyValueChange = await page.spyOnEvent('valueChange');
        element = await page.find('dot-textfield');
        input = await page.find('input');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:21,代码来源:dot-texfield.e2e.ts

示例4: beforeEach

    beforeEach(async () => {
        page = await newE2EPage({
            html: `
              <dot-date
                    label="Date:"
                    name="date01"
                    value="2019-01-20"
                    hint="date hint"
                    required
                    required-message="Required Date"
                    validation-message="Invalid Date Range"
                    min="2019-01-01"
                    max="2019-10-30"
                    step="2"
                ></dot-date>`
        });

        spyStatusChangeEvent = await page.spyOnEvent('statusChange');
        spyValueChange = await page.spyOnEvent('valueChange');
        element = await page.find('dot-date');
        input = await page.find('input');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:22,代码来源:dot-date.e2e.ts

示例5: beforeEach

    beforeEach(async () => {
        page = await newE2EPage();

        await page.setContent(`
        <dot-radio
            name="testRadio"
            label="testLabel"
            hint="testHint"
            options="valueA|1,valueB|2,valueC|3"
            value="2"
            required="true"
            required-message="testErrorMsg"
            >
        </dot-radio>`);
        element = await page.find('dot-radio');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:16,代码来源:dot-radio.e2e.ts

示例6: beforeEach

    beforeEach(async () => {
        page = await newE2EPage();

        await page.setContent(`
        <dot-select
            name="testName"
            label="testLabel"
            hint="testHint"
            options="|,valueA|1,valueB|2"
            value="2"
            required-message="testErrorMsg"
            required="true"
            >
        </dot-select>`);
        element = await page.find('dot-select');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:16,代码来源:dot-select.e2e.ts

示例7: it

    it('should listen for valueChange', async () => {
        const textField = await page.find('dot-textfield');
        const newValue = {
            name: 'field1',
            value: 'test2'
        };

        textField.triggerEvent('valueChange', {
            bubbles: true,
            cancelable: false,
            detail: newValue
        });

        formStatus = {...formStatus, field1: 'test2' };

        await page.waitForChanges();
        element.getProperty('value').then((data) => {
            expect(data).toEqual(formStatus);
        });
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:20,代码来源:dot-form.e2e.ts

示例8: 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; });
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:22,代码来源:dot-form.e2e.ts

示例9: checkFormResult

async function checkFormResult(page: E2EPage, content: string) {
  const div = await page.find('#form-result');
  expect(div.textContent).toEqual(content);
}
开发者ID:Assperia,项目名称:ionic,代码行数:4,代码来源:e2e.ts


注:本文中的@stencil/core/testing.E2EPage.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。