Skip to content

Commit

Permalink
feat(atomic): add atomic-hosted-ui component (#3649)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/KIT-3009

This PR adds a component that can inject NGSP, trial/legacy hosted
pages, and custom hosted pages.

---------

Co-authored-by: Felix Perron-Brault <fpbrault@coveo.com>
Co-authored-by: Louis Bompart <lbompart@coveo.com>
Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Felix Perron-Brault <fpbrault@gmail.com>
Co-authored-by: Frederic Beaudoin <fbeaudoin@coveo.com>
Co-authored-by: jpmarceau <39384459+jpmarceau@users.noreply.github.com>
  • Loading branch information
6 people authored Jul 12, 2024
1 parent a72c3ac commit 8d52a0d
Show file tree
Hide file tree
Showing 24 changed files with 471 additions and 181 deletions.
25 changes: 0 additions & 25 deletions .github/actions/e2e-atomic-hosted-page/action.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/playwright-atomic-hosted-pages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Playwright Atomic Hosted Pages'
description: 'Run Playwright tests for Atomic Hosted Pages'
runs:
using: composite
steps:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
shell: bash
- name: Run Playwright tests
run: npx playwright test
working-directory: packages/atomic-hosted-page
shell: bash
- uses: actions/upload-artifact@v4
if: always()
with:
name: atomic-hosted-page-playwright-report
path: packages/atomic-hosted-page/playwright-report/
retention-days: 5
4 changes: 2 additions & 2 deletions .github/workflows/masterbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-stencil
e2e-atomic-hosted-page-test:
playwright-atomic-hosted-page-test:
name: 'Run e2e tests for Atomic Hosted Page'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-atomic-hosted-page
- uses: ./.github/actions/playwright-atomic-hosted-pages
e2e-atomic-react-test:
name: 'Run e2e tests on Atomic React'
needs: build
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-stencil
e2e-atomic-hosted-page-test:
playwright-atomic-hosted-page-test:
name: 'Run e2e tests for Atomic Hosted Page'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-atomic-hosted-page
- run: npm run build
- uses: ./.github/actions/playwright-atomic-hosted-pages
e2e-atomic-insight-panel-test:
name: 'Run e2e tests on Atomic insight panel'
needs: build
Expand Down Expand Up @@ -304,6 +305,7 @@ jobs:
- 'build'
- 'lint-check'
- 'unit-test'
- 'playwright-atomic-hosted-page-test'
- 'e2e-atomic-test'
- 'e2e-atomic-csp-test'
- 'e2e-quantic'
Expand All @@ -314,7 +316,6 @@ jobs:
- 'e2e-atomic-angular-test'
- 'e2e-atomic-vuejs-test'
- 'e2e-atomic-stencil-test'
- 'e2e-atomic-hosted-page-test'
- 'e2e-atomic-insight-panel-test'
- 'e2e-headless-ssr-test-app-dev'
- 'e2e-headless-ssr-test-app-prod'
Expand All @@ -338,6 +339,7 @@ jobs:
- 'build'
- 'lint-check'
- 'unit-test'
- 'playwright-atomic-hosted-page-test'
- 'e2e-atomic-test'
- 'e2e-atomic-screenshots'
- 'e2e-atomic-react-test'
Expand All @@ -346,7 +348,6 @@ jobs:
- 'e2e-atomic-angular-test'
- 'e2e-atomic-vuejs-test'
- 'e2e-atomic-stencil-test'
- 'e2e-atomic-hosted-page-test'
- 'e2e-atomic-insight-panel-test'
- 'e2e-headless-ssr-test-app-dev'
- 'e2e-headless-ssr-test-app-prod'
Expand Down
14 changes: 11 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/atomic-hosted-page/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ $RECYCLE.BIN/
Thumbs.db
UserInterfaceState.xcuserstate
.env
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
28 changes: 0 additions & 28 deletions packages/atomic-hosted-page/cypress.config.ts

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/atomic-hosted-page/cypress/fixtures/example.json

This file was deleted.

22 changes: 0 additions & 22 deletions packages/atomic-hosted-page/cypress/plugins/index.js

This file was deleted.

25 changes: 0 additions & 25 deletions packages/atomic-hosted-page/cypress/support/commands.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/atomic-hosted-page/cypress/support/e2e.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/atomic-hosted-page/cypress/tsconfig.json

This file was deleted.

9 changes: 4 additions & 5 deletions packages/atomic-hosted-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
"scripts": {
"clean": "rimraf -rf dist/*",
"build": "nx build",
"dev": "node --max_old_space_size=6144 ../../node_modules/@stencil/core/bin/stencil build --dev --watch --serve",
"e2e:watch": "cypress open --browser chrome --e2e",
"e2e": "cypress run --browser chrome",
"start": "node --max_old_space_size=6144 ../../node_modules/@stencil/core/bin/stencil build --dev --watch --serve",
"e2e": "playwright test",
"validate:definitions": "tsc --noEmit --esModuleInterop --skipLibCheck ./dist/types/components.d.ts",
"publish:npm": "npm run-script -w=@coveo/release npm-publish",
"publish:bump": "npm run-script -w=@coveo/release bump",
Expand All @@ -37,7 +36,7 @@
},
"devDependencies": {
"@coveo/release": "1.0.0",
"cypress": "13.9.0",
"cypress-repeat": "2.3.4"
"@playwright/test": "1.44.1",
"@types/node": "20.14.1"
}
}
81 changes: 81 additions & 0 deletions packages/atomic-hosted-page/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import {defineConfig, devices} from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']},
},

{
name: 'firefox',
use: {...devices['Desktop Firefox']},
},

{
name: 'webkit',
use: {...devices['Desktop Safari']},
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm start',
cwd: __dirname,
timeout: 10 * 60e3,
port: 3335,
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
stderr: 'pipe',
},
});
Loading

0 comments on commit 8d52a0d

Please sign in to comment.