From 4950e686bcdc22e250870ff35d5db5fc72e00aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Levasseur?= Date: Sun, 24 Mar 2024 20:23:59 -0400 Subject: [PATCH] chore: fix ci (#668) * chore: fix ci * update * update * update * update * update --- package.json | 4 ++-- packages/inject/test/serve.ts | 4 ++++ test/cypress/webchat.cy.ts | 12 +++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 00701667d..8a1e66bb1 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "test:e2e:pg": "cross-env POSTGRESQL=true jest -c ./test/jest.e2e.config.ts", "test:sec:pg": "cross-env POSTGRESQL=true jest -c ./test/jest.security.config.ts", "test:mig:pg": "cross-env POSTGRESQL=true jest -c ./test/jest.migration.config.ts", - "test:chat:chrome": "start-test 'start' http://localhost:3100/status 'ts-node packages/inject/test/serve.ts' 3700 'cypress run --browser chrome'", - "test:chat:firefox": "start-test 'start' http://localhost:3100/status 'ts-node packages/inject/test/serve.ts' 3700 'cypress run --browser firefox'", + "test:chat:chrome": "start-test 'start' 'http://localhost:3100/status' 'ts-node packages/inject/test/serve.ts' '3700' 'cypress run --browser chrome'", + "test:chat:firefox": "start-test 'start' 'http://localhost:3100/status' 'ts-node packages/inject/test/serve.ts' '3700' 'cypress run --browser firefox'", "cypress:open": "cypress open" }, "bin": "./packages/server/dist/index.js", diff --git a/packages/inject/test/serve.ts b/packages/inject/test/serve.ts index 9c927b3f0..eb4d9832b 100644 --- a/packages/inject/test/serve.ts +++ b/packages/inject/test/serve.ts @@ -29,6 +29,10 @@ const startServer = async () => { const app = express() const client = await getMessagingClient() + app.get('/', async (req, res) => { + res.sendStatus(200) + }) + app.get('/getConfig', async (req, res) => { res.json({ client, messagingUrl }) }) diff --git a/test/cypress/webchat.cy.ts b/test/cypress/webchat.cy.ts index 668b9da55..1642f59e7 100644 --- a/test/cypress/webchat.cy.ts +++ b/test/cypress/webchat.cy.ts @@ -16,10 +16,16 @@ describe('Webchat', () => { cy.openWebchat() cy.wait(400) + + cy.log('#### HELLO ###') + checkLifecycleEvent(0, 'CONFIG.SET') - checkLifecycleEvent(1, 'USER.CONNECTED') - checkLifecycleEvent(2, 'LIFECYCLE.LOADED') - // we don't really care about the order of the events between + checkLifecycleEvent(1, 'LIFECYCLE.LOADED') + checkLifecycleEvent(2, 'UI.SET-CLASS') + checkLifecycleEvent(3, 'UI.OPENED') + // checkLifecycleEvent(4, 'UI.SET-CLASS') + checkLifecycleEvent(5, 'USER.CONNECTED') + // checkLifecycleEvent(6, 'USER.CONNECTED') checkLifecycleEvent(7, 'LIFECYCLE.READY') })