diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e5b1994 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +playwright.config.ts diff --git a/.gitignore b/.gitignore index d452ac2..fbf8139 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ site # vscode database functionality support files *.session.sql + +# E2E test reports +e2e-test-report/ diff --git a/Dockerfile b/Dockerfile index 6a3132e..018e8b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # https://backstage.io/docs/deployment/docker/#multi-stage-build # Stage 1 - Create yarn install skeleton layer -FROM node:16-bullseye-slim AS packages +FROM node:18-bookworm-slim AS packages WORKDIR /app COPY package.json yarn.lock ./ @@ -13,7 +13,7 @@ COPY plugins plugins RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+ # Stage 2 - Install dependencies and build packages -FROM node:16-bullseye-slim AS build +FROM node:18-bookworm-slim AS build # Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ @@ -50,7 +50,7 @@ RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \ && tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle # Stage 3 - Build the actual backend image and install production dependencies -FROM node:16-bullseye-slim +FROM node:18-bookworm-slim # Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ diff --git a/backstage.json b/backstage.json index ccb71fd..e7d784f 100644 --- a/backstage.json +++ b/backstage.json @@ -1,3 +1,3 @@ { - "version": "1.18.1" + "version": "1.20.3" } diff --git a/lerna.json b/lerna.json index 322929d..529a62f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*", "plugins/*"], "npmClient": "yarn", - "useWorkspaces": true, - "version": "0.1.0" + "version": "0.1.0", + "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package.json b/package.json index 16d4148..ba45e2e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "engines": { - "node": "16 || 18" + "node": "18 || 20" }, "scripts": { "dev": "concurrently \"yarn start\" \"yarn start-backend\"", @@ -30,10 +30,12 @@ ] }, "devDependencies": { - "@backstage/cli": "^0.22.13", + "@backstage/cli": "^0.24.0", + "@backstage/e2e-test-utils": "^0.1.0", + "@playwright/test": "^1.32.3", "@spotify/prettier-config": "^12.0.0", "concurrently": "^6.0.0", - "lerna": "^4.0.0", + "lerna": "^7.3.0", "node-gyp": "^9.0.0", "prettier": "^2.3.2", "typescript": "~5.2.0" diff --git a/packages/app/cypress/.eslintrc.json b/packages/app/cypress/.eslintrc.json deleted file mode 100644 index b903ff2..0000000 --- a/packages/app/cypress/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugins": ["cypress"], - "extends": ["plugin:cypress/recommended"], - "rules": { - "jest/expect-expect": [ - "error", - { - "assertFunctionNames": ["expect", "cy.contains", "cy.**.should"] - } - ] - } -} diff --git a/packages/app/cypress/integration/app.js b/packages/app/cypress/integration/app.js deleted file mode 100644 index 43fb2e3..0000000 --- a/packages/app/cypress/integration/app.js +++ /dev/null @@ -1,6 +0,0 @@ -describe('App', () => { - it('should render the catalog', () => { - cy.visit('/'); - cy.contains('My Company Catalog'); - }); -}); diff --git a/packages/app/e2e-tests/app.test.ts b/packages/app/e2e-tests/app.test.ts new file mode 100644 index 0000000..b02ff3e --- /dev/null +++ b/packages/app/e2e-tests/app.test.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { test, expect } from '@playwright/test'; + +test('App should render the welcome page', async ({ page }) => { + await page.goto('/'); + await expect(page.getByText('My Company Catalog')).toBeVisible(); +}); diff --git a/packages/app/package.json b/packages/app/package.json index 0c5e6e5..1caded1 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -11,40 +11,36 @@ "build": "backstage-cli package build", "clean": "backstage-cli package clean", "test": "backstage-cli package test", - "lint": "backstage-cli package lint", - "test:e2e": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:dev", - "test:e2e:ci": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:run", - "cy:dev": "cypress open", - "cy:run": "cypress run --browser chrome" + "lint": "backstage-cli package lint" }, "dependencies": { - "@backstage/app-defaults": "^1.4.3", - "@backstage/catalog-model": "^1.4.2", - "@backstage/cli": "^0.22.13", - "@backstage/core-app-api": "^1.10.0", - "@backstage/core-components": "^0.13.5", - "@backstage/core-plugin-api": "^1.6.0", - "@backstage/integration-react": "^1.1.19", - "@backstage/plugin-api-docs": "^0.9.11", - "@backstage/plugin-catalog": "^1.13.0", - "@backstage/plugin-catalog-common": "^1.0.16", - "@backstage/plugin-catalog-graph": "^0.2.36", - "@backstage/plugin-catalog-import": "^0.10.0", - "@backstage/plugin-catalog-react": "^1.8.4", - "@backstage/plugin-github-actions": "^0.6.5", - "@backstage/plugin-org": "^0.6.14", - "@backstage/plugin-permission-react": "^0.4.15", - "@backstage/plugin-scaffolder": "^1.15.0", - "@backstage/plugin-scaffolder-react": "^1.5.5", - "@backstage/plugin-search": "^1.4.0", - "@backstage/plugin-search-react": "^1.7.0", - "@backstage/plugin-tech-radar": "^0.6.8", - "@backstage/plugin-techdocs": "^1.7.0", - "@backstage/plugin-techdocs-module-addons-contrib": "^1.1.0", - "@backstage/plugin-techdocs-react": "^1.1.11", - "@backstage/plugin-user-settings": "^0.7.10", - "@backstage/theme": "^0.4.2", - "@frontside/backstage-plugin-humanitec": "^0.3.10", + "@backstage/app-defaults": "^1.4.5", + "@backstage/catalog-model": "^1.4.3", + "@backstage/cli": "^0.24.0", + "@backstage/core-app-api": "^1.11.1", + "@backstage/core-components": "^0.13.8", + "@backstage/core-plugin-api": "^1.8.0", + "@backstage/integration-react": "^1.1.21", + "@backstage/plugin-api-docs": "^0.10.1", + "@backstage/plugin-catalog": "^1.15.1", + "@backstage/plugin-catalog-common": "^1.0.18", + "@backstage/plugin-catalog-graph": "^0.3.1", + "@backstage/plugin-catalog-import": "^0.10.3", + "@backstage/plugin-catalog-react": "^1.9.1", + "@backstage/plugin-github-actions": "^0.6.8", + "@backstage/plugin-org": "^0.6.17", + "@backstage/plugin-permission-react": "^0.4.17", + "@backstage/plugin-scaffolder": "^1.16.1", + "@backstage/plugin-scaffolder-react": "^1.6.1", + "@backstage/plugin-search": "^1.4.3", + "@backstage/plugin-search-react": "^1.7.3", + "@backstage/plugin-tech-radar": "^0.6.10", + "@backstage/plugin-techdocs": "^1.9.1", + "@backstage/plugin-techdocs-module-addons-contrib": "^1.1.2", + "@backstage/plugin-techdocs-react": "^1.1.13", + "@backstage/plugin-user-settings": "^0.7.13", + "@backstage/theme": "^0.4.4", + "@frontside/backstage-plugin-humanitec": "^0.3.11", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@rjsf/core": "^5.10.0", @@ -56,16 +52,14 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/test-utils": "^1.4.3", + "@backstage/test-utils": "^1.4.5", + "@playwright/test": "^1.32.3", "@testing-library/dom": "^8.0.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^12.1.3", "@testing-library/user-event": "^14.0.0", "@types/react-dom": "*", - "cross-env": "^7.0.0", - "cypress": "^9.7.0", - "eslint-plugin-cypress": "^2.10.3", - "start-server-and-test": "^1.10.11" + "cross-env": "^7.0.0" }, "browserslist": { "production": [ diff --git a/packages/app/public/index.html b/packages/app/public/index.html index c6083b3..fc758ee 100644 --- a/packages/app/public/index.html +++ b/packages/app/public/index.html @@ -8,7 +8,6 @@ name="description" content="Backstage is an open platform for building developer portals" /> -