diff --git a/package-lock.json b/package-lock.json index 5b2f996cf11..156ffb12b11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "woocommerce", - "version": "5.7.0", + "version": "5.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2059,6 +2059,307 @@ "lolex": "^5.0.0" } }, + "@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" + }, + "dependencies": { + "@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/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "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" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true + }, + "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 + }, + "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" + } + }, + "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==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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-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" + } + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + } + }, + "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==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "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" + } + }, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "@jest/reporters": { "version": "25.5.1", "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-25.5.1.tgz", @@ -4119,6 +4420,131 @@ "@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==", + "dev": true, + "requires": { + "jest-diff": "^26.0.0", + "pretty-format": "^26.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "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" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "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==", + "dev": true + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + } + }, + "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==", + "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==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "@types/json-schema": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", @@ -4495,6 +4921,28 @@ "@xtuc/long": "4.2.2" } }, + "@woocommerce/admin-e2e-tests": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@woocommerce/admin-e2e-tests/-/admin-e2e-tests-0.1.0.tgz", + "integrity": "sha512-QpKLiS6ShIMO0Eb7FbblMwyhYVzV29v+QWIslUizduuzVQxH9i1ow3IZ966xC8b+a1fF7hI/zQp4NNp1CaHNmw==", + "dev": true, + "requires": { + "@jest/globals": "^26.4.2", + "@types/jest": "26.0.23", + "config": "3.3.6" + }, + "dependencies": { + "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" + } + } + } + }, "@woocommerce/api": { "version": "file:tests/e2e/api", "dev": true, diff --git a/package.json b/package.json index 3e81a6b9cc8..b06d4df14a1 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@typescript-eslint/eslint-plugin": "3.10.1", "@typescript-eslint/experimental-utils": "3.10.1", "@typescript-eslint/parser": "3.10.1", + "@woocommerce/admin-e2e-tests": "0.1.0", "@woocommerce/api": "file:tests/e2e/api", "@woocommerce/e2e-core-tests": "file:tests/e2e/core-tests", "@woocommerce/e2e-environment": "file:tests/e2e/env", diff --git a/tests/e2e/config/jest.setup.js b/tests/e2e/config/jest.setup.js index c3d63a5bcb7..59eb9da95b5 100644 --- a/tests/e2e/config/jest.setup.js +++ b/tests/e2e/config/jest.setup.js @@ -45,17 +45,17 @@ beforeAll(async () => { page.setDefaultTimeout( DEFAULT_TIMEOUT_OVERRIDE ); } - // Update the ready page to prevent concurrent test runs try { + // Update the ready page to prevent concurrent test runs await updateReadyPageStatus('draft'); + await trashExistingPosts(); + await withRestApi.deleteAllProducts(); + await withRestApi.deleteAllCoupons(); + await withRestApi.deleteAllOrders(); } catch ( error ) { // Prevent an error here causing tests to fail. } - await trashExistingPosts(); - await withRestApi.deleteAllProducts(); - await withRestApi.deleteAllCoupons(); - await withRestApi.deleteAllOrders(); await page.goto(WP_ADMIN_LOGIN); await clearLocalStorage(); await setBrowserViewport('large'); @@ -65,7 +65,11 @@ beforeAll(async () => { // This is to ensure that each test ends with no user logged in. afterAll(async () => { // Reset the ready page to published to allow future test runs - await updateReadyPageStatus('publish'); + try { + await updateReadyPageStatus('publish'); + } catch ( error ) { + // Prevent an error here causing tests to fail. + } const client = await page.target().createCDPSession(); await client.send('Network.clearBrowserCookies'); diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js index ca72de04f46..93f0c5d6247 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js @@ -1,4 +1,3 @@ -/* eslint-disable jest/no-export, jest/no-disabled-tests */ /** * Internal dependencies */ @@ -8,7 +7,9 @@ const { clickTab, uiUnblocked, evalAndClick, + setCheckbox, verifyAndPublish, + waitForSelectorWithoutThrow } = require( '@woocommerce/e2e-utils' ); const { waitAndClick, @@ -29,26 +30,6 @@ const VirtualProductName = 'Virtual Product Name'; const NonVirtualProductName = 'Non-Virtual Product Name'; const simpleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99'; -const verifyPublishAndTrash = async () => { - // Wait for auto save - await page.waitFor( 2000 ); - - // Publish product - await expect( page ).toClick( '#publish' ); - await page.waitForSelector( '.updated.notice', { text: 'Product published.' } ); - - // Verify - await expect( page ).toMatchElement( '.updated.notice', { text: 'Product published.' } ); - await page.waitForSelector( 'a', { text: 'Move to Trash' } ); - - // Trash product - await expect( page ).toClick( 'a', { text: 'Move to Trash' } ); - await page.waitForSelector( '.updated.notice', { text: '1 product moved to the Trash.' } ); - - // Verify - await expect( page ).toMatchElement( '.updated.notice', { text: '1 product moved to the Trash.' } ); -}; - const openNewProductAndVerify = async () => { // Go to "add product" page await merchant.openNewProduct(); @@ -174,7 +155,7 @@ const runAddVariableProductTest = () => { await uiUnblocked(); }); - it('can create variation attributes', async () => { + it('can add variation attributes', async () => { await waitAndClick( page, '.variations_tab a' ); await uiUnblocked(); await waitForSelector( @@ -187,46 +168,24 @@ const runAddVariableProductTest = () => { ); // Verify that variations were created - await Promise.all([ - expect(page).toMatchElement('select[name="attribute_attr-1[0]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-2[0]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-3[0]"]', {text: 'val1'}), + for ( let index = 0; index < 8; index++ ) { + const val1 = { text: 'val1' }; + const val2 = { text: 'val2' }; - expect(page).toMatchElement('select[name="attribute_attr-1[1]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-2[1]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-3[1]"]', {text: 'val2'}), + // odd / even + let attr3 = !! ( index % 2 ); + // 0-1,4-5 / 2-3,6-7 + let attr2 = ( index % 4 ) > 1; + // 0-3 / 4-7 + let attr1 = ( index > 3 ); - expect(page).toMatchElement('select[name="attribute_attr-1[2]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-2[2]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-3[2]"]', {text: 'val1'}), + await expect( page ).toMatchElement( `select[name="attribute_attr-1[${index}]"]`, attr1 ? val2 : val1 ); + await expect( page ).toMatchElement( `select[name="attribute_attr-2[${index}]"]`, attr2 ? val2 : val1 ); + await expect( page ).toMatchElement( `select[name="attribute_attr-3[${index}]"]`, attr3 ? val2 : val1 ); + } - expect(page).toMatchElement('select[name="attribute_attr-1[3]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-2[3]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-3[3]"]', {text: 'val2'}), - - expect(page).toMatchElement('select[name="attribute_attr-1[4]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-2[4]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-3[4]"]', {text: 'val1'}), - - expect(page).toMatchElement('select[name="attribute_attr-1[5]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-2[5]"]', {text: 'val1'}), - expect(page).toMatchElement('select[name="attribute_attr-3[5]"]', {text: 'val2'}), - - expect(page).toMatchElement('select[name="attribute_attr-1[6]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-2[6]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-3[6]"]', {text: 'val1'}), - - expect(page).toMatchElement('select[name="attribute_attr-1[7]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-2[7]"]', {text: 'val2'}), - expect(page).toMatchElement('select[name="attribute_attr-3[7]"]', {text: 'val2'}), - ]); - - /* - Puppeteer seems unable to find the individual variation fields in headless mode on MacOS - This section of the test runs fine in both Travis and non-headless mode on Mac - Disabling temporarily to allow the test to be re-enabled without local testing headache await waitAndClick( page, '.variations-pagenav .expand_all'); - await page.waitFor( 2000 ); + await waitForSelectorWithoutThrow( 'input[name="variable_is_virtual[0]"]', 2 ); await setCheckbox('input[name="variable_is_virtual[0]"]'); await expect(page).toFill('input[name="variable_regular_price[0]"]', '9.99'); @@ -242,15 +201,7 @@ const runAddVariableProductTest = () => { await page.focus('button.save-variation-changes'); await expect(page).toClick('button.save-variation-changes', {text: 'Save changes'}); - /**/ - - // Publish product, verify that it was published. Trash product, verify that it was trashed. - await verifyPublishAndTrash( - '#publish', - '.notice', - 'Product published.', - '1 product moved to the Trash.' - ); + // @todo: https://github.com/woocommerce/woocommerce/issues/30580 }); }); }; diff --git a/tests/e2e/env/utils/update-ready-page.js b/tests/e2e/env/utils/update-ready-page.js index f502efdac58..045160c26b9 100644 --- a/tests/e2e/env/utils/update-ready-page.js +++ b/tests/e2e/env/utils/update-ready-page.js @@ -13,8 +13,8 @@ const updateReadyPageStatus = async ( status ) => { const wpPagesEndpoint = '/wp/v2/pages'; const adminUsername = testConfig.users.admin.username ? testConfig.users.admin.username : 'admin'; const adminPassword = testConfig.users.admin.password ? testConfig.users.admin.password : 'password'; - const client = HTTPClientFactory.build(apiUrl) - .withBasicAuth(adminUsername, adminPassword) + const client = HTTPClientFactory.build( apiUrl ) + .withBasicAuth( adminUsername, adminPassword ) .create(); // As the default status filter in the API is `publish`, we need to @@ -25,11 +25,11 @@ const updateReadyPageStatus = async ( status ) => { statusFilter = 'draft'; } - const getPostsResponse = await client.get(`${wpPagesEndpoint}?search=ready&status=${statusFilter}`); - if ( getPostsResponse.data && getPostsResponse.data.length > 0) { + const getPostsResponse = await client.get( `${wpPagesEndpoint}?search=ready&status=${statusFilter}` ); + if ( getPostsResponse.data && getPostsResponse.data.length > 0 ) { const pageId = getPostsResponse.data[0].id; // Update the page to the new status - await client.post(`${wpPagesEndpoint}/${pageId}`, { 'status': status }); + await client.post( `${wpPagesEndpoint}/${pageId}`, { 'status': status } ); } } diff --git a/tests/e2e/specs/activate-and-setup/activation.test.js b/tests/e2e/specs/activate-and-setup/activation.test.js deleted file mode 100644 index 90c27969581..00000000000 --- a/tests/e2e/specs/activate-and-setup/activation.test.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Internal dependencies - */ -const { runActivationTest } = require( '@woocommerce/e2e-core-tests' ); - -runActivationTest(); diff --git a/tests/e2e/specs/activate-and-setup/basic-setup.test.js b/tests/e2e/specs/activate-and-setup/basic-setup.test.js new file mode 100644 index 00000000000..4b26f2133a4 --- /dev/null +++ b/tests/e2e/specs/activate-and-setup/basic-setup.test.js @@ -0,0 +1,3 @@ +const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminBasicSetup(); diff --git a/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js b/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js new file mode 100644 index 00000000000..9713b5185a1 --- /dev/null +++ b/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js @@ -0,0 +1,7 @@ +const { + testAdminOnboardingWizard, + testSelectiveBundleWCPay, +} = require( '@woocommerce/admin-e2e-tests' ); + +testAdminOnboardingWizard(); +testSelectiveBundleWCPay(); diff --git a/tests/e2e/specs/activate-and-setup/onboarding-tasklist.test.js b/tests/e2e/specs/activate-and-setup/onboarding-tasklist.test.js deleted file mode 100644 index 2bcea69b8a0..00000000000 --- a/tests/e2e/specs/activate-and-setup/onboarding-tasklist.test.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Internal dependencies - */ -const { runOnboardingFlowTest } = require( '@woocommerce/e2e-core-tests' ); - -runOnboardingFlowTest(); diff --git a/tests/e2e/specs/activate-and-setup/settings-initial.test.js b/tests/e2e/specs/activate-and-setup/settings-initial.test.js deleted file mode 100644 index d0348b7f04c..00000000000 --- a/tests/e2e/specs/activate-and-setup/settings-initial.test.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Internal dependencies - */ -const { runInitialStoreSettingsTest } = require( '@woocommerce/e2e-core-tests' ); - -runInitialStoreSettingsTest(); diff --git a/tests/e2e/specs/admin-analytics/analytics-overview.test.js b/tests/e2e/specs/admin-analytics/analytics-overview.test.js new file mode 100644 index 00000000000..9bc1b4e7467 --- /dev/null +++ b/tests/e2e/specs/admin-analytics/analytics-overview.test.js @@ -0,0 +1,3 @@ +const { testAdminAnalyticsOverview } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminAnalyticsOverview(); diff --git a/tests/e2e/specs/admin-analytics/analytics.test.js b/tests/e2e/specs/admin-analytics/analytics.test.js new file mode 100644 index 00000000000..5a38d6f3234 --- /dev/null +++ b/tests/e2e/specs/admin-analytics/analytics.test.js @@ -0,0 +1,3 @@ +const { testAdminAnalyticsPages } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminAnalyticsPages(); diff --git a/tests/e2e/specs/admin-marketing/coupons.test.js b/tests/e2e/specs/admin-marketing/coupons.test.js new file mode 100644 index 00000000000..28629da035c --- /dev/null +++ b/tests/e2e/specs/admin-marketing/coupons.test.js @@ -0,0 +1,3 @@ +const { testAdminCouponsPage } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminCouponsPage(); diff --git a/tests/e2e/specs/admin-tasks/payment.test.tsx b/tests/e2e/specs/admin-tasks/payment.test.tsx new file mode 100644 index 00000000000..a0600e5d656 --- /dev/null +++ b/tests/e2e/specs/admin-tasks/payment.test.tsx @@ -0,0 +1,3 @@ +const { testAdminPaymentSetupTask } = require( '@woocommerce/admin-e2e-tests' ); + +testAdminPaymentSetupTask(); diff --git a/tests/e2e/specs/wp-admin/analytics-page-loads.test.js b/tests/e2e/specs/wp-admin/analytics-page-loads.js similarity index 100% rename from tests/e2e/specs/wp-admin/analytics-page-loads.test.js rename to tests/e2e/specs/wp-admin/analytics-page-loads.js