diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml
index f5d8c9b65d..764194b4f4 100644
--- a/.github/workflows/tests_primary.yml
+++ b/.github/workflows/tests_primary.yml
@@ -76,3 +76,21 @@ jobs:
- run: xvfb-run npm run ttest
if: matrix.os == 'ubuntu-latest'
+ test_html_report:
+ name: HTML Report
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v2
+ with:
+ node-version: 12
+ - run: npm i -g npm@8
+ - run: npm ci
+ env:
+ DEBUG: pw:install
+ - run: npm run build
+ - run: npx playwright install --with-deps
+ - run: npm run htest
+ if: matrix.os != 'ubuntu-latest'
+ - run: xvfb-run npm run htest
+ if: matrix.os == 'ubuntu-latest'
diff --git a/package.json b/package.json
index 89d0eafb5d..0867035423 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
"wtest": "playwright test --config=tests/config/default.config.ts --project=webkit",
"atest": "playwright test --config=tests/config/android.config.ts",
"etest": "playwright test --config=tests/config/electron.config.ts",
+ "htest": "playwright test --config=packages/html-reporter",
"ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright-test.config.ts",
"vtest": "cross-env PLAYWRIGHT_DOCKER=1 node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright-test.config.ts",
"test": "playwright test --config=tests/config/default.config.ts",
diff --git a/packages/html-reporter/package.json b/packages/html-reporter/package.json
index a2c087cbac..aee4ad9f33 100644
--- a/packages/html-reporter/package.json
+++ b/packages/html-reporter/package.json
@@ -1,4 +1,4 @@
{
"name": "html-reporter",
"private": true
-}
\ No newline at end of file
+}
diff --git a/packages/html-reporter/playwright.config.ts b/packages/html-reporter/playwright.config.ts
new file mode 100644
index 0000000000..39f093f84e
--- /dev/null
+++ b/packages/html-reporter/playwright.config.ts
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { PlaywrightTestConfig, devices } from '@playwright/test';
+
+const config: PlaywrightTestConfig = {
+ testDir: 'src',
+ snapshotDir: 'snapshots',
+ forbidOnly: !!process.env.CI,
+ retries: process.env.CI ? 2 : 0,
+ use: {
+ trace: 'on-first-retry',
+ },
+ projects: [
+ {
+ name: 'chromium',
+ use: { ...devices['Desktop Chrome'] },
+ },
+ ],
+};
+
+export default config;
diff --git a/packages/html-reporter/playwright.stories.tsx b/packages/html-reporter/playwright.stories.tsx
new file mode 100644
index 0000000000..1e12dbcb6d
--- /dev/null
+++ b/packages/html-reporter/playwright.stories.tsx
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import './src/theme.css';
+import './src/chip.story.tsx';
+import './src/headerView.story.tsx';
diff --git a/packages/html-reporter/src/chip.spec.ts b/packages/html-reporter/src/chip.spec.ts
new file mode 100644
index 0000000000..5c276543fa
--- /dev/null
+++ b/packages/html-reporter/src/chip.spec.ts
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { test, expect } from '../test/componentTest';
+
+test.use({ webpack: require.resolve('../webpack.config.js') });
+
+test('chip expand collapse', async ({ renderComponent }) => {
+ const component = await renderComponent('ChipComponent');
+ await expect(component.locator('text=Chip body')).toBeVisible();
+ // expect(await component.screenshot()).toMatchSnapshot('expanded.png');
+ await component.locator('text=Title').click();
+ await expect(component.locator('text=Chip body')).not.toBeVisible();
+ // expect(await component.screenshot()).toMatchSnapshot('collapsed.png');
+ await component.locator('text=Title').click();
+ await expect(component.locator('text=Chip body')).toBeVisible();
+ // expect(await component.screenshot()).toMatchSnapshot('expanded.png');
+});
+
+test('chip render long title', async ({ renderComponent }) => {
+ const title = 'Extremely long title. '.repeat(10);
+ const component = await renderComponent('ChipComponent', { title });
+ await expect(component).toContainText('Extremely long title.');
+ await expect(component.locator('text=Extremely long title.')).toHaveAttribute('title', title);
+});
+
+test('chip setExpanded is called', async ({ renderComponent }) => {
+ const expandedValues: boolean[] = [];
+ const component = await renderComponent('ChipComponentWithFunctions', {
+ setExpanded: (expanded: boolean) => expandedValues.push(expanded)
+ });
+
+ await component.locator('text=Title').click();
+ expect(expandedValues).toEqual([true]);
+});
diff --git a/packages/html-reporter/src/chip.story.tsx b/packages/html-reporter/src/chip.story.tsx
new file mode 100644
index 0000000000..b8fef79d65
--- /dev/null
+++ b/packages/html-reporter/src/chip.story.tsx
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import React from 'react';
+import { Chip } from './chip';
+import { registerComponent } from '../test/component';
+
+const ChipComponent: React.FC<{
+ title?: string
+}> = ({ title }) => {
+ const [expanded, setExpanded] = React.useState(true);
+ return