diff --git a/.github/workflows/ui-tests.js.yml b/.github/workflows/ui-tests.js.yml index fd935b914..6efbde4dd 100644 --- a/.github/workflows/ui-tests.js.yml +++ b/.github/workflows/ui-tests.js.yml @@ -66,8 +66,12 @@ jobs: run: yarn start &> server.log & - name: Wait for frontend run: npx wait-on http://0.0.0.0:3333 - - name: Run visual tests + - name: \[Chrome\] Run visual tests run: yarn cy:test + - name: \[Firefox\] Run visual tests + run: yarn cy:test-firefox + - name: \[Edge\] Run visual tests + run: yarn cy:test-edge - name: Upload Debug uses: actions/upload-artifact@v3 with: diff --git a/frontend/cypress.config.ts b/frontend/cypress.config.ts index 39814c7a8..67a644cc7 100644 --- a/frontend/cypress.config.ts +++ b/frontend/cypress.config.ts @@ -2,6 +2,8 @@ import { defineConfig } from "cypress"; import {addMatchImageSnapshotPlugin} from 'cypress-image-snapshot/plugin'; export default defineConfig({ e2e: { + viewportHeight: 900, + viewportWidth: 1400, baseUrl: 'http://0.0.0.0:3333/', setupNodeEvents(on, config) { // implement node event listeners here diff --git a/frontend/cypress/e2e/generalStability.cy.ts b/frontend/cypress/e2e/generalStability.cy.ts new file mode 100644 index 000000000..e02a017f6 --- /dev/null +++ b/frontend/cypress/e2e/generalStability.cy.ts @@ -0,0 +1,34 @@ +describe('Testing general stability', { + viewportHeight: 900, + viewportWidth: 1400, +}, () => { + it('Checking if app will crash', () => { + cy.intercept('/api/account').as('getAccount') + + cy.visit('/') + cy.get(':nth-child(1) > .relative > .p-2').type(Cypress.env('account').replaceAll("\"", '')) + cy.get(':nth-child(2) > .relative > .p-2').type(Cypress.env('password').replaceAll("\"", '')) + cy.get('.justify-center > .h-10').click() + cy.wait('@getAccount') + + cy.get('#search').should('be.visible') + + + cy.get('[href="/2/dashboard"] > span').click() + + cy.get(':nth-child(1) > .relative > :nth-child(1) > #menu-manage-alerts > .w-full').should('be.visible') + + + cy.visit('/client/account') + + cy.get(':nth-child(2) > .profileSettings-module__left--D4pCi > .profileSettings-module__info--DhVpL').should('be.visible') + + cy.get(':nth-child(3) > .relative > :nth-child(1) > .sideMenuItem-module__menuItem--UzuXv > .w-full > .sideMenuItem-module__iconLabel--Cl_48 > .sideMenuItem-module__title--IFkbw').click() + cy.get(':nth-child(4) > .relative > :nth-child(1) > .sideMenuItem-module__menuItem--UzuXv > .w-full > .sideMenuItem-module__iconLabel--Cl_48 > .sideMenuItem-module__title--IFkbw').click() + cy.get(':nth-child(5) > .relative > :nth-child(1) > .sideMenuItem-module__menuItem--UzuXv > .w-full > .sideMenuItem-module__iconLabel--Cl_48 > .sideMenuItem-module__title--IFkbw').click() + + cy.get('.webhooks-module__tabHeader--I0FXb').should('be.visible') + + // if test has not failed, we assume that app is not crashed (so far) + }) +}) \ No newline at end of file diff --git a/frontend/cypress/e2e/replayer.cy.ts b/frontend/cypress/e2e/replayer.cy.ts index 1066d5142..66e758d36 100644 --- a/frontend/cypress/e2e/replayer.cy.ts +++ b/frontend/cypress/e2e/replayer.cy.ts @@ -13,7 +13,7 @@ describe('Replayer visual match test', { }) cy.get(':nth-child(1) > .relative > .p-2').type(Cypress.env('account').replaceAll("\"", '')) cy.get(':nth-child(2) > .relative > .p-2').type(Cypress.env('password').replaceAll("\"", '')) - cy.get('.h-10').click() + cy.get('.justify-center > .h-10').click() cy.wait('@getAccount') cy.visit('3/session/7585361734083637?jumpto=5000&freeze=true') cy.wait(3000) diff --git a/frontend/cypress/snapshots/1st-breakpoint.snap.png b/frontend/cypress/snapshots/1st-breakpoint.snap.png index dc48e741b..228b73148 100644 Binary files a/frontend/cypress/snapshots/1st-breakpoint.snap.png and b/frontend/cypress/snapshots/1st-breakpoint.snap.png differ diff --git a/frontend/cypress/snapshots/2nd-breakpoint.snap.png b/frontend/cypress/snapshots/2nd-breakpoint.snap.png index 8ba63b40f..b5f55882e 100644 Binary files a/frontend/cypress/snapshots/2nd-breakpoint.snap.png and b/frontend/cypress/snapshots/2nd-breakpoint.snap.png differ diff --git a/frontend/cypress/snapshots/Network-Events.snap.png b/frontend/cypress/snapshots/Network-Events.snap.png index faaf1a2e8..f59b8b107 100644 Binary files a/frontend/cypress/snapshots/Network-Events.snap.png and b/frontend/cypress/snapshots/Network-Events.snap.png differ diff --git a/frontend/cypress/snapshots/User-Events.snap.png b/frontend/cypress/snapshots/User-Events.snap.png index 3b37dae25..31aad18e8 100644 Binary files a/frontend/cypress/snapshots/User-Events.snap.png and b/frontend/cypress/snapshots/User-Events.snap.png differ diff --git a/frontend/cypress/snapshots/replayer.cy.ts/1st-breakpoint.snap.png b/frontend/cypress/snapshots/replayer.cy.ts/1st-breakpoint.snap.png new file mode 100644 index 000000000..5e6568a2a Binary files /dev/null and b/frontend/cypress/snapshots/replayer.cy.ts/1st-breakpoint.snap.png differ diff --git a/frontend/cypress/snapshots/replayer.cy.ts/2nd-breakpoint.snap.png b/frontend/cypress/snapshots/replayer.cy.ts/2nd-breakpoint.snap.png new file mode 100644 index 000000000..cc842c601 Binary files /dev/null and b/frontend/cypress/snapshots/replayer.cy.ts/2nd-breakpoint.snap.png differ diff --git a/frontend/cypress/snapshots/replayer.cy.ts/Network-Events.snap.png b/frontend/cypress/snapshots/replayer.cy.ts/Network-Events.snap.png new file mode 100644 index 000000000..a2dbe380a Binary files /dev/null and b/frontend/cypress/snapshots/replayer.cy.ts/Network-Events.snap.png differ diff --git a/frontend/cypress/snapshots/replayer.cy.ts/User-Events.snap.png b/frontend/cypress/snapshots/replayer.cy.ts/User-Events.snap.png new file mode 100644 index 000000000..b46ad5ccd Binary files /dev/null and b/frontend/cypress/snapshots/replayer.cy.ts/User-Events.snap.png differ diff --git a/frontend/package.json b/frontend/package.json index ed8927522..5467b3cc7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,7 +18,9 @@ "build-storybook": "build-storybook", "test": "jest", "cy:open": "cypress open", - "cy:test": "cypress run --browser chrome" + "cy:test": "cypress run --browser chrome", + "cy:test-firefox": "cypress run --browser firefox", + "cy:test-edge": "cypress run --browser edge" }, "dependencies": { "@floating-ui/react-dom-interactions": "^0.10.3",