diff --git a/plugins/woocommerce-admin/.distignore b/plugins/woocommerce-admin/.distignore index 474a2ccbdad..ccb93b6de48 100755 --- a/plugins/woocommerce-admin/.distignore +++ b/plugins/woocommerce-admin/.distignore @@ -25,6 +25,7 @@ README.md wp-cli.local.yml yarn.lock tests +packages/admin-e2e-tests vendor config node_modules diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 3f2c2986645..b2c9c4e5ec4 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -9788,10 +9788,846 @@ "@xtuc/long": "4.2.2" } }, + "@woocommerce/admin-e2e-tests": { + "version": "file:packages/admin-e2e-tests", + "dev": true, + "requires": { + "@jest/globals": "^26.4.2", + "@types/jest": "26.0.23", + "config": "3.3.6" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@jest/environment": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "dev": true, + "requires": { + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2" + } + }, + "@jest/fake-timers": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@sinonjs/fake-timers": "^6.0.1", + "@types/node": "*", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" + } + }, + "@jest/globals": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "dev": true, + "requires": { + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" + } + }, + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@types/expect-puppeteer": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/@types/expect-puppeteer/-/expect-puppeteer-4.4.5.tgz", + "integrity": "sha512-vxPaumA8Fj6xlm3llKCR9V8L936HX4PyipaNMxDbWQIOWZoCl99jabD/6xuxXnCptOWUdUhXwDuX5cAJgCHsLg==", + "requires": { + "@types/jest": "*", + "@types/puppeteer": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==" + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jest": { + "version": "26.0.23", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.23.tgz", + "integrity": "sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA==", + "requires": { + "jest-diff": "^26.0.0", + "pretty-format": "^26.0.0" + } + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==" + }, + "@types/node": { + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", + "integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==" + }, + "@types/puppeteer": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.3.tgz", + "integrity": "sha512-3nE8YgR9DIsgttLW+eJf6mnXxq8Ge+27m5SU3knWmrlfl6+KOG0Bf9f7Ua7K+C4BnaTMAh3/UpySqdAYvrsvjg==", + "requires": { + "@types/node": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", + "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", + "dev": true + }, + "@types/yargs": { + "version": "15.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", + "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "20.2.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", + "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==" + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.1.tgz", + "integrity": "sha512-kVTAghWDDhsvQ602tHBc6WmQkdaYbkcTwZu+7l24jtJiYvm9l+/y/b2BZANEezxPDiX5MK2ZecE+9BFi/YJryw==", + "requires": { + "@typescript-eslint/experimental-utils": "4.22.1", + "@typescript-eslint/scope-manager": "4.22.1", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.1.tgz", + "integrity": "sha512-svYlHecSMCQGDO2qN1v477ax/IDQwWhc7PRBiwAdAMJE7GXk5stF4Z9R/8wbRkuX/5e9dHqbIWxjeOjckK3wLQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.22.1", + "@typescript-eslint/types": "4.22.1", + "@typescript-eslint/typescript-estree": "4.22.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.22.1.tgz", + "integrity": "sha512-d5bAiPBiessSmNi8Amq/RuLslvcumxLmyhf1/Xa9IuaoFJ0YtshlJKxhlbY7l2JdEk3wS0EnmnfeJWSvADOe0g==", + "requires": { + "@typescript-eslint/types": "4.22.1", + "@typescript-eslint/visitor-keys": "4.22.1" + } + }, + "@typescript-eslint/types": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.1.tgz", + "integrity": "sha512-2HTkbkdAeI3OOcWbqA8hWf/7z9c6gkmnWNGz0dKSLYLWywUlkOAQ2XcjhlKLj5xBFDf8FgAOF5aQbnLRvgNbCw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.1.tgz", + "integrity": "sha512-p3We0pAPacT+onSGM+sPR+M9CblVqdA9F1JEdIqRVlxK5Qth4ochXQgIyb9daBomyQKAXbygxp1aXQRV0GC79A==", + "requires": { + "@typescript-eslint/types": "4.22.1", + "@typescript-eslint/visitor-keys": "4.22.1", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.1.tgz", + "integrity": "sha512-WPkOrIRm+WCLZxXQHCi+WG8T2MMTUFR70rWjdWYddLT7cEfb2P4a3O/J2U1FBVsSFTocXLCoXWY6MZGejeStvQ==", + "requires": { + "@typescript-eslint/types": "4.22.1", + "eslint-visitor-keys": "^2.0.0" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "config": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.6.tgz", + "integrity": "sha512-Hj5916C5HFawjYJat1epbyY2PlAgLpBtDUlr0MxGLgo3p5+7kylyvnRY18PqJHgnNWXcdd0eWDemT7eYWuFgwg==", + "dev": true, + "requires": { + "json5": "^2.1.1" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "diff-sequences": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==" + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "expect": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-styles": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0" + } + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "jest-diff": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-get-type": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", + "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==" + }, + "jest-matcher-utils": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-message-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.2" + } + }, + "jest-mock": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*" + } + }, + "jest-mock-extended": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/jest-mock-extended/-/jest-mock-extended-1.0.15.tgz", + "integrity": "sha512-MFimmdIim0GF22Ire0cuuowATHUOeCRepj8C4ntlg8CeozZMQkas0TOqLJAZbv9bJzU+W9Z1jXcNesfP0x3/tw==", + "requires": { + "ts-essentials": "^4.0.0" + } + }, + "jest-regex-util": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", + "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "dev": true + }, + "jest-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "is-ci": "^2.0.0", + "micromatch": "^4.0.2" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" + }, + "pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + } + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, + "stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-essentials": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-4.0.0.tgz", + "integrity": "sha512-uQJX+SRY9mtbKU+g9kl5Fi7AEMofPCvHfJkQlaygpPmHPZrtgaBqbWFOYyiA47RhnSwwnXdepUJrgqUYxoUyhQ==" + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, "@woocommerce/api": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@woocommerce/api/-/api-0.1.2.tgz", - "integrity": "sha512-bK8kNN5sXnlZE2m72KrBnkkjsA9/0B2l/VLu5lhIuLunVZ3+mkqZGLMwATF2O09mR/EaA9tLMV0WftYWYujWiA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@woocommerce/api/-/api-0.2.0.tgz", + "integrity": "sha512-h7PhFF+KPKZTxhvGASm0vn6N7nY3SFOEx0qJITvqaOwbqh3xvdDbiETSZ9R0BFNY5fD8blYCHblCO4VQ4CO9kA==", "dev": true, "requires": { "axios": "0.19.2", @@ -9848,6 +10684,7 @@ "@wordpress/i18n": "3.17.0", "@wordpress/icons": "^2.10.3", "@wordpress/keycodes": "2.18.0", + "@wordpress/url": "2.21.0", "@wordpress/viewport": "2.24.0", "classnames": "^2.3.1", "core-js": "3.9.1", @@ -9897,6 +10734,17 @@ "sprintf-js": "^1.1.1", "tannin": "^1.2.0" } + }, + "@wordpress/url": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.22.2.tgz", + "integrity": "sha512-aqpYKQXzyzkCOm+GzZRYlLb+wh58g0cwR1PaKAl0UXaBS4mdS+X6biMriylb4P8CVC/RR7CSw5XI20JC24KDwQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.19", + "react-native-url-polyfill": "^1.1.2" + } } } }, @@ -10058,12 +10906,12 @@ } }, "@wordpress/url": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.22.2.tgz", - "integrity": "sha512-aqpYKQXzyzkCOm+GzZRYlLb+wh58g0cwR1PaKAl0UXaBS4mdS+X6biMriylb4P8CVC/RR7CSw5XI20JC24KDwQ==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.21.0.tgz", + "integrity": "sha512-asTEPDkKirHyoGeoSv3tKHtqNStVUa0E/7ecd667rU7rnXQRB4AJU76fPdmi7aC9rpAz+en4FPtKrcloA2Sjgg==", "dev": true, "requires": { - "@babel/runtime": "^7.13.10", + "@babel/runtime": "^7.12.5", "lodash": "^4.17.19", "react-native-url-polyfill": "^1.1.2" } @@ -10259,6 +11107,27 @@ "use-memo-one": "^1.1.1" }, "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + }, "@wordpress/element": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.20.3.tgz", @@ -10276,6 +11145,25 @@ } } }, + "@wordpress/dom": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.18.0.tgz", + "integrity": "sha512-tM2WeQuSObl3nzWjUTF0/dyLnA7sdl/MXaSe32D64OF89bjSyJvjUipI7gjKzI3kJ7ddGhwcTggGvSB06MOoCQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.19" + } + }, + "@wordpress/hooks": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.12.3.tgz", + "integrity": "sha512-LmKiwKldZt6UYqOxV/a6+eUFXdvALFnB/pQx3RmrMvO64sgFhfR6dhrlv+uVbuuezSuv8dce1jx8lUWAT0krMA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10" + } + }, "@wordpress/is-shallow-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-3.1.3.tgz", @@ -10285,6 +11173,34 @@ "@babel/runtime": "^7.13.10" } }, + "@wordpress/keycodes": { + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz", + "integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^3.20.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "@wordpress/i18n": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.20.0.tgz", + "integrity": "sha512-SIoOJFB4UrrYAScS4H91CYCLW9dX3Ghv8pBKc/yHGculb1AdGr6gRMlmJxZV62Cn3CZ4Ga86c+FfR+GiBu0JPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/hooks": "^2.12.3", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" + } + } + } + }, "@wordpress/notices": { "version": "2.13.3", "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-2.13.3.tgz", @@ -10317,6 +11233,29 @@ "redux": "^4.0.0", "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" + }, + "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + } } }, "@wordpress/element": { @@ -10344,49 +11283,29 @@ "requires": { "@woocommerce/date": "file:packages/date", "@woocommerce/navigation": "file:packages/navigation", + "@wordpress/api-fetch": "2.2.8", + "@wordpress/compose": "3.23.1", "@wordpress/core-data": "3.0.0", + "@wordpress/data": "5.0.0", + "@wordpress/data-controls": "2.0.0", + "@wordpress/element": "2.19.0", + "@wordpress/hooks": "2.11.0", "@wordpress/i18n": "3.17.0", + "@wordpress/url": "2.21.0", "md5": "^2.3.0", "rememo": "^3.0.0" }, "dependencies": { "@wordpress/api-fetch": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-5.1.1.tgz", - "integrity": "sha512-pThYQhoKiePeGgb5aZnc4A9YT5WktfZkejSk4JIfFxdzXF7YXunyMoA9Aib2YvY94IkItLzBeTl/jDk9yYL2hw==", + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-2.2.8.tgz", + "integrity": "sha512-mbdP9GvDe8Ojv8cobk30mfg2btEZDQEe7IgO+rGSlvVlHC88U8cc2VgOLNX6c9/6/sCvkoGd4Tsy85VbdTlTXw==", "dev": true, "requires": { - "@babel/runtime": "^7.13.10", - "@wordpress/i18n": "^4.1.1", - "@wordpress/url": "^3.1.1" - }, - "dependencies": { - "@wordpress/i18n": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.1.1.tgz", - "integrity": "sha512-Ra/hxR8WCLqDp2P49Ibr9ANhZZZ8WHnsO+4WG3XDarJ3lmzux0TcRThDKRCcYHsW3pzieARmrEa/BOlYD7ZEjQ==", - "dev": true, - "requires": { - "@babel/runtime": "^7.13.10", - "@wordpress/hooks": "^3.1.1", - "gettext-parser": "^1.3.1", - "lodash": "^4.17.21", - "memize": "^1.1.0", - "sprintf-js": "^1.1.1", - "tannin": "^1.2.0" - } - }, - "@wordpress/url": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.1.1.tgz", - "integrity": "sha512-I+yEw+a66wZ+FrpYU1F78/3c5p7/323UIrfnPUN51hIJcatsqJyQZW9Z1CNZeN5SuCobha0GPq4lw8517+VUMw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.13.10", - "lodash": "^4.17.21", - "react-native-url-polyfill": "^1.1.2" - } - } + "@babel/runtime": "^7.0.0", + "@wordpress/hooks": "^2.0.5", + "@wordpress/i18n": "^3.1.1", + "@wordpress/url": "^2.3.3" } }, "@wordpress/core-data": { @@ -10411,6 +11330,17 @@ "uuid": "^8.3.0" }, "dependencies": { + "@wordpress/api-fetch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-5.1.1.tgz", + "integrity": "sha512-pThYQhoKiePeGgb5aZnc4A9YT5WktfZkejSk4JIfFxdzXF7YXunyMoA9Aib2YvY94IkItLzBeTl/jDk9yYL2hw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^4.1.1", + "@wordpress/url": "^3.1.1" + } + }, "@wordpress/element": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-3.1.1.tgz", @@ -10457,6 +11387,17 @@ "memize": "^1.1.0", "sprintf-js": "^1.1.1", "tannin": "^1.2.0" + }, + "dependencies": { + "@wordpress/hooks": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.1.1.tgz", + "integrity": "sha512-9f6H9WBwu6x/MM4ZCVLGGBuMiBcyaLapmAku5IwcWaeB2PtPduwjmk2NfGx35TuhBQD554DUg8WtTjIS019UAg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10" + } + } } }, "@wordpress/url": { @@ -10473,12 +11414,12 @@ } }, "@wordpress/hooks": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.1.1.tgz", - "integrity": "sha512-9f6H9WBwu6x/MM4ZCVLGGBuMiBcyaLapmAku5IwcWaeB2PtPduwjmk2NfGx35TuhBQD554DUg8WtTjIS019UAg==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.11.0.tgz", + "integrity": "sha512-TbvCrHcMiSZoyiflegEqVS3DDytDTpkms+yLUaGN4sMvNdR/Mv5s0WnNKyM0T49lbmZYPWlbWhwJ1F6hr/FQDg==", "dev": true, "requires": { - "@babel/runtime": "^7.13.10" + "@babel/runtime": "^7.12.5" } }, "@wordpress/is-shallow-equal": { @@ -11531,6 +12472,12 @@ "dev": true, "requires": { "@woocommerce/experimental": "file:packages/experimental", + "@wordpress/api-fetch": "2.2.8", + "@wordpress/components": "11.1.3", + "@wordpress/compose": "3.23.1", + "@wordpress/hooks": "2.11.0", + "@wordpress/notices": "1.12.0", + "@wordpress/url": "2.21.0", "history": "4.10.1", "qs": "6.9.6" } @@ -11575,6 +12522,39 @@ "redux": "^4.0.0", "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" + }, + "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + } + } + }, + "@wordpress/dom": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.18.0.tgz", + "integrity": "sha512-tM2WeQuSObl3nzWjUTF0/dyLnA7sdl/MXaSe32D64OF89bjSyJvjUipI7gjKzI3kJ7ddGhwcTggGvSB06MOoCQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.19" } }, "@wordpress/element": { @@ -11624,6 +12604,17 @@ "requires": { "@babel/runtime": "^7.13.10" } + }, + "@wordpress/keycodes": { + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz", + "integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==", + "dev": true, + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^3.20.0", + "lodash": "^4.17.19" + } } } }, @@ -11631,7 +12622,15 @@ "version": "file:packages/number", "dev": true, "requires": { - "locutus": "2.0.14" + "locutus": "2.0.15" + }, + "dependencies": { + "locutus": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.15.tgz", + "integrity": "sha512-2xWC4RkoAoCVXEb/stzEgG1TNgd+mrkLBj6TuEDNyUoKeQ2XzDTyJUC23sMiqbL6zJmJSP3w59OZo+zc4IBOmA==", + "dev": true + } } }, "@woocommerce/onboarding": { @@ -12386,70 +13385,26 @@ } }, "@wordpress/compose": { - "version": "3.25.3", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", - "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "version": "3.23.1", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.23.1.tgz", + "integrity": "sha512-42xMoQZghhdErpBAvxcjlNKK21Lewq86KemDtAmbq9R+CYj93LGDYwceWdaqW7TwYuD9AgdI4ggr+dPhYFOCAA==", "requires": { - "@babel/runtime": "^7.13.10", - "@wordpress/deprecated": "^2.12.3", - "@wordpress/dom": "^2.18.0", - "@wordpress/element": "^2.20.3", - "@wordpress/is-shallow-equal": "^3.1.3", - "@wordpress/keycodes": "^2.19.3", - "@wordpress/priority-queue": "^1.11.2", + "@babel/runtime": "^7.12.5", + "@wordpress/deprecated": "^2.11.0", + "@wordpress/dom": "^2.16.0", + "@wordpress/element": "^2.19.0", + "@wordpress/is-shallow-equal": "^3.0.0", + "@wordpress/keycodes": "^2.18.0", + "@wordpress/priority-queue": "^1.10.0", "clipboard": "^2.0.1", "lodash": "^4.17.19", "memize": "^1.1.0", "mousetrap": "^1.6.5", - "react-resize-aware": "^3.1.0", + "react-merge-refs": "^1.0.0", + "react-resize-aware": "^3.0.1", "use-memo-one": "^1.1.1" }, "dependencies": { - "@wordpress/dom": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.18.0.tgz", - "integrity": "sha512-tM2WeQuSObl3nzWjUTF0/dyLnA7sdl/MXaSe32D64OF89bjSyJvjUipI7gjKzI3kJ7ddGhwcTggGvSB06MOoCQ==", - "requires": { - "@babel/runtime": "^7.13.10", - "lodash": "^4.17.19" - } - }, - "@wordpress/element": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.20.3.tgz", - "integrity": "sha512-f4ZPTDf9CxiiOXiMxc4v1K7jcBMT4dsiehVOpkKzCDKboNXp4qVf8oe5PE23VGZNEjcOj5Mkg9hB57R0nqvMTw==", - "requires": { - "@babel/runtime": "^7.13.10", - "@types/react": "^16.9.0", - "@types/react-dom": "^16.9.0", - "@wordpress/escape-html": "^1.12.2", - "lodash": "^4.17.19", - "react": "^16.13.1", - "react-dom": "^16.13.1" - } - }, - "@wordpress/hooks": { - "version": "2.12.3", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.12.3.tgz", - "integrity": "sha512-LmKiwKldZt6UYqOxV/a6+eUFXdvALFnB/pQx3RmrMvO64sgFhfR6dhrlv+uVbuuezSuv8dce1jx8lUWAT0krMA==", - "requires": { - "@babel/runtime": "^7.13.10" - } - }, - "@wordpress/i18n": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.20.0.tgz", - "integrity": "sha512-SIoOJFB4UrrYAScS4H91CYCLW9dX3Ghv8pBKc/yHGculb1AdGr6gRMlmJxZV62Cn3CZ4Ga86c+FfR+GiBu0JPg==", - "requires": { - "@babel/runtime": "^7.13.10", - "@wordpress/hooks": "^2.12.3", - "gettext-parser": "^1.3.1", - "lodash": "^4.17.19", - "memize": "^1.1.0", - "sprintf-js": "^1.1.1", - "tannin": "^1.2.0" - } - }, "@wordpress/is-shallow-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-3.1.3.tgz", @@ -12457,16 +13412,6 @@ "requires": { "@babel/runtime": "^7.13.10" } - }, - "@wordpress/keycodes": { - "version": "2.19.3", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz", - "integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==", - "requires": { - "@babel/runtime": "^7.13.10", - "@wordpress/i18n": "^3.20.0", - "lodash": "^4.17.19" - } } } }, @@ -13229,6 +14174,37 @@ "redux": "^4.0.0", "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" + }, + "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + } + } + }, + "@wordpress/dom": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.18.0.tgz", + "integrity": "sha512-tM2WeQuSObl3nzWjUTF0/dyLnA7sdl/MXaSe32D64OF89bjSyJvjUipI7gjKzI3kJ7ddGhwcTggGvSB06MOoCQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.19" } }, "@wordpress/element": { @@ -13245,6 +14221,28 @@ "react-dom": "^16.13.1" } }, + "@wordpress/hooks": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.12.3.tgz", + "integrity": "sha512-LmKiwKldZt6UYqOxV/a6+eUFXdvALFnB/pQx3RmrMvO64sgFhfR6dhrlv+uVbuuezSuv8dce1jx8lUWAT0krMA==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/i18n": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.20.0.tgz", + "integrity": "sha512-SIoOJFB4UrrYAScS4H91CYCLW9dX3Ghv8pBKc/yHGculb1AdGr6gRMlmJxZV62Cn3CZ4Ga86c+FfR+GiBu0JPg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/hooks": "^2.12.3", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" + } + }, "@wordpress/is-shallow-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-3.1.3.tgz", @@ -13252,6 +14250,16 @@ "requires": { "@babel/runtime": "^7.13.10" } + }, + "@wordpress/keycodes": { + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz", + "integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^3.20.0", + "lodash": "^4.17.19" + } } } }, @@ -13454,6 +14462,26 @@ "rememo": "^3.0.0" }, "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + }, "@wordpress/data": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-4.27.3.tgz", @@ -15341,6 +16369,37 @@ "redux": "^4.0.0", "turbo-combine-reducers": "^1.0.2", "use-memo-one": "^1.1.1" + }, + "dependencies": { + "@wordpress/compose": { + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.25.3.tgz", + "integrity": "sha512-tCO2EnJCkCH548OqA0uU8V1k/1skz2QwBlHs8ZQSpimqUS4OWWsAlndCEFe4U4vDTqFt2ow7tzAir+05Cw8MAg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^2.12.3", + "@wordpress/dom": "^2.18.0", + "@wordpress/element": "^2.20.3", + "@wordpress/is-shallow-equal": "^3.1.3", + "@wordpress/keycodes": "^2.19.3", + "@wordpress/priority-queue": "^1.11.2", + "clipboard": "^2.0.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + } + } + }, + "@wordpress/dom": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.18.0.tgz", + "integrity": "sha512-tM2WeQuSObl3nzWjUTF0/dyLnA7sdl/MXaSe32D64OF89bjSyJvjUipI7gjKzI3kJ7ddGhwcTggGvSB06MOoCQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.19" } }, "@wordpress/element": { @@ -15357,6 +16416,28 @@ "react-dom": "^16.13.1" } }, + "@wordpress/hooks": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.12.3.tgz", + "integrity": "sha512-LmKiwKldZt6UYqOxV/a6+eUFXdvALFnB/pQx3RmrMvO64sgFhfR6dhrlv+uVbuuezSuv8dce1jx8lUWAT0krMA==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/i18n": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.20.0.tgz", + "integrity": "sha512-SIoOJFB4UrrYAScS4H91CYCLW9dX3Ghv8pBKc/yHGculb1AdGr6gRMlmJxZV62Cn3CZ4Ga86c+FfR+GiBu0JPg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/hooks": "^2.12.3", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" + } + }, "@wordpress/is-shallow-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-3.1.3.tgz", @@ -15364,6 +16445,16 @@ "requires": { "@babel/runtime": "^7.13.10" } + }, + "@wordpress/keycodes": { + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz", + "integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^3.20.0", + "lodash": "^4.17.19" + } } } }, @@ -29780,15 +30871,6 @@ "path-exists": "^3.0.0" } }, - "locutus": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.14.tgz", - "integrity": "sha512-0H1o1iHNEp3kJ5rW57bT/CAP5g6Qm0Zd817Wcx2+rOMTYyIJoc482Ja1v9dB6IUjwvWKcBNdYi7x2lRXtlJ3bA==", - "dev": true, - "requires": { - "es6-promise": "^4.2.5" - } - }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index d474f09f3cb..0d21d7a3285 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -60,7 +60,7 @@ "pretest": "npm run -s install-if-no-packages", "test": "./node_modules/jest-24.9.0/bin/jest.js --config tests/js/jest.config.json", "test:debug": "node --inspect-brk ./node_modules/jest-24.9.0/bin/jest.js --config tests/js/jest.config.json --watch --runInBand --no-cache", - "test:e2e": "WP_VERSION=latest npm run build && npx wc-e2e docker:down && npx wc-e2e docker:up && npx wc-e2e test:e2e", + "test:e2e": "npm run build && test -z \"$(docker ps | grep woocommerce-admin-e2e)\" || npx wc-e2e docker:down && npx wc-e2e docker:up && npx wc-e2e test:e2e", "test-staged": "./node_modules/jest-24.9.0/bin/jest.js --bail --config tests/js/jest.config.json --findRelatedTests", "test:help": "wp-scripts test-unit-js --help", "test:php": "docker-compose -f docker/wc-admin-php-test-suite/docker-compose.yml run --rm phpunit", @@ -93,6 +93,7 @@ "@wordpress/api-fetch": "2.2.8", "@wordpress/base-styles": "3.3.0", "@wordpress/components": "11.1.3", + "@wordpress/compose": "3.23.1", "@wordpress/core-data": "3.0.0", "@wordpress/data": "5.0.0", "@wordpress/data-controls": "2.0.0", @@ -161,7 +162,8 @@ "@types/wordpress__components": "9.8.6", "@types/wordpress__data-controls": "1.0.4", "@typescript-eslint/eslint-plugin": "4.22.1", - "@woocommerce/api": "0.1.2", + "@woocommerce/admin-e2e-tests": "file:packages/admin-e2e-tests", + "@woocommerce/api": "0.2.0", "@woocommerce/components": "file:packages/components", "@woocommerce/csv-export": "file:packages/csv-export", "@woocommerce/currency": "file:packages/currency", diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md b/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md new file mode 100644 index 00000000000..41cdd16abf2 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.1.0 + +- Released initial package diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/README.md b/plugins/woocommerce-admin/packages/admin-e2e-tests/README.md new file mode 100644 index 00000000000..ce8acc343ed --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/README.md @@ -0,0 +1,56 @@ +# Admin E2E Tests + +An end-to-end test suite for WooCommerce setup, onboarding, home screen/task list, and analytics. + +## Installation + +Install the module + +```bash +npm install @woocommerce/admin-e2e-tests --save +``` + +## Usage + +Create a E2E test specification file under `/tests/e2e/specs/example.test.js`: + +```js +const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminBasicSetup(); +``` + +See the [wooCommerce E2E Boilerplate](https://github.com/woocommerce/woocommerce-e2e-boilerplate) for instructions on setting up an E2E test environment. + +### Configuration + +Add the following entries to `tests/e2e/config/default.json` + +```json + "onboardingwizard": { + "industry": "Test industry", + "numberofproducts": "1 - 10", + "sellingelsewhere": "No" + }, + "settings": { + "shipping": { + "zonename": "United States", + "zoneregions": "United States (US)", + "shippingmethod": "Free shipping" + } + } +``` + +### Available tests + +The following test functions are included in the package: + +| Function | Description | +| --- | --- | +| `testAdminBasicSetup` | Test that WooCommerce can be activated with pretty permalinks | +| `testAdminOnboardingWizard` | Complete the onboarding wizard with US merchant | +| `testAdminNonUSRecommendedFeatures` | Complete the onboarding wizard with non-US merchant | +| `testSelectiveBundleWCPay` | Ensure onboarding wizard offers WC Payments in appropriate contexts | +| `testAdminAnalyticsPages` | Test that the React App is functional on Analytics pages | +| `testAdminCouponsPage` | Test that the Coupons is functional | +| `testAdminPaymentSetupTask` | Test that payment methods can be configured | diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/package.json b/plugins/woocommerce-admin/packages/admin-e2e-tests/package.json new file mode 100644 index 00000000000..c0bece1e399 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/package.json @@ -0,0 +1,44 @@ +{ + "name": "@woocommerce/admin-e2e-tests", + "version": "0.1.0", + "author": "Automattic", + "description": "E2E tests for the new WooCommerce interface.", + "homepage": "https://github.com/woocommerce/woocommerce-admin/tree/main/packages/admin-e2e-tests/README.md", + "repository": { + "type": "git", + "url": "https://github.com/woocommerce/woocommerce-admin.git" + }, + "keywords": [ + "woocommerce", + "e2e" + ], + "license": "GPL-3.0+", + "main": "build/index.js", + "types": "build/index.d.ts", + "files": [ + "/build/", + "!*.ts.map", + "!*.tsbuildinfo" + ], + "sideEffects": false, + "dependencies": { + "@jest/globals": "^26.4.2", + "@types/jest": "26.0.23", + "config": "3.3.6" + }, + "peerDependencies": { + "@woocommerce/e2e-environment": "0.2.2", + "@woocommerce/e2e-utils": "0.1.5", + "puppeteer": "^2.0.0" + }, + "devDependencies": { + "@types/expect-puppeteer": "4.4.5", + "@types/puppeteer": "5.4.3", + "@typescript-eslint/eslint-plugin": "4.22.1", + "jest-mock-extended": "^1.0.10", + "typescript": "4.2.4" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/plugins/woocommerce-admin/tests/e2e/constants/taskTitles.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/constants/taskTitles.ts similarity index 100% rename from plugins/woocommerce-admin/tests/e2e/constants/taskTitles.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/constants/taskTitles.ts diff --git a/plugins/woocommerce-admin/tests/e2e/elements/BaseElement.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/BaseElement.ts similarity index 87% rename from plugins/woocommerce-admin/tests/e2e/elements/BaseElement.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/BaseElement.ts index 7cc36ca3ef5..1d0c33dbabf 100644 --- a/plugins/woocommerce-admin/tests/e2e/elements/BaseElement.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/BaseElement.ts @@ -1,3 +1,6 @@ +/** + * External dependencies + */ import { Page } from 'puppeteer'; export abstract class BaseElement { diff --git a/plugins/woocommerce-admin/tests/e2e/elements/DropdownField.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownField.ts similarity index 95% rename from plugins/woocommerce-admin/tests/e2e/elements/DropdownField.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownField.ts index 675ccb395f1..74e965b424a 100644 --- a/plugins/woocommerce-admin/tests/e2e/elements/DropdownField.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownField.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { getElementByText, getInputValue } from '../utils/actions'; import { BaseElement } from './BaseElement'; diff --git a/plugins/woocommerce-admin/tests/e2e/elements/DropdownTypeaheadField.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownTypeaheadField.ts similarity index 78% rename from plugins/woocommerce-admin/tests/e2e/elements/DropdownTypeaheadField.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownTypeaheadField.ts index 01d45d33750..652b3bee22f 100644 --- a/plugins/woocommerce-admin/tests/e2e/elements/DropdownTypeaheadField.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/DropdownTypeaheadField.ts @@ -1,6 +1,12 @@ -import { clearAndFillInput } from '@woocommerce/e2e-utils'; +/** + * Internal dependencies + */ import { BaseElement } from './BaseElement'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { clearAndFillInput } = require( '@woocommerce/e2e-utils' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + export class DropdownTypeaheadField extends BaseElement { async search( text: string ) { await clearAndFillInput( this.selector + '-0__control-input', text ); diff --git a/plugins/woocommerce-admin/tests/e2e/elements/FormToggle.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/FormToggle.ts similarity index 95% rename from plugins/woocommerce-admin/tests/e2e/elements/FormToggle.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/FormToggle.ts index 1f945ac0e01..6f5b2704673 100644 --- a/plugins/woocommerce-admin/tests/e2e/elements/FormToggle.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/elements/FormToggle.ts @@ -1,5 +1,7 @@ +/** + * Internal dependencies + */ import { BaseElement } from './BaseElement'; - import { hasClass } from '../utils/actions'; export class FormToggle extends BaseElement { @@ -14,7 +16,7 @@ export class FormToggle extends BaseElement { `Could not find form toggle with selector ${ this.selector }` ); } - input?.click(); + input.click(); // Wait for it to be checked. await this.page.waitForSelector( @@ -33,7 +35,7 @@ export class FormToggle extends BaseElement { `Could not find form toggle with selector ${ this.selector }` ); } - input?.click(); + input.click(); // Wait for a not checked toggle to be present. await page.waitForFunction( diff --git a/plugins/woocommerce-admin/tests/e2e/specs/globalTypes.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/globalTypes.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/specs/globalTypes.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/globalTypes.ts index 46ac9862d88..e46b34b68c8 100644 --- a/plugins/woocommerce-admin/tests/e2e/specs/globalTypes.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/globalTypes.ts @@ -1,3 +1,6 @@ +/** + * External dependencies + */ import { Browser, Page } from 'puppeteer'; declare global { diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/index.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/index.ts new file mode 100644 index 00000000000..60a182ae95b --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/index.ts @@ -0,0 +1 @@ +export * from './specs'; diff --git a/plugins/woocommerce-admin/tests/e2e/pages/AllOrdersView.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AllOrdersView.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/pages/AllOrdersView.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AllOrdersView.ts index 98a688009eb..48405d9273f 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/AllOrdersView.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AllOrdersView.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class AllOrdersView extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/Analytics.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Analytics.ts similarity index 96% rename from plugins/woocommerce-admin/tests/e2e/pages/Analytics.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Analytics.ts index ef89d287183..3bfc7d4ccbf 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/Analytics.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Analytics.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export type AnalyticsSection = diff --git a/plugins/woocommerce-admin/tests/e2e/pages/AnalyticsOverview.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AnalyticsOverview.ts similarity index 94% rename from plugins/woocommerce-admin/tests/e2e/pages/AnalyticsOverview.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AnalyticsOverview.ts index 0035903ab0b..89af98cd55a 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/AnalyticsOverview.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/AnalyticsOverview.ts @@ -1,4 +1,11 @@ +/** + * External dependencies + */ import { ElementHandle } from 'puppeteer'; + +/** + * Internal dependencies + */ import { waitForElementByText } from '../utils/actions'; import { Analytics } from './Analytics'; @@ -39,7 +46,7 @@ export class AnalyticsOverview extends Analytics { async openSectionEllipsis( sectionTitle: string ) { const section = ( await this.getSections() ).find( - ( section ) => section.title === sectionTitle + ( thisSection ) => thisSection.title === sectionTitle ); if ( section ) { const ellipsisMenu = await section.element.$( @@ -54,7 +61,7 @@ export class AnalyticsOverview extends Analytics { async closeSectionEllipsis( sectionTitle: string ) { const section = ( await this.getSections() ).find( - ( section ) => section.title === sectionTitle + ( thisSection ) => thisSection.title === sectionTitle ); if ( section ) { const ellipsisMenu = await section.element.$( diff --git a/plugins/woocommerce-admin/tests/e2e/pages/BasePage.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/BasePage.ts similarity index 94% rename from plugins/woocommerce-admin/tests/e2e/pages/BasePage.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/BasePage.ts index 70d3c0dfd67..f9dfa8c4b36 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/BasePage.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/BasePage.ts @@ -1,16 +1,25 @@ +/** + * External dependencies + */ import { ElementHandle, Page } from 'puppeteer'; + +/** + * Internal dependencies + */ import { DropdownField } from '../elements/DropdownField'; import { DropdownTypeaheadField } from '../elements/DropdownTypeaheadField'; import { FormToggle } from '../elements/FormToggle'; import { getElementByText } from '../utils/actions'; +/* eslint-disable @typescript-eslint/no-var-requires */ const config = require( 'config' ); +/* eslint-enable @typescript-eslint/no-var-requires */ const baseUrl = config.get( 'url' ); // Represents a page that can be navigated to export abstract class BasePage { protected page: Page; - protected url: string = ''; + protected url = ''; protected baseUrl: string = baseUrl; // cache of elements that have been setup, note that they are unique "per page/per selector" diff --git a/plugins/woocommerce-admin/tests/e2e/pages/Coupons.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Coupons.ts similarity index 91% rename from plugins/woocommerce-admin/tests/e2e/pages/Coupons.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Coupons.ts index 67077a07c7c..e828d274159 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/Coupons.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Coupons.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class Coupons extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/Dashboard.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Dashboard.ts similarity index 75% rename from plugins/woocommerce-admin/tests/e2e/pages/Dashboard.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Dashboard.ts index 02af39d13d4..a8a37264f17 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/Dashboard.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Dashboard.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class Dashboard extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/Login.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Login.ts similarity index 87% rename from plugins/woocommerce-admin/tests/e2e/pages/Login.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Login.ts index 5fc4d1e487d..e1884d0ad91 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/Login.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Login.ts @@ -1,7 +1,11 @@ -import { clearAndFillInput } from '@woocommerce/e2e-utils'; +/** + * Internal dependencies + */ import { getElementByText } from '../utils/actions'; import { BasePage } from './BasePage'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { clearAndFillInput } = require( '@woocommerce/e2e-utils' ); const config = require( 'config' ); export class Login extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/NewCoupon.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewCoupon.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/pages/NewCoupon.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewCoupon.ts index 7dd1346331f..c8d9acdeb32 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/NewCoupon.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewCoupon.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class NewCoupon extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/NewOrder.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewOrder.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/pages/NewOrder.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewOrder.ts index 6f31eeb249c..07089676412 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/NewOrder.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewOrder.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class NewOrder extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/NewProduct.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewProduct.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/pages/NewProduct.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewProduct.ts index e67b59ce272..5ef75b355b4 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/NewProduct.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/NewProduct.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class NewProduct extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/OnboardingWizard.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/OnboardingWizard.ts similarity index 92% rename from plugins/woocommerce-admin/tests/e2e/pages/OnboardingWizard.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/OnboardingWizard.ts index 0c7a3e5a37f..a2bc500d953 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/OnboardingWizard.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/OnboardingWizard.ts @@ -1,4 +1,11 @@ +/** + * External dependencies + */ import { Page } from 'puppeteer'; + +/** + * Internal dependencies + */ import { BusinessSection } from '../sections/onboarding/BusinessSection'; import { IndustrySection } from '../sections/onboarding/IndustrySection'; import { ProductTypeSection } from '../sections/onboarding/ProductTypesSection'; @@ -6,6 +13,9 @@ import { StoreDetailsSection } from '../sections/onboarding/StoreDetailsSection' import { ThemeSection } from '../sections/onboarding/ThemeSection'; import { BasePage } from './BasePage'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { expect } = require( '@jest/globals' ); + export class OnboardingWizard extends BasePage { url = 'wp-admin/admin.php?page=wc-admin&path=/setup-wizard'; diff --git a/plugins/woocommerce-admin/tests/e2e/pages/PaymentsSetup.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PaymentsSetup.ts similarity index 83% rename from plugins/woocommerce-admin/tests/e2e/pages/PaymentsSetup.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PaymentsSetup.ts index e3021d0887d..33406ce2392 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/PaymentsSetup.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PaymentsSetup.ts @@ -1,9 +1,8 @@ /** * Internal dependencies */ -import { waitForElementByText } from '../utils/actions'; +import { waitForElementByText, getElementByText } from '../utils/actions'; import { BasePage } from './BasePage'; -import { getElementByText } from '../utils/actions'; type PaymentMethodWithSetupButton = | 'wcpay' @@ -41,7 +40,11 @@ export class PaymentsSetup extends BasePage { } async methodHasBeenSetup( method: PaymentMethod ) { - await getElementByText( 'button', 'Manage', `.woocommerce-task-payment-${ method }` ) + await getElementByText( + 'button', + 'Manage', + `.woocommerce-task-payment-${ method }` + ); } async enableCashOnDelivery() { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/PermalinkSettings.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PermalinkSettings.ts similarity index 80% rename from plugins/woocommerce-admin/tests/e2e/pages/PermalinkSettings.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PermalinkSettings.ts index 782548732cc..ebaf2cf9693 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/PermalinkSettings.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/PermalinkSettings.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class PermalinkSettings extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/Plugins.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Plugins.ts similarity index 77% rename from plugins/woocommerce-admin/tests/e2e/pages/Plugins.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Plugins.ts index e89694bbfb3..ff60cdf7802 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/Plugins.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Plugins.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from './BasePage'; export class Plugins extends BasePage { diff --git a/plugins/woocommerce-admin/tests/e2e/pages/WcHomescreen.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcHomescreen.ts similarity index 97% rename from plugins/woocommerce-admin/tests/e2e/pages/WcHomescreen.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcHomescreen.ts index 83326ac804f..4b11ee9537d 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/WcHomescreen.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcHomescreen.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { getElementByText, waitForElementByText } from '../utils/actions'; import { BasePage } from './BasePage'; diff --git a/plugins/woocommerce-admin/tests/e2e/pages/WcSettings.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcSettings.ts similarity index 81% rename from plugins/woocommerce-admin/tests/e2e/pages/WcSettings.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcSettings.ts index 71525786e3a..548b98dacb1 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/WcSettings.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WcSettings.ts @@ -1,7 +1,13 @@ -import { setCheckbox } from '@woocommerce/e2e-utils'; +/** + * Internal dependencies + */ import { getAttribute, waitForElementByText } from '../utils/actions'; import { BasePage } from './BasePage'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { setCheckbox } = require( '@woocommerce/e2e-utils' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + export class WcSettings extends BasePage { url = 'wp-admin/admin.php?page=wc-settings'; diff --git a/plugins/woocommerce-admin/tests/e2e/pages/WpSettings.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WpSettings.ts similarity index 92% rename from plugins/woocommerce-admin/tests/e2e/pages/WpSettings.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WpSettings.ts index c6304fb0fd5..3a236953712 100644 --- a/plugins/woocommerce-admin/tests/e2e/pages/WpSettings.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/WpSettings.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { waitForElementByText } from '../utils/actions'; import { BasePage } from './BasePage'; diff --git a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/BusinessSection.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/BusinessSection.ts similarity index 89% rename from plugins/woocommerce-admin/tests/e2e/sections/onboarding/BusinessSection.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/BusinessSection.ts index 8b0066bd45b..4438fd219f2 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/BusinessSection.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/BusinessSection.ts @@ -1,7 +1,13 @@ -import { setCheckbox, unsetCheckbox } from '@woocommerce/e2e-utils'; +/** + * Internal dependencies + */ import { BasePage } from '../../pages/BasePage'; import { waitForElementByText } from '../../utils/actions'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { setCheckbox, unsetCheckbox } = require( '@woocommerce/e2e-utils' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + export class BusinessSection extends BasePage { async isDisplayed() { await waitForElementByText( 'h2', 'Tell us about your business' ); diff --git a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/IndustrySection.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/IndustrySection.ts similarity index 95% rename from plugins/woocommerce-admin/tests/e2e/sections/onboarding/IndustrySection.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/IndustrySection.ts index dfd96a32f9a..dc5e4d96a1b 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/IndustrySection.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/IndustrySection.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from '../../pages/BasePage'; import { waitForElementByText } from '../../utils/actions'; diff --git a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/ProductTypesSection.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ProductTypesSection.ts similarity index 95% rename from plugins/woocommerce-admin/tests/e2e/sections/onboarding/ProductTypesSection.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ProductTypesSection.ts index 5e5a3ae1c71..4c0085f6b79 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/ProductTypesSection.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ProductTypesSection.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from '../../pages/BasePage'; import { waitForElementByText } from '../../utils/actions'; diff --git a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/StoreDetailsSection.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/StoreDetailsSection.ts similarity index 93% rename from plugins/woocommerce-admin/tests/e2e/sections/onboarding/StoreDetailsSection.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/StoreDetailsSection.ts index 22ba42b4077..cf794189593 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/StoreDetailsSection.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/StoreDetailsSection.ts @@ -1,12 +1,18 @@ -import { +/** + * Internal dependencies + */ +import { DropdownTypeaheadField } from '../../elements/DropdownTypeaheadField'; +import { BasePage } from '../../pages/BasePage'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { setCheckbox, clearAndFillInput, verifyCheckboxIsSet, verifyCheckboxIsUnset, -} from '@woocommerce/e2e-utils'; -import { DropdownTypeaheadField } from '../../elements/DropdownTypeaheadField'; -import { BasePage } from '../../pages/BasePage'; +} = require( '@woocommerce/e2e-utils' ); const config = require( 'config' ); +/* eslint-enable @typescript-eslint/no-var-requires */ interface StoreDetails { addressLine1?: string; diff --git a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/ThemeSection.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ThemeSection.ts similarity index 92% rename from plugins/woocommerce-admin/tests/e2e/sections/onboarding/ThemeSection.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ThemeSection.ts index 80078075994..92968066b00 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/onboarding/ThemeSection.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/onboarding/ThemeSection.ts @@ -1,3 +1,6 @@ +/** + * Internal dependencies + */ import { BasePage } from '../../pages/BasePage'; import { waitForElementByText } from '../../utils/actions'; diff --git a/plugins/woocommerce-admin/tests/e2e/sections/payment-setup/BankAccountTransferSetup.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/payment-setup/BankAccountTransferSetup.ts similarity index 81% rename from plugins/woocommerce-admin/tests/e2e/sections/payment-setup/BankAccountTransferSetup.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/payment-setup/BankAccountTransferSetup.ts index e16f04885f0..854e94d236d 100644 --- a/plugins/woocommerce-admin/tests/e2e/sections/payment-setup/BankAccountTransferSetup.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/sections/payment-setup/BankAccountTransferSetup.ts @@ -1,6 +1,12 @@ -import { clearAndFillInput } from '@woocommerce/e2e-utils'; +/** + * Internal dependencies + */ import { BasePage } from '../../pages/BasePage'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { clearAndFillInput } = require( '@woocommerce/e2e-utils' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + type AccountDetails = { accountName: string; accountNumber: string; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/basic-setup.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/basic-setup.ts new file mode 100644 index 00000000000..7dd30207fdd --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/basic-setup.ts @@ -0,0 +1,84 @@ +/** + * Internal dependencies + */ +import { WcSettings } from '../../pages/WcSettings'; +import { WpSettings } from '../../pages/WpSettings'; +import { Login } from '../../pages/Login'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { + clearAndFillInput, + verifyValueOfInputField, +} = require( '@woocommerce/e2e-utils' ); +const { + afterAll, + beforeAll, + describe, + it, + expect, +} = require( '@jest/globals' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + +const testAdminBasicSetup = () => { + describe( 'Store owner can finish initial store setup', () => { + const wcSettings = new WcSettings( page ); + const wpSettings = new WpSettings( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'can enable tax rates and calculations', async () => { + // Go to general settings page + await wcSettings.navigate( 'general' ); + await wcSettings.enableTaxRates(); + await wcSettings.saveSettings(); + + // Verify that settings have been saved + const taxRate = await wcSettings.getTaxRateValue(); + expect( taxRate ).toEqual( true ); + } ); + + it( 'can configure permalink settings', async () => { + // Go to Permalink Settings page + await wpSettings.navigate(); + await wpSettings.openPermalinkSettings(); + + // Select "Post name" option in common settings section + await page.click( 'input[value="/%postname%/"]' ); + + // Select "Custom base" in product permalinks section + await page.click( '#woocommerce_custom_selection' ); + + // Fill custom base slug to use + await clearAndFillInput( '#woocommerce_permalink_structure', '' ); + await page.type( '#woocommerce_permalink_structure', '/product/' ); + + await wpSettings.saveSettings(); + + // Verify that settings have been saved + await Promise.all( [ + expect( page ).toMatchElement( + '#setting-error-settings_updated', + { + text: 'Permalink structure updated.', + } + ), + verifyValueOfInputField( + '#permalink_structure', + '/%postname%/' + ), + verifyValueOfInputField( + '#woocommerce_permalink_structure', + '/product/' + ), + ] ); + } ); + } ); +}; + +module.exports = { testAdminBasicSetup }; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/complete-onboarding-wizard.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/complete-onboarding-wizard.ts new file mode 100644 index 00000000000..67a11b033ee --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/activate-and-setup/complete-onboarding-wizard.ts @@ -0,0 +1,209 @@ +/** + * Internal dependencies + */ +import { OnboardingWizard } from '../../pages/OnboardingWizard'; +import { WcHomescreen } from '../../pages/WcHomescreen'; +import { TaskTitles } from '../../constants/taskTitles'; +import { getElementByText } from '../../utils/actions'; +import { Login } from '../../pages/Login'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { + afterAll, + beforeAll, + describe, + it, + expect, +} = require( '@jest/globals' ); +const config = require( 'config' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + +/** + * This tests a default, happy path for the onboarding wizard. + */ +const testAdminOnboardingWizard = () => { + describe( 'Store owner can complete onboarding wizard', () => { + const profileWizard = new OnboardingWizard( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'can start the profile wizard', async () => { + await profileWizard.navigate(); + } ); + + it( 'can complete the store details section', async () => { + await profileWizard.storeDetails.completeStoreDetailsSection(); + // Wait for "Continue" button to become active + await profileWizard.continue(); + + // Wait for usage tracking pop-up window to appear + await profileWizard.optionallySelectUsageTracking(); + } ); + + it( 'can complete the industry section', async () => { + // Query for the industries checkboxes + await profileWizard.industry.isDisplayed( 8 ); + await profileWizard.industry.uncheckIndustries(); + + // Select just "fashion" and "health/beauty" to get the single checkbox business section when + // filling out details for a US store. + await profileWizard.industry.selectIndustry( + 'Fashion, apparel, and accessories' + ); + await profileWizard.industry.selectIndustry( 'Health and beauty' ); + + await profileWizard.continue(); + } ); + + it( 'can complete the product types section', async () => { + await profileWizard.productTypes.isDisplayed( 7 ); + await profileWizard.productTypes.uncheckProducts(); + + // Select Physical and Downloadable products + await profileWizard.productTypes.selectProduct( + 'Physical products' + ); + await profileWizard.productTypes.selectProduct( 'Downloads' ); + + await profileWizard.continue(); + } ); + + it( 'can complete the business section', async () => { + await profileWizard.business.isDisplayed(); + await profileWizard.business.selectProductNumber( + config.get( 'onboardingwizard.numberofproducts' ) + ); + await profileWizard.business.selectCurrentlySelling( + config.get( 'onboardingwizard.sellingelsewhere' ) + ); + + await profileWizard.continue(); + } ); + + it( 'can unselect all business features and continue', async () => { + await profileWizard.business.freeFeaturesIsDisplayed(); + // Add WC Pay check + await profileWizard.business.expandRecommendedBusinessFeatures(); + + expect( page ).toMatchElement( 'a', { + text: 'WooCommerce Payments', + } ); + + await profileWizard.business.uncheckAllRecommendedBusinessFeatures(); + await profileWizard.continue(); + } ); + + it( 'can complete the theme selection section', async () => { + await profileWizard.themes.isDisplayed(); + await profileWizard.themes.continueWithActiveTheme(); + } ); + } ); +}; + +const testSelectiveBundleWCPay = () => { + describe( 'A japanese store can complete the selective bundle install but does not include WCPay.', () => { + const profileWizard = new OnboardingWizard( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'can start the profile wizard', async () => { + await profileWizard.navigate(); + } ); + + it( 'can complete the store details section', async () => { + await profileWizard.storeDetails.completeStoreDetailsSection( { + countryRegionSubstring: 'japan', + countryRegionSelector: 'JP\\:JP01', + countryRegion: 'Japan — Hokkaido', + } ); + + // Wait for "Continue" button to become active + await profileWizard.continue(); + + // Wait for usage tracking pop-up window to appear + await profileWizard.optionallySelectUsageTracking(); + } ); + + // JP:JP01 + it( 'can choose the "Other" industry', async () => { + // Query for the industries checkboxes + await profileWizard.industry.isDisplayed(); + await profileWizard.industry.uncheckIndustries(); + await profileWizard.industry.selectIndustry( 'Other' ); + await profileWizard.continue(); + } ); + + it( 'can complete the product types section', async () => { + await profileWizard.productTypes.isDisplayed( 7 ); + await profileWizard.productTypes.uncheckProducts(); + + // Select Physical and Downloadable products + await profileWizard.productTypes.selectProduct( + 'Physical products' + ); + await profileWizard.productTypes.selectProduct( 'Downloads' ); + + await profileWizard.continue(); + await page.waitForNavigation( { waitUntil: 'networkidle0' } ); + } ); + + it( 'can complete the business details tab', async () => { + await profileWizard.business.isDisplayed(); + + await profileWizard.business.selectProductNumber( + config.get( 'onboardingwizard.numberofproducts' ) + ); + await profileWizard.business.selectCurrentlySelling( + config.get( 'onboardingwizard.sellingelsewhere' ) + ); + + await profileWizard.continue(); + } ); + + it( 'can choose not to install any extensions', async () => { + await profileWizard.business.freeFeaturesIsDisplayed(); + // Add WC Pay check + await profileWizard.business.expandRecommendedBusinessFeatures(); + + expect( page ).not.toMatchElement( 'a', { + text: 'WooCommerce Payments', + } ); + + await profileWizard.business.uncheckAllRecommendedBusinessFeatures(); + await profileWizard.continue(); + } ); + + it( 'can finish the rest of the wizard successfully', async () => { + await profileWizard.themes.isDisplayed(); + + // This navigates to the home screen + await profileWizard.themes.continueWithActiveTheme(); + } ); + + it( 'should display the choose payments task, and not the woocommerce payments task', async () => { + const homescreen = new WcHomescreen( page ); + await homescreen.isDisplayed(); + await homescreen.possiblyDismissWelcomeModal(); + const tasks = await homescreen.getTaskList(); + expect( tasks ).toContain( TaskTitles.addPayments ); + expect( tasks ).not.toContain( TaskTitles.wooPayments ); + } ); + } ); +}; + +module.exports = { + testAdminOnboardingWizard, + testSelectiveBundleWCPay, +}; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics-overview.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics-overview.ts new file mode 100644 index 00000000000..c6321c6a6c4 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics-overview.ts @@ -0,0 +1,97 @@ +/** + * Internal dependencies + */ +import { AnalyticsOverview } from '../../pages/AnalyticsOverview'; +import { Login } from '../../pages/Login'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { afterAll, beforeAll, describe, it } = require( '@jest/globals' ); + +const testAdminAnalyticsOverview = () => { + describe( 'Analytics pages', () => { + const analyticsPage = new AnalyticsOverview( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + await analyticsPage.navigate(); + await analyticsPage.isDisplayed(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'a user should see 3 sections by default - Performance, Charts, and Leaderboards', async () => { + const sections = ( await analyticsPage.getSections() ).map( + ( section ) => section.title + ); + expect( sections ).toContain( 'Performance' ); + expect( sections ).toContain( 'Charts' ); + expect( sections ).toContain( 'Leaderboards' ); + } ); + + it( 'should allow a user to remove a section', async () => { + await analyticsPage.removeSection( 'Performance' ); + const sections = ( await analyticsPage.getSections() ).map( + ( section ) => section.title + ); + expect( sections ).not.toContain( 'Performance' ); + } ); + + it( 'should allow a user to add a section back in', async () => { + let sections = ( await analyticsPage.getSections() ).map( + ( section ) => section.title + ); + expect( sections ).not.toContain( 'Performance' ); + await analyticsPage.addSection( 'Performance' ); + + sections = ( await analyticsPage.getSections() ).map( + ( section ) => section.title + ); + expect( sections ).toContain( 'Performance' ); + } ); + + describe( 'moving sections', () => { + it( 'should not display move up for the top, or move down for the bottom section', async () => { + const sections = await analyticsPage.getSections(); + for ( const section of sections ) { + const index = sections.indexOf( section ); + const menuItems = ( + await analyticsPage.getEllipsisMenuItems( + section.title + ) + ).map( ( item ) => item.title ); + if ( index === 0 ) { + expect( menuItems ).toContain( 'Move down' ); + expect( menuItems ).not.toContain( 'Move up' ); + } else if ( index === sections.length - 1 ) { + expect( menuItems ).not.toContain( 'Move down' ); + expect( menuItems ).toContain( 'Move up' ); + } else { + expect( menuItems ).toContain( 'Move down' ); + expect( menuItems ).toContain( 'Move up' ); + } + await analyticsPage.closeSectionEllipsis( section.title ); + } + } ); + + it( 'should allow a user to move a section down', async () => { + const sections = await analyticsPage.getSections(); + await analyticsPage.moveSectionDown( sections[ 0 ].title ); + const newSections = await analyticsPage.getSections(); + expect( sections[ 0 ].title ).toEqual( newSections[ 1 ].title ); + expect( sections[ 1 ].title ).toEqual( newSections[ 0 ].title ); + } ); + + it( 'should allow a user to move a section up', async () => { + const sections = await analyticsPage.getSections(); + await analyticsPage.moveSectionUp( sections[ 1 ].title ); + const newSections = await analyticsPage.getSections(); + expect( sections[ 0 ].title ).toEqual( newSections[ 1 ].title ); + expect( sections[ 1 ].title ).toEqual( newSections[ 0 ].title ); + } ); + } ); + } ); +}; + +module.exports = { testAdminAnalyticsOverview }; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts new file mode 100644 index 00000000000..51a6d183dd2 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts @@ -0,0 +1,79 @@ +/** + * Internal dependencies + */ +import { Analytics } from '../../pages/Analytics'; +import { Login } from '../../pages/Login'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { afterAll, beforeAll, describe, it } = require( '@jest/globals' ); + +const testAdminAnalyticsPages = () => { + describe( 'Analytics pages', () => { + const analyticsPage = new Analytics( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'A user can view the analytics overview without it crashing', async () => { + await analyticsPage.navigate(); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for products without it crashing', async () => { + await analyticsPage.navigateToSection( 'products' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for revenue without it crashing', async () => { + await analyticsPage.navigateToSection( 'revenue' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for orders without it crashing', async () => { + await analyticsPage.navigateToSection( 'orders' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for variations without it crashing', async () => { + await analyticsPage.navigateToSection( 'variations' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for categories without it crashing', async () => { + await analyticsPage.navigateToSection( 'categories' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for coupons without it crashing', async () => { + await analyticsPage.navigateToSection( 'coupons' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for taxes without it crashing', async () => { + await analyticsPage.navigateToSection( 'taxes' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for downloads without it crashing', async () => { + await analyticsPage.navigateToSection( 'downloads' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for stock without it crashing', async () => { + await analyticsPage.navigateToSection( 'stock' ); + await analyticsPage.isDisplayed(); + } ); + + it( 'A user can view the analytics for settings without it crashing', async () => { + await analyticsPage.navigateToSection( 'settings' ); + await analyticsPage.isDisplayed(); + } ); + } ); +}; + +module.exports = { testAdminAnalyticsPages }; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/index.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/index.ts new file mode 100644 index 00000000000..52fde284e29 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/index.ts @@ -0,0 +1,6 @@ +export * from './activate-and-setup/basic-setup'; +export * from './activate-and-setup/complete-onboarding-wizard'; +export * from './analytics/analytics'; +export * from './analytics/analytics-overview'; +export * from './marketing/coupons'; +export * from './tasks/payment'; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/marketing/coupons.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/marketing/coupons.ts new file mode 100644 index 00000000000..9d19dcf0895 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/marketing/coupons.ts @@ -0,0 +1,30 @@ +/** + * Internal dependencies + */ +import { Coupons } from '../../pages/Coupons'; +import { Login } from '../../pages/Login'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { afterAll, beforeAll, describe, it } = require( '@jest/globals' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + +const testAdminCouponsPage = () => { + describe( 'Coupons page', () => { + const couponsPage = new Coupons( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + } ); + afterAll( async () => { + await login.logout(); + } ); + + it( 'A user can view the coupons overview without it crashing', async () => { + await couponsPage.navigate(); + await couponsPage.isDisplayed(); + } ); + } ); +}; + +module.exports = { testAdminCouponsPage }; diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/tasks/payment.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/tasks/payment.ts new file mode 100644 index 00000000000..ad3e833493f --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/tasks/payment.ts @@ -0,0 +1,68 @@ +/** + * Internal dependencies + */ +import { Login } from '../../pages/Login'; +import { OnboardingWizard } from '../../pages/OnboardingWizard'; +import { PaymentsSetup } from '../../pages/PaymentsSetup'; +import { WcHomescreen } from '../../pages/WcHomescreen'; +import { BankAccountTransferSetup } from '../../sections/payment-setup/BankAccountTransferSetup'; + +/* eslint-disable @typescript-eslint/no-var-requires */ +const { afterAll, beforeAll, describe, it } = require( '@jest/globals' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + +const testAdminPaymentSetupTask = () => { + describe( 'Payment setup task', () => { + const profileWizard = new OnboardingWizard( page ); + const homeScreen = new WcHomescreen( page ); + const paymentsSetup = new PaymentsSetup( page ); + const bankTransferSetup = new BankAccountTransferSetup( page ); + const login = new Login( page ); + + beforeAll( async () => { + await login.login(); + + // This makes this test more isolated, by always navigating to the + // profile wizard and skipping, this behaves the same as if the + // profile wizard had not been run yet and the user is redirected + // to it when trying to go to wc-admin. + await profileWizard.navigate(); + await profileWizard.skipStoreSetup(); + + await homeScreen.isDisplayed(); + await homeScreen.possiblyDismissWelcomeModal(); + } ); + + afterAll( async () => { + await login.logout(); + } ); + + it( 'Can visit the payment setup task from the homescreen if the setup wizard has been skipped', async () => { + await homeScreen.clickOnTaskList( 'Set up payments' ); + await paymentsSetup.closeHelpModal(); + await paymentsSetup.isDisplayed(); + } ); + + it( 'Saving valid bank account transfer details enables the payment method', async () => { + await paymentsSetup.goToPaymentMethodSetup( 'bacs' ); + await bankTransferSetup.saveAccountDetails( { + accountNumber: '1234', + accountName: 'Savings', + bankName: 'TestBank', + sortCode: '12', + iban: '12 3456 7890', + swiftCode: 'ABBA', + } ); + + await paymentsSetup.isDisplayed(); + await paymentsSetup.methodHasBeenSetup( 'bacs' ); + } ); + + it( 'Enabling cash on delivery enables the payment method', async () => { + await paymentsSetup.enableCashOnDelivery(); + await paymentsSetup.methodHasBeenSetup( 'cod' ); + } ); + } ); +}; + +module.exports = { testAdminPaymentSetupTask }; diff --git a/plugins/woocommerce-admin/tests/e2e/utils/actions.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/utils/actions.ts similarity index 93% rename from plugins/woocommerce-admin/tests/e2e/utils/actions.ts rename to plugins/woocommerce-admin/packages/admin-e2e-tests/src/utils/actions.ts index 846d4722b2d..321cfcb5a9a 100644 --- a/plugins/woocommerce-admin/tests/e2e/utils/actions.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/utils/actions.ts @@ -1,5 +1,12 @@ +/** + * External dependencies + */ import { ElementHandle } from 'puppeteer'; +/* eslint-disable @typescript-eslint/no-var-requires */ +const { expect } = require( '@jest/globals' ); +/* eslint-enable @typescript-eslint/no-var-requires */ + /** * Wait for UI blocking to end. */ diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/tsconfig.json b/plugins/woocommerce-admin/packages/admin-e2e-tests/tsconfig.json new file mode 100644 index 00000000000..650a3410b7d --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": [ "node", "jest" ], + "rootDir": "src", + "outDir": "build", + "noEmit": false, + "target": "es5" + }, + "include": [ "src/" ] +} diff --git a/plugins/woocommerce-admin/packages/components/package.json b/plugins/woocommerce-admin/packages/components/package.json index f85f21511ec..65e36e7b6c1 100644 --- a/plugins/woocommerce-admin/packages/components/package.json +++ b/plugins/woocommerce-admin/packages/components/package.json @@ -41,6 +41,7 @@ "@wordpress/i18n": "3.17.0", "@wordpress/icons": "^2.10.3", "@wordpress/keycodes": "2.18.0", + "@wordpress/url": "2.21.0", "@wordpress/viewport": "2.24.0", "classnames": "^2.3.1", "core-js": "3.9.1", diff --git a/plugins/woocommerce-admin/packages/data/package.json b/plugins/woocommerce-admin/packages/data/package.json index a49e23c6291..cd3db44362d 100644 --- a/plugins/woocommerce-admin/packages/data/package.json +++ b/plugins/woocommerce-admin/packages/data/package.json @@ -23,8 +23,15 @@ "dependencies": { "@woocommerce/date": "file:../date", "@woocommerce/navigation": "file:../navigation", + "@wordpress/api-fetch": "2.2.8", + "@wordpress/compose": "3.23.1", "@wordpress/core-data": "3.0.0", + "@wordpress/element": "2.19.0", + "@wordpress/hooks": "2.11.0", + "@wordpress/data": "5.0.0", + "@wordpress/data-controls": "2.0.0", "@wordpress/i18n": "3.17.0", + "@wordpress/url": "2.21.0", "md5": "^2.3.0", "rememo": "^3.0.0" }, diff --git a/plugins/woocommerce-admin/packages/navigation/package.json b/plugins/woocommerce-admin/packages/navigation/package.json index d455884bb00..6dcef0f6dbf 100644 --- a/plugins/woocommerce-admin/packages/navigation/package.json +++ b/plugins/woocommerce-admin/packages/navigation/package.json @@ -22,6 +22,12 @@ "react-native": "src/index", "dependencies": { "@woocommerce/experimental": "file:../experimental", + "@wordpress/api-fetch": "2.2.8", + "@wordpress/compose": "3.23.1", + "@wordpress/notices": "1.12.0", + "@wordpress/components": "11.1.3", + "@wordpress/hooks": "2.11.0", + "@wordpress/url": "2.21.0", "history": "4.10.1", "qs": "6.9.6" }, diff --git a/plugins/woocommerce-admin/tests/e2e/config/default.json b/plugins/woocommerce-admin/tests/e2e/config/default.json index 13c4c230c8c..644b68fc28e 100644 --- a/plugins/woocommerce-admin/tests/e2e/config/default.json +++ b/plugins/woocommerce-admin/tests/e2e/config/default.json @@ -1,5 +1,6 @@ { "url": "http://localhost:8084/", + "appName": "woocommerce-admin-e2e", "users": { "admin": { "username": "admin", diff --git a/plugins/woocommerce-admin/tests/e2e/config/jest.config.js b/plugins/woocommerce-admin/tests/e2e/config/jest.config.js index d36739e90d1..96983f0607d 100644 --- a/plugins/woocommerce-admin/tests/e2e/config/jest.config.js +++ b/plugins/woocommerce-admin/tests/e2e/config/jest.config.js @@ -2,9 +2,9 @@ const path = require( 'path' ); const { useE2EJestConfig } = require( '@woocommerce/e2e-environment' ); const config = useE2EJestConfig( { - moduleFileExtensions: [ 'js', 'ts' ], + moduleFileExtensions: [ 'js', 'ts', 'tsx' ], roots: [ path.resolve( __dirname, '../specs' ) ], - testMatch: [ '**/*.(test|spec).(j|t)s', '*.(test|spec).(j|t)s' ], + testMatch: [ '**/*.(test|spec).(js|ts|tsx)', '*.(test|spec).(js|ts|tsx)' ], testTimeout: 30000, transform: { '\\.[jt]sx?$': [ diff --git a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.ts deleted file mode 100644 index 140aa603c46..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * External dependencies - */ -import { - clearAndFillInput, - verifyValueOfInputField, -} from '@woocommerce/e2e-utils'; - -/** - * Internal dependencies - */ -import { WcSettings } from '../../pages/WcSettings'; -import { WpSettings } from '../../pages/WpSettings'; -import { Login } from '../../pages/Login'; - -describe( 'Store owner can finish initial store setup', () => { - const wcSettings = new WcSettings( page ); - const wpSettings = new WpSettings( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - } ); - afterAll( async () => { - await login.logout(); - } ); - - it( 'can enable tax rates and calculations', async () => { - // Go to general settings page - await wcSettings.navigate( 'general' ); - await wcSettings.enableTaxRates(); - await wcSettings.saveSettings(); - - // Verify that settings have been saved - const taxRate = await wcSettings.getTaxRateValue(); - expect( taxRate ).toEqual( true ); - } ); - - it( 'can configure permalink settings', async () => { - // Go to Permalink Settings page - await wpSettings.navigate(); - await wpSettings.openPermalinkSettings(); - - // Select "Post name" option in common settings section - await page.click( 'input[value="/%postname%/"]' ); - - // Select "Custom base" in product permalinks section - await page.click( '#woocommerce_custom_selection' ); - - // Fill custom base slug to use - await clearAndFillInput( '#woocommerce_permalink_structure', '' ); - await page.type( '#woocommerce_permalink_structure', '/product/' ); - - await wpSettings.saveSettings(); - - // Verify that settings have been saved - await Promise.all( [ - expect( page ).toMatchElement( '#setting-error-settings_updated', { - text: 'Permalink structure updated.', - } ), - verifyValueOfInputField( '#permalink_structure', '/%postname%/' ), - verifyValueOfInputField( - '#woocommerce_permalink_structure', - '/product/' - ), - ] ); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.tsx new file mode 100644 index 00000000000..4b26f2133a4 --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/basic-setup.test.tsx @@ -0,0 +1,3 @@ +const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminBasicSetup(); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.ts deleted file mode 100644 index 2eb10893850..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.ts +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Internal dependencies - */ -import { OnboardingWizard } from '../../pages/OnboardingWizard'; -import { WcHomescreen } from '../../pages/WcHomescreen'; -import { TaskTitles } from '../../constants/taskTitles'; -import { getElementByText } from '../../utils/actions'; -import { Login } from '../../pages/Login'; - -const config = require( 'config' ); - -/** - * This tests a default, happy path for the onboarding wizard. - */ -describe( 'Store owner can complete onboarding wizard', () => { - const profileWizard = new OnboardingWizard( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - } ); - afterAll( async () => { - await login.logout(); - } ); - - it( 'can start the profile wizard', async () => { - await profileWizard.navigate(); - } ); - - it( 'can complete the store details section', async () => { - await profileWizard.storeDetails.completeStoreDetailsSection(); - // Wait for "Continue" button to become active - await profileWizard.continue(); - - // Wait for usage tracking pop-up window to appear - await profileWizard.optionallySelectUsageTracking(); - } ); - - it( 'can complete the industry section', async () => { - // Query for the industries checkboxes - await profileWizard.industry.isDisplayed( 8 ); - await profileWizard.industry.uncheckIndustries(); - - // Select just "fashion" and "health/beauty" to get the single checkbox business section when - // filling out details for a US store. - await profileWizard.industry.selectIndustry( - 'Fashion, apparel, and accessories' - ); - await profileWizard.industry.selectIndustry( 'Health and beauty' ); - - await profileWizard.continue(); - } ); - - it( 'can complete the product types section', async () => { - await profileWizard.productTypes.isDisplayed( 7 ); - await profileWizard.productTypes.uncheckProducts(); - - // Select Physical and Downloadable products - await profileWizard.productTypes.selectProduct( 'Physical products' ); - await profileWizard.productTypes.selectProduct( 'Downloads' ); - - await profileWizard.continue(); - } ); - - it( 'can complete the business section', async () => { - await profileWizard.business.isDisplayed(); - await profileWizard.business.selectProductNumber( - config.get( 'onboardingwizard.numberofproducts' ) - ); - await profileWizard.business.selectCurrentlySelling( - config.get( 'onboardingwizard.sellingelsewhere' ) - ); - - await profileWizard.continue(); - } ); - - it( 'can unselect all business features and continue', async () => { - await profileWizard.business.freeFeaturesIsDisplayed(); - // Add WC Pay check - await profileWizard.business.expandRecommendedBusinessFeatures(); - - expect( page ).toMatchElement( 'a', { - text: 'WooCommerce Payments', - } ); - - await profileWizard.business.uncheckAllRecommendedBusinessFeatures(); - await profileWizard.continue(); - } ); - - it( 'can complete the theme selection section', async () => { - await profileWizard.themes.isDisplayed(); - await profileWizard.themes.continueWithActiveTheme(); - } ); -} ); - -describe( 'A japanese store can complete the selective bundle install but does not include WCPay. ', () => { - const profileWizard = new OnboardingWizard( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - } ); - afterAll( async () => { - await login.logout(); - } ); - - it( 'can start the profile wizard', async () => { - await profileWizard.navigate(); - } ); - - it( 'can complete the store details section', async () => { - await profileWizard.storeDetails.completeStoreDetailsSection( { - countryRegionSubstring: 'japan', - countryRegionSelector: 'JP\\:JP01', - countryRegion: 'Japan — Hokkaido', - } ); - - // Wait for "Continue" button to become active - await profileWizard.continue(); - - // Wait for usage tracking pop-up window to appear - await profileWizard.optionallySelectUsageTracking(); - } ); - - // JP:JP01 - it( 'can choose the "Other" industry', async () => { - // Query for the industries checkboxes - await profileWizard.industry.isDisplayed(); - await profileWizard.industry.uncheckIndustries(); - await profileWizard.industry.selectIndustry( 'Other' ); - await profileWizard.continue(); - } ); - - it( 'can complete the product types section', async () => { - await profileWizard.productTypes.isDisplayed( 7 ); - await profileWizard.productTypes.uncheckProducts(); - - // Select Physical and Downloadable products - await profileWizard.productTypes.selectProduct( 'Physical products' ); - await profileWizard.productTypes.selectProduct( 'Downloads' ); - - await profileWizard.continue(); - await page.waitForNavigation( { waitUntil: 'networkidle0' } ); - } ); - - it( 'can complete the business details tab', async () => { - await profileWizard.business.isDisplayed(); - - await profileWizard.business.selectProductNumber( - config.get( 'onboardingwizard.numberofproducts' ) - ); - await profileWizard.business.selectCurrentlySelling( - config.get( 'onboardingwizard.sellingelsewhere' ) - ); - - await profileWizard.continue(); - } ); - - it( 'can choose not to install any extensions', async () => { - await profileWizard.business.freeFeaturesIsDisplayed(); - // Add WC Pay check - await profileWizard.business.expandRecommendedBusinessFeatures(); - - expect( page ).not.toMatchElement( 'a', { - text: 'WooCommerce Payments', - } ); - - await profileWizard.business.uncheckAllRecommendedBusinessFeatures(); - await profileWizard.continue(); - } ); - - it( 'can finish the rest of the wizard successfully', async () => { - await profileWizard.themes.isDisplayed(); - - // This navigates to the home screen - await profileWizard.themes.continueWithActiveTheme(); - } ); - - it( 'should display the choose payments task, and not the woocommerce payments task', async () => { - const homescreen = new WcHomescreen( page ); - await homescreen.isDisplayed(); - await homescreen.possiblyDismissWelcomeModal(); - const tasks = await homescreen.getTaskList(); - expect( tasks ).toContain( TaskTitles.addPayments ); - expect( tasks ).not.toContain( TaskTitles.wooPayments ); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.tsx new file mode 100644 index 00000000000..9713b5185a1 --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.tsx @@ -0,0 +1,7 @@ +const { + testAdminOnboardingWizard, + testSelectiveBundleWCPay, +} = require( '@woocommerce/admin-e2e-tests' ); + +testAdminOnboardingWizard(); +testSelectiveBundleWCPay(); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.ts deleted file mode 100644 index cdf0ea551fa..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Internal dependencies - */ -import { AnalyticsOverview } from '../../pages/AnalyticsOverview'; -import { Login } from '../../pages/Login'; - -describe( 'Analytics pages', () => { - const analyticsPage = new AnalyticsOverview( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - await analyticsPage.navigate(); - await analyticsPage.isDisplayed(); - } ); - afterAll( async () => { - await login.logout(); - } ); - - it( 'a user should see 3 sections by default - Performance, Charts, and Leaderboards', async () => { - const sections = ( await analyticsPage.getSections() ).map( - ( section ) => section.title - ); - expect( sections ).toContain( 'Performance' ); - expect( sections ).toContain( 'Charts' ); - expect( sections ).toContain( 'Leaderboards' ); - } ); - - it( 'should allow a user to remove a section', async () => { - await analyticsPage.removeSection( 'Performance' ); - const sections = ( await analyticsPage.getSections() ).map( - ( section ) => section.title - ); - expect( sections ).not.toContain( 'Performance' ); - } ); - - it( 'should allow a user to add a section back in', async () => { - let sections = ( await analyticsPage.getSections() ).map( - ( section ) => section.title - ); - expect( sections ).not.toContain( 'Performance' ); - await analyticsPage.addSection( 'Performance' ); - - sections = ( await analyticsPage.getSections() ).map( - ( section ) => section.title - ); - expect( sections ).toContain( 'Performance' ); - } ); - - describe( 'moving sections', () => { - it( 'should not display move up for the top, or move down for the bottom section', async () => { - const sections = await analyticsPage.getSections(); - for ( const section of sections ) { - const index = sections.indexOf( section ); - const menuItems = ( - await analyticsPage.getEllipsisMenuItems( section.title ) - ).map( ( item ) => item.title ); - if ( index === 0 ) { - expect( menuItems ).toContain( 'Move down' ); - expect( menuItems ).not.toContain( 'Move up' ); - } else if ( index === sections.length - 1 ) { - expect( menuItems ).not.toContain( 'Move down' ); - expect( menuItems ).toContain( 'Move up' ); - } else { - expect( menuItems ).toContain( 'Move down' ); - expect( menuItems ).toContain( 'Move up' ); - } - await analyticsPage.closeSectionEllipsis( section.title ); - } - } ); - - it( 'should allow a user to move a section down', async () => { - const sections = await analyticsPage.getSections(); - await analyticsPage.moveSectionDown( sections[ 0 ].title ); - const newSections = await analyticsPage.getSections(); - expect( sections[ 0 ].title ).toEqual( newSections[ 1 ].title ); - expect( sections[ 1 ].title ).toEqual( newSections[ 0 ].title ); - } ); - - it( 'should allow a user to move a section up', async () => { - const sections = await analyticsPage.getSections(); - await analyticsPage.moveSectionUp( sections[ 1 ].title ); - const newSections = await analyticsPage.getSections(); - expect( sections[ 0 ].title ).toEqual( newSections[ 1 ].title ); - expect( sections[ 1 ].title ).toEqual( newSections[ 0 ].title ); - } ); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.tsx new file mode 100644 index 00000000000..9bc1b4e7467 --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics-overview.test.tsx @@ -0,0 +1,3 @@ +const { testAdminAnalyticsOverview } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminAnalyticsOverview(); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.ts deleted file mode 100644 index 7e13954b170..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Internal dependencies - */ -import { Analytics } from '../../pages/Analytics'; -import { Login } from '../../pages/Login'; - -describe( 'Analytics pages', () => { - const analyticsPage = new Analytics( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - } ); - afterAll( async () => { - await login.logout(); - } ); - - it( 'A user can view the analytics overview without it crashing', async () => { - await analyticsPage.navigate(); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for products without it crashing', async () => { - await analyticsPage.navigateToSection( 'products' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for revenue without it crashing', async () => { - await analyticsPage.navigateToSection( 'revenue' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for orders without it crashing', async () => { - await analyticsPage.navigateToSection( 'orders' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for variations without it crashing', async () => { - await analyticsPage.navigateToSection( 'variations' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for categories without it crashing', async () => { - await analyticsPage.navigateToSection( 'categories' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for coupons without it crashing', async () => { - await analyticsPage.navigateToSection( 'coupons' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for taxes without it crashing', async () => { - await analyticsPage.navigateToSection( 'taxes' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for downloads without it crashing', async () => { - await analyticsPage.navigateToSection( 'downloads' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for stock without it crashing', async () => { - await analyticsPage.navigateToSection( 'stock' ); - await analyticsPage.isDisplayed(); - } ); - - it( 'A user can view the analytics for settings without it crashing', async () => { - await analyticsPage.navigateToSection( 'settings' ); - await analyticsPage.isDisplayed(); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.tsx new file mode 100644 index 00000000000..5a38d6f3234 --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/analytics/analytics.test.tsx @@ -0,0 +1,3 @@ +const { testAdminAnalyticsPages } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminAnalyticsPages(); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.ts deleted file mode 100644 index a229cf2fb5c..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Internal dependencies - */ -import { Coupons } from '../../pages/Coupons'; -import { Login } from '../../pages/Login'; - -describe( 'Coupons page', () => { - const couponsPage = new Coupons( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - } ); - - afterAll( async () => { - await login.logout(); - } ); - - it( 'A user can view the coupons overview without it crashing', async () => { - await couponsPage.navigate(); - await couponsPage.isDisplayed(); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.tsx new file mode 100644 index 00000000000..28629da035c --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/marketing/coupons.test.tsx @@ -0,0 +1,3 @@ +const { testAdminCouponsPage } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminCouponsPage(); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.ts b/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.ts deleted file mode 100644 index 571c2be60aa..00000000000 --- a/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Internal dependencies - */ -import { Login } from '../../pages/Login'; -import { OnboardingWizard } from '../../pages/OnboardingWizard'; -import { PaymentsSetup } from '../../pages/PaymentsSetup'; -import { WcHomescreen } from '../../pages/WcHomescreen'; -import { BankAccountTransferSetup } from '../../sections/payment-setup/BankAccountTransferSetup'; - -describe( 'Payment setup task', () => { - const profileWizard = new OnboardingWizard( page ); - const homeScreen = new WcHomescreen( page ); - const paymentsSetup = new PaymentsSetup( page ); - const bankTransferSetup = new BankAccountTransferSetup( page ); - const login = new Login( page ); - - beforeAll( async () => { - await login.login(); - - // This makes this test more isolated, by always navigating to the - // profile wizard and skipping, this behaves the same as if the - // profile wizard had not been run yet and the user is redirected - // to it when trying to go to wc-admin. - await profileWizard.navigate(); - await profileWizard.skipStoreSetup(); - - await homeScreen.isDisplayed(); - await homeScreen.possiblyDismissWelcomeModal(); - } ); - - afterAll( async () => { - await login.logout(); - } ); - - it( 'Can visit the payment setup task from the homescreen if the setup wizard has been skipped', async () => { - await homeScreen.clickOnTaskList( 'Set up payments' ); - await paymentsSetup.closeHelpModal(); - await paymentsSetup.isDisplayed(); - } ); - - it( 'Saving valid bank account transfer details enables the payment method', async () => { - await paymentsSetup.goToPaymentMethodSetup( 'bacs' ); - await bankTransferSetup.saveAccountDetails( { - accountNumber: '1234', - accountName: 'Savings', - bankName: 'TestBank', - sortCode: '12', - iban: '12 3456 7890', - swiftCode: 'ABBA', - } ); - - await paymentsSetup.isDisplayed(); - await paymentsSetup.methodHasBeenSetup( 'bacs' ); - } ); - - it( 'Enabling cash on delivery enables the payment method', async () => { - await paymentsSetup.enableCashOnDelivery(); - await paymentsSetup.methodHasBeenSetup( 'cod' ); - } ); -} ); diff --git a/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.tsx b/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.tsx new file mode 100644 index 00000000000..a0600e5d656 --- /dev/null +++ b/plugins/woocommerce-admin/tests/e2e/specs/tasks/payment.test.tsx @@ -0,0 +1,3 @@ +const { testAdminPaymentSetupTask } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminPaymentSetupTask();