Merge pull request #30558 from woocommerce/add/admin-e2e-tests

add admin E2E tests
This commit is contained in:
Greg 2021-08-26 08:58:32 -06:00 committed by GitHub
commit 44cf40b781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 505 additions and 97 deletions

450
package-lock.json generated
View File

@ -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,

View File

@ -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",

View File

@ -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');

View File

@ -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
});
});
};

View File

@ -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 } );
}
}

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runActivationTest } = require( '@woocommerce/e2e-core-tests' );
runActivationTest();

View File

@ -0,0 +1,3 @@
const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' );
testAdminBasicSetup();

View File

@ -0,0 +1,7 @@
const {
testAdminOnboardingWizard,
testSelectiveBundleWCPay,
} = require( '@woocommerce/admin-e2e-tests' );
testAdminOnboardingWizard();
testSelectiveBundleWCPay();

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runOnboardingFlowTest } = require( '@woocommerce/e2e-core-tests' );
runOnboardingFlowTest();

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runInitialStoreSettingsTest } = require( '@woocommerce/e2e-core-tests' );
runInitialStoreSettingsTest();

View File

@ -0,0 +1,3 @@
const { testAdminAnalyticsOverview } = require( '@woocommerce/admin-e2e-tests' );
testAdminAnalyticsOverview();

View File

@ -0,0 +1,3 @@
const { testAdminAnalyticsPages } = require( '@woocommerce/admin-e2e-tests' );
testAdminAnalyticsPages();

View File

@ -0,0 +1,3 @@
const { testAdminCouponsPage } = require( '@woocommerce/admin-e2e-tests' );
testAdminCouponsPage();

View File

@ -0,0 +1,3 @@
const { testAdminPaymentSetupTask } = require( '@woocommerce/admin-e2e-tests' );
testAdminPaymentSetupTask();