diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 12ae8af30..52b3b239b 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -167,34 +167,26 @@ jobs: ./cypress/run-docker-firefox.sh - test-vite-example-firefox: - name: Vite, Firefox + test-vite-example: + name: Vite Example runs-on: ubuntu-20.04 - defaults: - run: - working-directory: ./examples/Vite steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + - name: Test Vite Example on Chrome + uses: cypress-io/github-action@v4 with: - node-version: '16' - - - name: Install - run: | - npm install - - - name: Build - run: | - npm run build + working-directory: ./examples/Vite + browser: chrome + start: npm start - - name: Test Firefox - run: | - # Allow writing test output in the Docker image - sudo chmod -R 777 cypress - # To debug locally, run `./cypress/run-docker-firefox.sh -d` - ./cypress/run-docker-firefox.sh + - name: Test Vite Example on Firefox + uses: cypress-io/github-action@v4 + with: + working-directory: ./examples/Vite + browser: firefox + start: npm start test-debugging-example: name: Debugging diff --git a/examples/Vite/.gitignore b/examples/Vite/.gitignore index 2d2e28c5d..944d46199 100644 --- a/examples/Vite/.gitignore +++ b/examples/Vite/.gitignore @@ -1,3 +1,2 @@ -cypress/support cypress/videos cypress/screenshots diff --git a/examples/Vite/cypress.config.js b/examples/Vite/cypress.config.js new file mode 100644 index 000000000..d631b1a0a --- /dev/null +++ b/examples/Vite/cypress.config.js @@ -0,0 +1,12 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + e2e: { + defaultCommandTimeout: 8000, + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + // implement node event listeners here + }, + }, +}) diff --git a/examples/Vite/cypress.json b/examples/Vite/cypress.json deleted file mode 100644 index 0967ef424..000000000 --- a/examples/Vite/cypress.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/examples/Vite/cypress/integration/load_data_spec.js b/examples/Vite/cypress/e2e/load_data.cy.js similarity index 100% rename from examples/Vite/cypress/integration/load_data_spec.js rename to examples/Vite/cypress/e2e/load_data.cy.js diff --git a/examples/Vite/cypress/plugins/index.js b/examples/Vite/cypress/plugins/index.js deleted file mode 100644 index 59b2bab6e..000000000 --- a/examples/Vite/cypress/plugins/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/// -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ -// eslint-disable-next-line no-unused-vars -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/examples/Vite/cypress/support/commands.js b/examples/Vite/cypress/support/commands.js new file mode 100644 index 000000000..119ab03f7 --- /dev/null +++ b/examples/Vite/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) diff --git a/examples/Vite/cypress/support/e2e.js b/examples/Vite/cypress/support/e2e.js new file mode 100644 index 000000000..d68db96df --- /dev/null +++ b/examples/Vite/cypress/support/e2e.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/examples/Vite/package-lock.json b/examples/Vite/package-lock.json index 5afbee0c7..607ded4fe 100644 --- a/examples/Vite/package-lock.json +++ b/examples/Vite/package-lock.json @@ -1,30 +1,30 @@ { "name": "itk-vite-example", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "itk-vite-example", - "version": "1.0.0", + "version": "1.0.1", "license": "Apache-2.0", "dependencies": { "curry": "^1.2.0", - "itk-image-io": "^1.0.0-b.6", - "itk-mesh-io": "^1.0.0-b.6", - "itk-wasm": "^1.0.0-b.6" + "itk-image-io": "^1.0.0-b.18", + "itk-mesh-io": "^1.0.0-b.18", + "itk-wasm": "^1.0.0-b.18" }, "devDependencies": { - "cypress": "^9.5.2", + "cypress": "^10.3.0", "rollup-plugin-copy": "^3.4.0", "start-server-and-test": "^1.14.0", "vite": "^2.8.6" } }, "node_modules/@babel/runtime": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", - "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz", + "integrity": "sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ==", "dependencies": { "regenerator-runtime": "^0.13.4" }, @@ -677,9 +677,9 @@ "integrity": "sha1-nm3SiVSNun5lPVrj/pA/59+zOvI=" }, "node_modules/cypress": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.2.tgz", - "integrity": "sha512-gYiQYvJozMzDOriUV1rCt6CeRM/pRK4nhwGJj3nJQyX2BoUdTCVwp30xDMKc771HiNVhBtgj5o5/iBdVDVXQUg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", + "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -715,7 +715,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -1427,9 +1427,9 @@ "dev": true }, "node_modules/fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1816,25 +1816,25 @@ "dev": true }, "node_modules/itk-image-io": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-image-io/-/itk-image-io-1.0.0-b.6.tgz", - "integrity": "sha512-rg8xHqsRLm84GTidlBeJOuM4BTgw6ad44aloFBwhDS5wwseRc9U+NIlGvr9oog5aIlMEpQPp32nd7VbCQPLzPw==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-image-io/-/itk-image-io-1.0.0-b.18.tgz", + "integrity": "sha512-bvrn7dLdP5AkqpSdai849dzlbsS3YHs098BmKD1ZdfepARDjGs07kEsnSSQmy20CrRbIdG1vHcNkq5U37zWhKQ==", "dependencies": { - "itk-wasm": "1.0.0-b.6" + "itk-wasm": "1.0.0-b.18" } }, "node_modules/itk-mesh-io": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-mesh-io/-/itk-mesh-io-1.0.0-b.6.tgz", - "integrity": "sha512-JCrZLaH9yauxy4E5Avf4J9wYueRBAZQUkPj9uJ+9uXkksR/29gI66B6yL05X7GuVJJf0eJNAdn9Xd2IO9/Gk8A==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-mesh-io/-/itk-mesh-io-1.0.0-b.18.tgz", + "integrity": "sha512-3iV4Mx2GkXwC18susbRfIrZ4eZFCeM5yCEleALHlMDekrQAv/7Yo/6aq9lrWQN+Q8gGSNf5FE/Yk2bbmTqFcuQ==", "dependencies": { - "itk-wasm": "1.0.0-b.6" + "itk-wasm": "1.0.0-b.18" } }, "node_modules/itk-wasm": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-wasm/-/itk-wasm-1.0.0-b.6.tgz", - "integrity": "sha512-Vl0La4CTEepsFVgzKh6zOhlHlTCJgY2vRzKPpAigUS1dEfpiUzf2m2i3wOmDMyptFZIpbSffU5cUakKnHBhrxA==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-wasm/-/itk-wasm-1.0.0-b.18.tgz", + "integrity": "sha512-k4vSWbHWVoDueZ0wXxfK52qZ/BMjNM0YTKawQKrpsvC2GX7MSVkZpYArZ81XKd8OkTS8uXCWWh+LS0I0otFp2A==", "dependencies": { "@babel/runtime": "^7.15.4", "@types/emscripten": "^1.39.6", @@ -3109,9 +3109,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", - "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz", + "integrity": "sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -3619,9 +3619,9 @@ "integrity": "sha1-nm3SiVSNun5lPVrj/pA/59+zOvI=" }, "cypress": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.2.tgz", - "integrity": "sha512-gYiQYvJozMzDOriUV1rCt6CeRM/pRK4nhwGJj3nJQyX2BoUdTCVwp30xDMKc771HiNVhBtgj5o5/iBdVDVXQUg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", + "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -3656,7 +3656,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -4098,9 +4098,9 @@ "dev": true }, "fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -4376,25 +4376,25 @@ "dev": true }, "itk-image-io": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-image-io/-/itk-image-io-1.0.0-b.6.tgz", - "integrity": "sha512-rg8xHqsRLm84GTidlBeJOuM4BTgw6ad44aloFBwhDS5wwseRc9U+NIlGvr9oog5aIlMEpQPp32nd7VbCQPLzPw==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-image-io/-/itk-image-io-1.0.0-b.18.tgz", + "integrity": "sha512-bvrn7dLdP5AkqpSdai849dzlbsS3YHs098BmKD1ZdfepARDjGs07kEsnSSQmy20CrRbIdG1vHcNkq5U37zWhKQ==", "requires": { - "itk-wasm": "1.0.0-b.6" + "itk-wasm": "1.0.0-b.18" } }, "itk-mesh-io": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-mesh-io/-/itk-mesh-io-1.0.0-b.6.tgz", - "integrity": "sha512-JCrZLaH9yauxy4E5Avf4J9wYueRBAZQUkPj9uJ+9uXkksR/29gI66B6yL05X7GuVJJf0eJNAdn9Xd2IO9/Gk8A==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-mesh-io/-/itk-mesh-io-1.0.0-b.18.tgz", + "integrity": "sha512-3iV4Mx2GkXwC18susbRfIrZ4eZFCeM5yCEleALHlMDekrQAv/7Yo/6aq9lrWQN+Q8gGSNf5FE/Yk2bbmTqFcuQ==", "requires": { - "itk-wasm": "1.0.0-b.6" + "itk-wasm": "1.0.0-b.18" } }, "itk-wasm": { - "version": "1.0.0-b.6", - "resolved": "https://registry.npmjs.org/itk-wasm/-/itk-wasm-1.0.0-b.6.tgz", - "integrity": "sha512-Vl0La4CTEepsFVgzKh6zOhlHlTCJgY2vRzKPpAigUS1dEfpiUzf2m2i3wOmDMyptFZIpbSffU5cUakKnHBhrxA==", + "version": "1.0.0-b.18", + "resolved": "https://registry.npmjs.org/itk-wasm/-/itk-wasm-1.0.0-b.18.tgz", + "integrity": "sha512-k4vSWbHWVoDueZ0wXxfK52qZ/BMjNM0YTKawQKrpsvC2GX7MSVkZpYArZ81XKd8OkTS8uXCWWh+LS0I0otFp2A==", "requires": { "@babel/runtime": "^7.15.4", "@types/emscripten": "^1.39.6", diff --git a/examples/Vite/package.json b/examples/Vite/package.json index 07980b0d6..75a478f3e 100644 --- a/examples/Vite/package.json +++ b/examples/Vite/package.json @@ -1,6 +1,6 @@ { "name": "itk-vite-example", - "version": "1.0.0", + "version": "1.0.1", "description": "This example demonstrates how to use itk-wasm in a Rollup project that targets the browser.", "main": "index.js", "scripts": { @@ -8,9 +8,9 @@ "build": "vite build", "start:production": "vite preview --port 8080", "cypress:open": "npx cypress open", - "cypress:run": "npx cypress run --config defaultCommandTimeout=8000", - "cypress:runChrome": "npx cypress run --config defaultCommandTimeout=8000 --browser chrome", - "cypress:runFirefox": "npx cypress run --config defaultCommandTimeout=8000 --browser firefox", + "cypress:run": "npx cypress run", + "cypress:runChrome": "npx cypress run --browser chrome", + "cypress:runFirefox": "npx cypress run --browser firefox", "test:debug": "start-server-and-test start http-get://localhost:8080 cypress:open", "test": "start-server-and-test start:production http-get://localhost:8080 cypress:run", "test:chrome": "start-server-and-test start:production http-get://localhost:8080 cypress:runChrome", @@ -33,12 +33,12 @@ "homepage": "https://github.com/InsightSoftwareConsortium/itk-wasm#readme", "dependencies": { "curry": "^1.2.0", - "itk-image-io": "^1.0.0-b.6", - "itk-mesh-io": "^1.0.0-b.6", - "itk-wasm": "^1.0.0-b.6" + "itk-image-io": "^1.0.0-b.18", + "itk-mesh-io": "^1.0.0-b.18", + "itk-wasm": "^1.0.0-b.18" }, "devDependencies": { - "cypress": "^9.5.2", + "cypress": "^10.3.0", "rollup-plugin-copy": "^3.4.0", "start-server-and-test": "^1.14.0", "vite": "^2.8.6"