@ionic/core
Version:
Base components for Ionic
42 lines (41 loc) • 1.85 kB
JavaScript
import { newE2EPage } from '@stencil/core/testing';
test.skip('item: inputs', async () => {
const page = await newE2EPage({
url: '/src/components/item/test/inputs?ionic:_testing=true'
});
await page.click('#submit');
await checkFormResult(page, '{"date":"","select":"n64","toggle":"","input":"","input2":"","checkbox":""}');
await page.waitFor(100);
let compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
await page.click('#btnDisabled');
await page.click('#submit');
await checkFormResult(page, '{}');
await page.waitFor(100);
compare = await page.compareScreenshot('should disable all');
expect(compare).toMatchScreenshot();
await page.click('#btnDisabled');
await page.click('#btnSomeValue');
await page.waitFor(100);
await page.click('#submit');
await checkFormResult(page, '{"date":"2016-12-09","select":"nes","toggle":"on","input":"Some text","input2":"Some text","checkbox":"on"}');
await page.waitFor(100);
compare = await page.compareScreenshot('should reenable and set value');
expect(compare).toMatchScreenshot();
await page.click('#btnNullValue');
await page.waitFor(100);
compare = await page.compareScreenshot('should set null');
expect(compare).toMatchScreenshot();
await page.click('#btnEmptyValue');
await page.waitFor(100);
compare = await page.compareScreenshot('should set empty');
expect(compare).toMatchScreenshot();
await page.click('#btnEmptyValue');
await page.waitFor(100);
compare = await page.compareScreenshot('should set empty');
expect(compare).toMatchScreenshot();
});
async function checkFormResult(page, content) {
const div = await page.find('#form-result');
expect(div.textContent).toEqual(content);
}