Skip to content

Commit

Permalink
test: add e2e smoke tests for headless-ssr utils (#3093)
Browse files Browse the repository at this point in the history
* setup ssr sub-package

https://coveord.atlassian.net/browse/KIT-2600

* wip: add define search engine and related types

https://coveord.atlassian.net/browse/KIT-2600

* copy more type defs from benjamin's branch

https://coveord.atlassian.net/browse/KIT-2600

* specify node version to fix eslint errors reg unsupported node features

node version as per headless doc https://docs.coveo.com/en/headless/latest/usage/
https://coveord.atlassian.net/browse/KIT-2600

* complete copying over all required types

https://coveord.atlassian.net/browse/KIT-2600

* rename couple of types to match underlying names

https://coveord.atlassian.net/browse/KIT-2600

* reorder types based on usage

https://coveord.atlassian.net/browse/KIT-2600

* add headless ssr import path to atomic dev build

https://coveord.atlassian.net/browse/KIT-2600

* add nextjs app for headless ssr example

https://coveord.atlassian.net/browse/KIT-2600

* trim generated files to simplify

https://coveord.atlassian.net/browse/KIT-2600

* add headless as dep

https://coveord.atlassian.net/browse/KIT-2600

* export define search engine from headless ssr

https://coveord.atlassian.net/browse/KIT-2600

* remove async from hydrate as it can't be used with CSR

https://coveord.atlassian.net/browse/KIT-2600

* add sample page using headless ssr utils

https://coveord.atlassian.net/browse/KIT-2600

* simplify result list render, move engine to common dir

https://coveord.atlassian.net/browse/KIT-2600

* fix no-async-promise-executor eslint error

https://coveord.atlassian.net/browse/KIT-2600

* update todos

https://coveord.atlassian.net/browse/KIT-2600

* Revert "remove async from hydrate as it can't be used with CSR"

This reverts commit 256aaab.
https://coveord.atlassian.net/browse/KIT-2600

* render sample with async hydrate

https://coveord.atlassian.net/browse/KIT-2600

* add unit tests

https://coveord.atlassian.net/browse/KIT-2600

* Fix headless isExpiredTokenError (KIT-2620)

https://coveord.atlassian.net/browse/KIT-2600

* add test for results

https://coveord.atlassian.net/browse/KIT-2600

* update comments

* update name, desc of sample pkg

* add a project json to headless ssr pkg

* update headless

* remove pkg lock

* regen root pkg lock

https://coveord.atlassian.net/browse/KIT-2600

* Revert "add headless ssr import path to atomic dev build"

This reverts commit 19c4196.

* pkg json update after build

https://coveord.atlassian.net/browse/KIT-2600

* reorg files under /src/

* add root to eslint config

https://coveord.atlassian.net/browse/KIT-2600

* fix dep list for effect

https://coveord.atlassian.net/browse/KIT-2600

* use suspense when loading

https://coveord.atlassian.net/browse/KIT-2600

* use any action type from redux

https://coveord.atlassian.net/browse/KIT-2600

* add eslint config to ignore unused vars/args starting with underscore

https://coveord.atlassian.net/browse/KIT-2600

* mark exports as @internal

https://coveord.atlassian.net/browse/KIT-2600

* split types into smaller files

https://coveord.atlassian.net/browse/KIT-2600

* split types part 2

https://coveord.atlassian.net/browse/KIT-2600

* change internal tag to beta

https://coveord.atlassian.net/browse/KIT-2600

* move map obj to utils file

https://coveord.atlassian.net/browse/KIT-2600

* move type files under a types/ dir

https://coveord.atlassian.net/browse/KIT-2600

* split types part 3

https://coveord.atlassian.net/browse/KIT-2600

* add loading page for automatic suspense

https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming
https://coveord.atlassian.net/browse/KIT-2600

* remove loading cmp

https://coveord.atlassian.net/browse/KIT-2600

* render results directly

https://coveord.atlassian.net/browse/KIT-2600

* rename initial state in controller snapshot to remove redundancy/confusion

https://coveord.atlassian.net/browse/KIT-2600

* add custom controller to fetch results from snapshot

https://coveord.atlassian.net/browse/KIT-2600

* mark SSR exported members as @internal

https://coveord.atlassian.net/browse/KIT-2600

* move map object into headless utils

https://coveord.atlassian.net/browse/KIT-2600

* move search engine types to its own file

https://coveord.atlassian.net/browse/KIT-2600

* rename to remove redundant suffix from type files

https://coveord.atlassian.net/browse/KIT-2600

* add new line

https://coveord.atlassian.net/browse/KIT-2600

* update pkg lock

* rename snapshot to initial state

https://coveord.atlassian.net/browse/KIT-2600

* fix eslint no async promise executor

https://coveord.atlassian.net/browse/KIT-2600

* add cypress

https://coveord.atlassian.net/browse/KIT-2643

* add csr smoke test

https://coveord.atlassian.net/browse/KIT-2643

* add web vitals check

https://coveord.atlassian.net/browse/KIT-2643

* add gh action for e2e

https://coveord.atlassian.net/browse/KIT-2643

* add base url config

https://coveord.atlassian.net/browse/KIT-2643

* add specific vitals thresholds based on current stats

https://coveord.atlassian.net/browse/KIT-2643

* add timestamp to rendered results

https://coveord.atlassian.net/browse/KIT-2643

* add ssr smoke test

https://coveord.atlassian.net/browse/KIT-2643

* add test

https://coveord.atlassian.net/browse/KIT-2643

* add note

https://coveord.atlassian.net/browse/KIT-2643

* add span for hydrated msg

https://coveord.atlassian.net/browse/KIT-2643

* modify web vitals thresholds to accommodate CI env

https://coveord.atlassian.net/browse/KIT-2643

* remove unused autogenerated file

https://coveord.atlassian.net/browse/KIT-2643

* remove autogenerated unused e2e file

https://coveord.atlassian.net/browse/KIT-2643

* add cypress config to disable support file

https://coveord.atlassian.net/browse/KIT-2643

* update cypress to v12 and update other deps as well

https://coveord.atlassian.net/browse/KIT-2643

* update test to work with cy12, turn off video

https://coveord.atlassian.net/browse/KIT-2643

* ci: add next cache, enable cy install

https://coveord.atlassian.net/browse/KIT-2643

* revert next to previous patch version

to workaround err UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
https://coveord.atlassian.net/browse/KIT-2643

* ci: remove next cache

actions/setup-python#476
https://coveord.atlassian.net/browse/KIT-2643

* use project instead of working dir

to fix Error: Action failed. Missing package manager lockfile.
https://coveord.atlassian.net/browse/KIT-2643

* revert to using working dir with install false

https://coveord.atlassian.net/browse/KIT-2643
  • Loading branch information
mrrajamanickam-coveo authored Aug 11, 2023
1 parent 545aa53 commit 7ce3945
Show file tree
Hide file tree
Showing 9 changed files with 853 additions and 432 deletions.
26 changes: 26 additions & 0 deletions .github/actions/e2e-headless-ssr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Headless SSR E2E tests'
description: 'Runs Cypress tests for Headless SSR'
inputs:
github-token:
description: The GitHub token for accurately detecting a build vs a re-run build
required: false
default: ''
runs:
using: composite
steps:
- uses: cypress-io/github-action@v5
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
working-directory: ./packages/samples/headless-ssr
start: npm run prod
wait-on: 'http://localhost:3000'
install: false
record: false

- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: packages/samples/headless-ssr/cypress/screenshots
11 changes: 10 additions & 1 deletion .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-atomic-insight-panel
e2e-headless-ssr-test:
name: 'Run e2e tests on Headless SSR sample'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-headless-ssr
e2e-quantic-setup:
name: 'Setup e2e tests on Quantic'
needs: build
Expand All @@ -152,7 +160,8 @@ jobs:
strategy:
fail-fast: false
matrix:
spec: [
spec:
[
'cypress/e2e/default-1/**/*',
'cypress/e2e/default-2/**/*',
'cypress/e2e/facets-1/**/*',
Expand Down
Loading

0 comments on commit 7ce3945

Please sign in to comment.