diff --git a/.github/workflows/actions/test-core-e2e/action.yml b/.github/workflows/actions/test-core-e2e/action.yml deleted file mode 100644 index f3c243dbac..0000000000 --- a/.github/workflows/actions/test-core-e2e/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Test Core E2E' -description: 'Test Core E2E' -runs: - using: 'composite' - steps: - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Install Dependencies - run: npm install - working-directory: ./core - shell: bash - - uses: ./.github/workflows/actions/download-archive - with: - name: ionic-core - path: ./core - filename: CoreBuild.zip - - name: Test - run: npm run test.e2e -- --ci --no-build - shell: bash - working-directory: ./core diff --git a/.github/workflows/actions/test-core-screenshot/action.yml b/.github/workflows/actions/test-core-screenshot/action.yml index 61b7121199..d8282bd1b6 100644 --- a/.github/workflows/actions/test-core-screenshot/action.yml +++ b/.github/workflows/actions/test-core-screenshot/action.yml @@ -29,7 +29,7 @@ runs: working-directory: ./core - name: Test if: inputs.update != 'true' - run: npx playwright test --shard=${{ inputs.shard }}/${{ inputs.totalShards }} + run: npm run test.e2e -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} shell: bash working-directory: ./core - name: Test and Update @@ -51,7 +51,7 @@ runs: # which is why we not using the upload-archive # composite step here. run: | - npx playwright test --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots + npm run test.e2e -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots git add src/\*.png --force mkdir updated-screenshots cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7aa86a02b..59c5eb2b1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,13 +42,6 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/workflows/actions/test-core-spec - test-core-e2e: - needs: [build-core] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/workflows/actions/test-core-e2e - test-core-screenshot: strategy: # This ensures that all screenshot shard diff --git a/core/package-lock.json b/core/package-lock.json index 4036e5982d..1b98cd5152 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@axe-core/playwright": "^4.4.2", - "@axe-core/puppeteer": "^4.3.2", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^2.0.0", "@jest/core": "^27.5.1", @@ -31,7 +30,6 @@ "@types/swiper": "5.4.0", "@typescript-eslint/eslint-plugin": "^5.17.0", "@typescript-eslint/parser": "^5.17.0", - "aws-sdk": "^2.738.0", "clean-css-cli": "^5.6.1", "domino": "^2.1.6", "eslint": "^7.32.0", @@ -41,9 +39,7 @@ "fs-extra": "^9.0.1", "jest": "^27.5.1", "jest-cli": "^27.5.1", - "pixelmatch": "4.0.2", "prettier": "^2.6.1", - "puppeteer": "^10.4.0", "rollup": "^2.26.4", "sass": "^1.26.10", "serve": "^14.0.1", @@ -71,21 +67,6 @@ "playwright": ">= 1.0.0" } }, - "node_modules/@axe-core/puppeteer": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@axe-core/puppeteer/-/puppeteer-4.3.2.tgz", - "integrity": "sha512-/0Od30pNxUr00cO20pndz2n/b5DyYrkAKBBXlpTAbAMPuLtz6JnavR9A1oQMDyBeoQDNbKr7B97FRYSNPPgI9Q==", - "dev": true, - "dependencies": { - "axe-core": "^4.3.3" - }, - "engines": { - "node": ">=6.4.0" - }, - "peerDependencies": { - "puppeteer": ">=1.10.0 <= 10" - } - }, "node_modules/@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -2644,26 +2625,6 @@ "node": ">=6" } }, - "node_modules/aws-sdk": { - "version": "2.738.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.738.0.tgz", - "integrity": "sha512-oO1odRT4DGssivoP6lHO3yB6I+5sU0uqpj6UJ0kS5wrHQ9J9EGrictLVKA9y6XhN0sNW+XPNLD9jMMY/A+gXWA==", - "dev": true, - "dependencies": { - "buffer": "4.9.2", - "events": "1.1.1", - "ieee754": "1.1.13", - "jmespath": "0.15.0", - "querystring": "0.2.0", - "sax": "1.2.1", - "url": "0.10.3", - "uuid": "3.3.2", - "xml2js": "0.4.19" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/axe-core": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.1.tgz", @@ -2830,12 +2791,6 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "node_modules/base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, "node_modules/binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -2845,41 +2800,6 @@ "node": ">=8" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/bl/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/boxen": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", @@ -3048,17 +2968,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -3315,12 +3224,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "node_modules/ci-info": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", @@ -3771,12 +3674,6 @@ "node": ">=8" } }, - "node_modules/devtools-protocol": { - "version": "0.0.901419", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.901419.tgz", - "integrity": "sha512-4INMPwNm9XRpBukhNbF7OB6fNTTCaI8pzy/fXg0xQzAy5h3zL1P8xT3QazgKqBrb/hAYwIBizqDBZ7GtJE74QQ==", - "dev": true - }, "node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -4673,15 +4570,6 @@ "node": ">=0.10.0" } }, - "node_modules/events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -4963,12 +4851,6 @@ "node": ">= 6" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, "node_modules/fs-extra": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", @@ -5421,12 +5303,6 @@ "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -5948,12 +5824,6 @@ "node": ">=8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -7436,15 +7306,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jmespath": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", - "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/jpeg-js": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.3.tgz", @@ -8088,18 +7949,6 @@ "node": ">= 6" } }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -8121,15 +7970,6 @@ "node": ">= 0.6" } }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "dev": true, - "engines": { - "node": "4.x || >=6.0.0" - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -8482,18 +8322,6 @@ "node": ">= 6" } }, - "node_modules/pixelmatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", - "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=", - "dev": true, - "dependencies": { - "pngjs": "^3.0.0" - }, - "bin": { - "pixelmatch": "bin/pixelmatch" - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -8652,15 +8480,6 @@ } } }, - "node_modules/pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", - "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/postcss": { "version": "7.0.35", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", @@ -8988,58 +8807,6 @@ "node": ">=6" } }, - "node_modules/puppeteer": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.4.0.tgz", - "integrity": "sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w==", - "deprecated": "Version no longer supported. Upgrade to @latest", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "debug": "4.3.1", - "devtools-protocol": "0.0.901419", - "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.0", - "node-fetch": "2.6.1", - "pkg-dir": "4.2.0", - "progress": "2.0.1", - "proxy-from-env": "1.1.0", - "rimraf": "3.0.2", - "tar-fs": "2.0.0", - "unbzip2-stream": "1.3.3", - "ws": "7.4.6" - }, - "engines": { - "node": ">=10.18.1" - } - }, - "node_modules/puppeteer/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -9440,12 +9207,6 @@ "node": ">=8.9.0" } }, - "node_modules/sax": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=", - "dev": true - }, "node_modules/saxes": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", @@ -10286,34 +10047,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/tar-fs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", - "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", - "dev": true, - "dependencies": { - "chownr": "^1.1.1", - "mkdirp": "^0.5.1", - "pump": "^3.0.0", - "tar-stream": "^2.0.0" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -10356,12 +10089,6 @@ "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", "dev": true }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, "node_modules/tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -10573,40 +10300,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unbzip2-stream": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", - "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", - "dev": true, - "dependencies": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, - "node_modules/unbzip2-stream/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/unified": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", @@ -10698,16 +10391,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", - "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -10718,28 +10401,12 @@ "requires-port": "^1.0.0" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "node_modules/uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -11103,25 +10770,6 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, - "node_modules/xml2js": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", - "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", - "dev": true, - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~9.0.1" - } - }, - "node_modules/xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -11220,15 +10868,6 @@ "playwright": "^1.16.2" } }, - "@axe-core/puppeteer": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@axe-core/puppeteer/-/puppeteer-4.3.2.tgz", - "integrity": "sha512-/0Od30pNxUr00cO20pndz2n/b5DyYrkAKBBXlpTAbAMPuLtz6JnavR9A1oQMDyBeoQDNbKr7B97FRYSNPPgI9Q==", - "dev": true, - "requires": { - "axe-core": "^4.3.3" - } - }, "@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -13050,23 +12689,6 @@ } } }, - "aws-sdk": { - "version": "2.738.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.738.0.tgz", - "integrity": "sha512-oO1odRT4DGssivoP6lHO3yB6I+5sU0uqpj6UJ0kS5wrHQ9J9EGrictLVKA9y6XhN0sNW+XPNLD9jMMY/A+gXWA==", - "dev": true, - "requires": { - "buffer": "4.9.2", - "events": "1.1.1", - "ieee754": "1.1.13", - "jmespath": "0.15.0", - "querystring": "0.2.0", - "sax": "1.2.1", - "url": "0.10.3", - "uuid": "3.3.2", - "xml2js": "0.4.19" - } - }, "axe-core": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.1.tgz", @@ -13192,41 +12814,12 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, - "bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - }, - "dependencies": { - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - } - } - }, "boxen": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", @@ -13336,17 +12929,6 @@ "node-int64": "^0.4.0" } }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -13517,12 +13099,6 @@ "readdirp": "~3.6.0" } }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "ci-info": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", @@ -13878,12 +13454,6 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, - "devtools-protocol": { - "version": "0.0.901419", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.901419.tgz", - "integrity": "sha512-4INMPwNm9XRpBukhNbF7OB6fNTTCaI8pzy/fXg0xQzAy5h3zL1P8xT3QazgKqBrb/hAYwIBizqDBZ7GtJE74QQ==", - "dev": true - }, "diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -14568,12 +14138,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -14805,12 +14369,6 @@ "mime-types": "^2.1.12" } }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, "fs-extra": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", @@ -15138,12 +14696,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -15489,12 +15041,6 @@ "is-docker": "^2.0.0" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -16608,12 +16154,6 @@ } } }, - "jmespath": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", - "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", - "dev": true - }, "jpeg-js": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.3.tgz", @@ -17086,15 +16626,6 @@ "kind-of": "^6.0.3" } }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -17113,12 +16644,6 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "dev": true - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -17386,15 +16911,6 @@ "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", "dev": true }, - "pixelmatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", - "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=", - "dev": true, - "requires": { - "pngjs": "^3.0.0" - } - }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -17497,12 +17013,6 @@ "integrity": "sha512-x35yzsXDyo0BIXYimLnUFNyb42c//NadUNH6IPGOteZm96oTGA1kn4Hq6qJTI1/f9wEc1F9O1DsznXIgXMil7A==", "dev": true }, - "pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", - "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", - "dev": true - }, "postcss": { "version": "7.0.35", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", @@ -17759,43 +17269,6 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "puppeteer": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.4.0.tgz", - "integrity": "sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w==", - "dev": true, - "requires": { - "debug": "4.3.1", - "devtools-protocol": "0.0.901419", - "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.0", - "node-fetch": "2.6.1", - "pkg-dir": "4.2.0", - "progress": "2.0.1", - "proxy-from-env": "1.1.0", - "rimraf": "3.0.2", - "tar-fs": "2.0.0", - "unbzip2-stream": "1.3.3", - "ws": "7.4.6" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -18077,12 +17550,6 @@ "chokidar": ">=2.0.0 <4.0.0" } }, - "sax": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=", - "dev": true - }, "saxes": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", @@ -18736,31 +18203,6 @@ } } }, - "tar-fs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", - "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", - "dev": true, - "requires": { - "chownr": "^1.1.1", - "mkdirp": "^0.5.1", - "pump": "^3.0.0", - "tar-stream": "^2.0.0" - } - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -18794,12 +18236,6 @@ "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -18961,28 +18397,6 @@ "which-boxed-primitive": "^1.0.2" } }, - "unbzip2-stream": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", - "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", - "dev": true, - "requires": { - "buffer": "^5.2.1", - "through": "^2.3.8" - }, - "dependencies": { - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - } - } - }, "unified": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", @@ -19054,24 +18468,6 @@ "punycode": "^2.1.0" } }, - "url": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", - "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -19088,12 +18484,6 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -19356,22 +18746,6 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, - "xml2js": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", - "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", - "dev": true, - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~9.0.1" - } - }, - "xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", - "dev": true - }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", diff --git a/core/package.json b/core/package.json index eb1735c7c7..c1f7fb4224 100644 --- a/core/package.json +++ b/core/package.json @@ -37,7 +37,6 @@ }, "devDependencies": { "@axe-core/playwright": "^4.4.2", - "@axe-core/puppeteer": "^4.3.2", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^2.0.0", "@jest/core": "^27.5.1", @@ -53,7 +52,6 @@ "@types/swiper": "5.4.0", "@typescript-eslint/eslint-plugin": "^5.17.0", "@typescript-eslint/parser": "^5.17.0", - "aws-sdk": "^2.738.0", "clean-css-cli": "^5.6.1", "domino": "^2.1.6", "eslint": "^7.32.0", @@ -63,9 +61,7 @@ "fs-extra": "^9.0.1", "jest": "^27.5.1", "jest-cli": "^27.5.1", - "pixelmatch": "4.0.2", "prettier": "^2.6.1", - "puppeteer": "^10.4.0", "rollup": "^2.26.4", "sass": "^1.26.10", "serve": "^14.0.1", @@ -94,12 +90,10 @@ "prerender.e2e": "node scripts/testing/prerender.js", "prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx}\"", "start": "npm run build.css && stencil build --dev --watch --serve", - "test": "stencil test --spec --e2e --max-workers=2", + "test": "npm run test.spec && npm run test.e2e", "test.spec": "stencil test --spec --max-workers=2", "test.spec.debug": "npx --node-arg=\"--inspect-brk\" stencil test --spec", - "test.e2e": "stencil test --e2e --max-workers=2", - "test.screenshot": "stencil test --e2e --screenshot --screenshot-connector=scripts/screenshot/dev.js", - "test.screenshot.ci": "stencil test --e2e --screenshot --screenshot-connector=scripts/screenshot/ci.js --ci", + "test.e2e": "npx playwright test", "test.watch": "jest --watch --no-cache", "test.treeshake": "node scripts/treeshaking.js dist/index.js", "validate": "npm run lint && npm run test && npm run build && npm run test.treeshake" diff --git a/core/screenshot/.gitignore b/core/screenshot/.gitignore deleted file mode 100644 index 563eaa94e4..0000000000 --- a/core/screenshot/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -images -builds -compare.html \ No newline at end of file diff --git a/core/scripts/screenshot/ci.js b/core/scripts/screenshot/ci.js deleted file mode 100644 index 9b9cfa85d1..0000000000 --- a/core/scripts/screenshot/ci.js +++ /dev/null @@ -1,218 +0,0 @@ -const IonicConnector = require('./ionic'); -const fs = require('fs'); -const path = require('path'); -const S3 = require('aws-sdk/clients/s3'); -const execa = require('execa'); -const stream = require('stream'); - -const BUILD_URL = 'https://github.com/ionic-team/ionic/commit/'; -const S3_BUCKET = 'screenshot.ionicframework.com'; -const s3 = new S3({ apiVersion: '2006-03-01' }); - - -class CIScreenshotConnector extends IonicConnector { - - async initBuild(opts) { - const { stdout: result } = await execa('git', ['log', '-1', '--format=%H%n%an <%ae>%n%ct%n%s']); - const [ sha1, author, timestamp, msg ] = result.split('\n'); - const sha1short = sha1.slice(0, 7); - - opts.buildId = sha1short; - opts.buildMessage = msg; - opts.buildAuthor = author; - opts.buildUrl = BUILD_URL + sha1short; - opts.previewUrl = `https://${S3_BUCKET}/${sha1short}`; - opts.buildTimestamp = (timestamp * 1000); - - await super.initBuild(opts); - } - - async uploadImage(image) { - const file = path.join(this.imagesDir, image); - const stream = fs.createReadStream(file); - const key = `data/images/${image}`; - - await this.uploadStream(stream, key, { ContentType: 'image/png' }); - } - - async uploadStream(stream, key, extra = {}) { - try { - await s3.headObject({ Bucket: S3_BUCKET, Key: key }).promise(); - } catch (e) { - if (e.statusCode !== 404) { - throw e; - } - - this.logger.debug(`uploading: ${key}`); - await s3.upload({ Bucket: S3_BUCKET, Key: key, Body: stream, ...extra }).promise(); - } - } - - async pullMasterBuild() { - await super.pullIonicMasterBuild(); - } - - async publishBuild(results) { - const currentBuild = results.currentBuild; - - const timespan = this.logger.createTimeSpan(`publishing build started`); - const images = currentBuild.screenshots.map(screenshot => screenshot.image); - const imageBatches = []; - - while (images.length > 0) { - imageBatches.push(images.splice(0, 10)); - } - - for (const batch of imageBatches) { - await Promise.all(batch.map(async image => this.uploadImage(image))); - } - - const buildBuffer = Buffer.from(JSON.stringify(currentBuild, undefined, 2)); - const buildStream = new stream.PassThrough(); - buildStream.end(buildBuffer); - - const uploads = [ - this.uploadStream(buildStream, `data/builds/${currentBuild.id}.json`, { ContentType: 'application/json' }), - ]; - - if (this.updateMaster) { - // master build - // update the master data with this current build - // no need to upload a compare data - const buildStream = new stream.PassThrough(); - buildStream.end(buildBuffer); - const key = `data/builds/master.json`; - this.logger.debug(`uploading: ${key}`); - uploads.push( - s3.upload({ Bucket: S3_BUCKET, Key: key, Body: buildStream, ContentType: 'application/json' }).promise() - ); - - } else { - // PR build - // not updating master - // upload compare data of the PR against the master data - const compare = results.compare; - compare.url = `https://${S3_BUCKET}/${compare.a.id}/${compare.b.id}`; - - const compareBuffer = Buffer.from(JSON.stringify(compare, undefined, 2)); - const compareStream = new stream.PassThrough(); - compareStream.end(compareBuffer); - uploads.push( - this.uploadStream(compareStream, `data/compares/${compare.id}.json`, { ContentType: 'application/json' }) - ); - } - - await Promise.all(uploads); - - timespan.finish(`publishing build finished`); - - await this.uploadTests(results); - - return results; - } - - async uploadTests(results) { - const timespan = this.logger.createTimeSpan(`uploading tests started`); - - const appRoot = path.join(__dirname, '..', '..'); - let uploadPaths = []; - - const cssDir = path.join(appRoot, 'css'); - fs.readdirSync(cssDir).forEach(cssFile => { - uploadPaths.push(path.join(cssDir, cssFile)); - }); - - uploadPaths.push(path.join(appRoot, 'scripts', 'testing', 'styles.css')); - - const distDir = path.join(appRoot, 'dist'); - const distIonicDir = path.join(distDir, 'ionic'); - fs.readdirSync(distIonicDir).forEach(distIonicFile => { - uploadPaths.push(path.join(distIonicDir, distIonicFile)); - }); - - const distIonicSvgDir = path.join(distIonicDir, 'svg'); - fs.readdirSync(distIonicSvgDir).forEach(distIonicSvgFile => { - uploadPaths.push(path.join(distIonicSvgDir, distIonicSvgFile)); - }); - - results.currentBuild.screenshots.forEach(screenshot => { - const testDir = path.dirname(screenshot.testPath); - const testIndexHtml = path.join(appRoot, testDir, 'index.html'); - if (!uploadPaths.includes(testIndexHtml)) { - uploadPaths.push(testIndexHtml); - } - }); - - uploadPaths = uploadPaths.filter(p => p.endsWith('.js') || p.endsWith('.css') || p.endsWith('.html') || p.endsWith('.svg')); - - const fileCount = uploadPaths.length; - - const uploadBatches = []; - while (uploadPaths.length > 0) { - uploadBatches.push(uploadPaths.splice(0, 20)); - } - - for (const batch of uploadBatches) { - await Promise.all(batch.map(async uploadPath => { - const stream = fs.createReadStream(uploadPath); - const relPath = path.relative(appRoot, uploadPath); - const key = `data/tests/${results.currentBuild.id}/${relPath}`; - - let contentType = 'text/plain'; - if (uploadPath.endsWith('.js')) { - contentType = 'application/javascript' - } else if (uploadPath.endsWith('.css')) { - contentType = 'text/css' - } else if (uploadPath.endsWith('.html')) { - contentType = 'text/html' - } else if (uploadPath.endsWith('.svg')) { - contentType = 'image/svg+xml' - } - - this.logger.debug(`uploading: ${key} ${contentType}`); - await s3.upload({ Bucket: S3_BUCKET, Key: key, Body: stream, ContentType: contentType }).promise(); - })); - } - - timespan.finish(`uploading tests finished: ${fileCount} files`); - } - - async getScreenshotCache() { - const timespan = this.logger.createTimeSpan(`get screenshot cache started`, true); - - try { - const ws = fs.createWriteStream(this.screenshotCacheFilePath); - const p = `/data/compares/screenshot-cache.json?ts=${Date.now()}`; - await this.downloadToStream(ws, p); - - } catch (e) { - this.logger.debug(e); - } - - timespan.finish(`get screenshot cache finished`); - - return super.getScreenshotCache(); - } - - async updateScreenshotCache(cache, buildResults) { - const timespan = this.logger.createTimeSpan(`update screenshot cache started`, true); - - cache = await super.updateScreenshotCache(cache, buildResults); - - const cacheBuffer = Buffer.from(JSON.stringify(cache, undefined, 2)); - const cacheStream = new stream.PassThrough(); - cacheStream.end(cacheBuffer); - - const key = `data/compares/screenshot-cache.json`; - this.logger.debug(`uploading: ${key}`); - - await s3.upload({ Bucket: S3_BUCKET, Key: key, Body: cacheStream, ContentType: 'application/json' }).promise(); - - timespan.finish(`update screenshot cache finished`); - - return cache; - } - -} - -module.exports = CIScreenshotConnector; diff --git a/core/scripts/screenshot/dev.js b/core/scripts/screenshot/dev.js deleted file mode 100644 index 89627eebf9..0000000000 --- a/core/scripts/screenshot/dev.js +++ /dev/null @@ -1,14 +0,0 @@ -const IonicConnector = require('./ionic'); - -class DevConnector extends IonicConnector { - - async pullMasterBuild() { - await super.pullIonicMasterBuild(); - - const masterBuild = await super.getMasterBuild(); - await this.generateJsonpDataUris(masterBuild); - } - -} - -module.exports = DevConnector; diff --git a/core/scripts/screenshot/ionic.js b/core/scripts/screenshot/ionic.js deleted file mode 100644 index 7e349606cd..0000000000 --- a/core/scripts/screenshot/ionic.js +++ /dev/null @@ -1,78 +0,0 @@ -const ScreenshotConnector = require('@stencil/core/screenshot/local-connector'); -const fs = require('fs'); -const path = require('path'); -const https = require('https'); - -class IonicConnector extends ScreenshotConnector { - - async pullIonicMasterBuild() { - const timespan = this.logger.createTimeSpan(`pull master screenshot images started`); - - const ws = fs.createWriteStream(this.masterBuildFilePath); - const p = `/data/builds/master.json?ts=${Date.now()}`; - await this.downloadToStream(ws, p); - const masterBuild = await this.getMasterBuild(); - - const masterImageNames = masterBuild.screenshots.map(s => s.image); - const missingImages = masterImageNames.filter(masterImageName => { - try { - const masterImagePath = path.join(this.imagesDir, masterImageName); - fs.accessSync(masterImagePath); - return false; - } catch (e) {} - return true - }); - - while (missingImages.length > 0) { - const images = missingImages.splice(0, 20); - - await Promise.all(images.map(async image => { - this.logger.debug(`downloading: ${image}`); - - try { - await this.downloadImage(image); - } catch (e) { - this.logger.error(`Error with ${image}: ${e}`); - throw e; - } - })); - } - - timespan.finish(`pull master screenshot images finished`); - } - - async downloadToStream(stream, p) { - return new Promise((resolve, reject) => { - const req = https.request({ - method: 'GET', - hostname: 'screenshot.ionicframework.com', - path: p, - }); - - req.on('response', res => { - if (res.statusCode !== 200) { - return reject(new Error(`Bad Status Code: ${res.statusCode}`)); - } - - stream.on('error', reject); - stream.on('close', resolve); - - res.on('error', reject); - res.pipe(stream); - }); - - req.on('error', reject); - req.end(); - }); - } - - async downloadImage(image) { - const stream = fs.createWriteStream(path.join(this.imagesDir, image)); - const p = `/data/images/${image}`; - - await this.downloadToStream(stream, p); - } - -} - -module.exports = IonicConnector; diff --git a/core/src/components/router/test/e2e.spec.tsx b/core/src/components/router/test/router.spec.tsx similarity index 100% rename from core/src/components/router/test/e2e.spec.tsx rename to core/src/components/router/test/router.spec.tsx diff --git a/core/stencil.config.ts b/core/stencil.config.ts index a6b80aff48..afa2be914a 100644 --- a/core/stencil.config.ts +++ b/core/stencil.config.ts @@ -218,39 +218,10 @@ export const config: Config = { scriptDataOpts: true }, testing: { - testRegex: '(/__tests__/.*|(\\.|/)(test|spec)|[//](e2e))\\.[jt]sx?$', - allowableMismatchedPixels: 200, - pixelmatchThreshold: 0.05, - waitBeforeScreenshot: 20, moduleNameMapper: { "@utils/test": ["/src/utils/test/utils"], "@utils/logging": ["/src/utils/logging"], - }, - emulate: [ - { - userAgent: 'iPhone', - viewport: { - width: 400, - height: 800, - deviceScaleFactor: 2, - isMobile: true, - hasTouch: true, - isLandscape: false - } - }, - { - userAgent: 'Android', - viewport: { - width: 400, - height: 800, - deviceScaleFactor: 2, - isMobile: true, - hasTouch: true, - isLandscape: false - } - } - ] }, preamble: '(C) Ionic http://ionicframework.com - MIT License', globalScript: 'src/global/ionic-global.ts',