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


TypeScript testing.E2EPage類代碼示例

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


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

示例1: beforeEach

    beforeEach(async () => {
        page = await newE2EPage({
            html: `
            <dot-textarea
                label='Address:'
                name='Address'
                value='Address'>
            </dot-textarea>`
        });

        element = await page.find('dot-textarea');
        input = await page.find('textarea');
    });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:13,代碼來源:dot-textarea.e2e.ts

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

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

示例4: it

 it('should be valid, touched & dirty ', async () => {
     await page.click('input');
     await page.waitForChanges();
     expect(element.classList.contains('dot-valid')).toBe(true);
     expect(element.classList.contains('dot-dirty')).toBe(true);
     expect(element.classList.contains('dot-touched')).toBe(true);
 });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:7,代碼來源:dot-radio.e2e.ts

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

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

示例7: it

 it('should be invalid, touched & dirty and the error msg should display', async () => {
     await page.click('input');
     await page.waitForChanges();
     // tslint:disable-next-line:max-line-length
     expect(element.outerHTML).toBe(`<dot-checkbox name=\"testName\" label=\"testLabel\" hint=\"testHint\" options=\"valueA|1,valueB|2,valueC|3\" value=\"1\" required-message=\"testErrorMsg\" required=\"true\" class=\"dot-required hydrated dot-invalid dot-dirty dot-touched\"><div class=\"dot-field__label\"><label for=\"testName\">testLabel</label><span class=\"dot-field__required-mark\">*</span></div><input class=\"dot-field__error\" type=\"checkbox\" id=\"1\" value=\"1\"><div class=\"dot-field__label\"><label for=\"1\">valueA</label></div><input class=\"dot-field__error\" type=\"checkbox\" id=\"2\" value=\"2\"><div class=\"dot-field__label\"><label for=\"2\">valueB</label></div><input class=\"dot-field__error\" type=\"checkbox\" id=\"3\" value=\"3\"><div class=\"dot-field__label\"><label for=\"3\">valueC</label></div><span class=\"dot-field__hint\">testHint</span><span class=\"dot-field__error-meessage\">testErrorMsg</span></dot-checkbox>`);
     expect(element.classList.contains('dot-invalid')).toBe(true);
     expect(element.classList.contains('dot-dirty')).toBe(true);
     expect(element.classList.contains('dot-touched')).toBe(true);
 });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:9,代碼來源:dot-checkbox.e2e.ts

示例8: Promise

  return new Promise(async resolve => {
    const [ firstSelector, ...restSelectors ] = selectors;
    let parentElement = await page.$(firstSelector);

    for (const selector of restSelectors) {
      parentElement = await page.evaluateHandle(shadowSelectorFn, parentElement, selector) as any;
    }

    if (parentElement) { resolve(parentElement); }
  });
開發者ID:driftyco,項目名稱:ionic,代碼行數:10,代碼來源:utils.ts

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


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