Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test(ct): test react native events (#14079)
Pavel Feldmana62034a6d6ee
diff --git a/tests/components/ct-react/src/DelayedData.spec.tsx b/tests/components/ct-react/src/DelayedData.spec.tsxindex 99e6f637ac..e42c57f9c0 100644--- a/tests/components/ct-react/src/DelayedData.spec.tsx+++ b/tests/components/ct-react/src/DelayedData.spec.tsx@@ -1,4 +1,4 @@-import { test, expect } from '@playwright/experimental-ct-vue'+import { test, expect } from '@playwright/experimental-ct-react'import { DelayedData } from './DelayedData';test('toHaveText works on delayed data', async ({ mount }) => {diff --git a/tests/components/ct-react/src/Events.spec.tsx b/tests/components/ct-react/src/Events.spec.tsxnew file mode 100644index 0000000000..ec7a4e9b57--- /dev/null+++ b/tests/components/ct-react/src/Events.spec.tsx@@ -0,0 +1,14 @@+import { test, expect } from '@playwright/experimental-ct-react';++test('should marshall events', async ({ mount }) => {+ let event: any;+ const component = await mount(<button onClick={e => event = e }>Submit</button>);+ await component.click();+ expect(event).toEqual(expect.objectContaining({+ type: 'click',+ pageX: expect.any(Number),+ pageY: expect.any(Number),+ ctrlKey: false,+ isTrusted: true,+ }));+});diff --git a/tests/components/ct-react/src/Fetch.spec.tsx b/tests/components/ct-react/src/Fetch.spec.tsxindex 66d97b7356..907051a018 100644--- a/tests/components/ct-react/src/Fetch.spec.tsx+++ b/tests/components/ct-react/src/Fetch.spec.tsx@@ -1,4 +1,4 @@-import { test as _test, expect } from '@playwright/experimental-ct-vue'+import { test as _test, expect } from '@playwright/experimental-ct-react'import { Fetch } from './Fetch';import { serverFixtures } from '../../../../tests/config/serverFixtures';