• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript testing.E2EPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript testing.TestWindow类代码示例发布时间:2022-05-28
下一篇:
TypeScript testing.E2EElement类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap