Skip to content

Commit

Permalink
VUU-52: Add E2E tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pling-scottlogic committed Oct 4, 2023
1 parent c590db3 commit ff5871c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,42 @@ jobs:
run: cd ./vuu-ui && npm install
- run: cd ./vuu-ui && npm run test:vite

cypress-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: cd ./vuu-ui && npm install
- name: Run end-to-end tests in Chrome
uses: cypress-io/github-action@v3
with:
install: false
working-directory: ./vuu-ui
browser: chrome
build: npm run build
start: npm run showcase
wait-on: "http://localhost:5173"
- name: Run end-to-end tests in Edge
uses: cypress-io/github-action@v3
with:
install: false
working-directory: ./vuu-ui
browser: edge
build: npm run build
start: npm run showcase
wait-on: "http://localhost:5173"

# ensure the vuu example and showcase still build
vuu-and-showcase-build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions vuu-ui/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default defineConfig({
viteConfig,
},
specPattern: "packages/**/src/**/*.cy.{js,ts,jsx,tsx}",
indexHtmlFile: "cypress/support/component/component-index.html",
},

e2e: {
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/cypress/e2e/layout-management/screenshot.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ context("Screenshot", () => {
cy.findByRole("menuitem", { name: "Save Layout" }).click();

// TODO (#VUU24): Don't find by classname, use an accessible selector
cy.get(".vuuSaveLayoutPanel").then((dialog) => {
cy.get(".saveLayoutPanel-panelContainer").then((dialog) => {
cy.wrap(dialog)
.find("img")
.should("be.visible")
Expand Down
2 changes: 1 addition & 1 deletion vuu-ui/cypress/support/e2e/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const SHELL_WITH_NEW_THEME_URL =
"/Apps/ShellWithNewTheme?standalone&theme=vuu";
"/Apps/ShellWithNewThemeAndLayoutManagement?standalone&theme=vuu";

0 comments on commit ff5871c

Please sign in to comment.