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


TypeScript E2EPage.spyOnEvent方法代碼示例

本文整理匯總了TypeScript中@stencil/core/testing.E2EPage.spyOnEvent方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript E2EPage.spyOnEvent方法的具體用法?TypeScript E2EPage.spyOnEvent怎麽用?TypeScript E2EPage.spyOnEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@stencil/core/testing.E2EPage的用法示例。


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

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

示例2: it

    it('should send "submit" event', async () => {
        const expectedSubmit = {};
        const spy = await page.spyOnEvent('onSubmit');
        const saveBtn = await element.find('button[type="submit"]');

        fields.forEach((field) => {
            expectedSubmit[field.name] = field.value;
        });

        saveBtn.click();
        await page.waitForChanges();
        expect(spy).toHaveReceivedEventDetail(expectedSubmit);
    });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:13,代碼來源:dot-form.e2e.ts

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

示例4: beforeEach

 beforeEach(async () => {
     spyStatusChangeEvent = await page.spyOnEvent('statusChange');
     spyValueChange = await page.spyOnEvent('valueChange');
 });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:4,代碼來源:dot-textarea.e2e.ts


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