Merge branch 'trunk' into e2e/e2e-merchant-settings-add-shipping-classes

This commit is contained in:
Rodel Calasagsag 2021-04-06 01:26:12 -07:00 committed by GitHub
commit da4d294e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 554 additions and 54 deletions

38
.github/workflows/smoke-test-daily.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Smoke test daily
on:
schedule:
- cron: '3 25 * * *'
jobs:
login-run:
name: Log into smoke test site.
runs-on: ubuntu-18.04
steps:
- name: Create dirs.
run: |
mkdir -p code/woocommerce
mkdir -p package/woocommerce
mkdir -p tmp/woocommerce
mkdir -p node_modules
- name: Checkout code.
uses: actions/checkout@v2
with:
path: package/woocommerce
- name: Run npm install.
working-directory: package/woocommerce
run: npm install
- name: Move current directory to code. We will install zip file in this dir later.
run: mv ./package/woocommerce/* ./code/woocommerce
- name: Run login test.
working-directory: code/woocommerce
env:
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
run: npx wc-e2e test:e2e ./tests/e2e/specs/activate-and-setup/test-activation.js

View File

@ -1,7 +1,7 @@
name: 'Close stale needs-feedback issues' name: 'Close stale needs-feedback issues'
on: on:
schedule: schedule:
- cron: '0 21 * * *' - cron: '21 0 * * *'
jobs: jobs:
stale: stale:
@ -17,4 +17,5 @@ jobs:
days-before-pr-close: -1 days-before-pr-close: -1
only-issue-labels: 'needs feedback' only-issue-labels: 'needs feedback'
close-issue-label: "category: can't reproduce" close-issue-label: "category: can't reproduce"
ascending: true
debug-only: true debug-only: true

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ project.properties
.settings* .settings*
.idea .idea
.vscode .vscode
.eslintcache
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
.sublimelinterrc .sublimelinterrc

View File

@ -33,6 +33,7 @@
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.4" "vimeo/psalm": "^4.4"
}, },
"default-branch": true,
"bin": [ "bin": [
"bin/mozart" "bin/mozart"
], ],
@ -53,6 +54,10 @@
} }
], ],
"description": "Composes all dependencies as a package inside a WordPress plugin", "description": "Composes all dependencies as a package inside a WordPress plugin",
"support": {
"issues": "https://github.com/coenjacobs/mozart/issues",
"source": "https://github.com/coenjacobs/mozart/tree/master"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/coenjacobs", "url": "https://github.com/coenjacobs",
@ -144,6 +149,10 @@
"sftp", "sftp",
"storage" "storage"
], ],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/1.x"
},
"funding": [ "funding": [
{ {
"url": "https://offset.earth/frankdejonge", "url": "https://offset.earth/frankdejonge",
@ -192,6 +201,10 @@
} }
], ],
"description": "Mime-type detection for Flysystem", "description": "Mime-type detection for Flysystem",
"support": {
"issues": "https://github.com/thephpleague/mime-type-detection/issues",
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/frankdejonge", "url": "https://github.com/frankdejonge",
@ -246,20 +259,24 @@
"container-interop", "container-interop",
"psr" "psr"
], ],
"support": {
"issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/1.1.1"
},
"time": "2021-03-05T17:36:06+00:00" "time": "2021-03-05T17:36:06+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.2.4", "version": "v5.2.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "d6d0cc30d8c0fda4e7b213c20509b0159a8f4556" "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/d6d0cc30d8c0fda4e7b213c20509b0159a8f4556", "url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d",
"reference": "d6d0cc30d8c0fda4e7b213c20509b0159a8f4556", "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -326,6 +343,9 @@
"console", "console",
"terminal" "terminal"
], ],
"support": {
"source": "https://github.com/symfony/console/tree/v5.2.6"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -340,7 +360,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-23T10:08:49+00:00" "time": "2021-03-28T09:42:18+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
@ -384,6 +404,9 @@
], ],
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v5.2.4"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -460,6 +483,9 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -538,6 +564,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -619,6 +648,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -696,6 +728,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -772,6 +807,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -852,6 +890,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -928,6 +969,9 @@
"interoperability", "interoperability",
"standards" "standards"
], ],
"support": {
"source": "https://github.com/symfony/service-contracts/tree/master"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -946,16 +990,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.2.4", "version": "v5.2.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "4e78d7d47061fa183639927ec40d607973699609" "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/4e78d7d47061fa183639927ec40d607973699609", "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572",
"reference": "4e78d7d47061fa183639927ec40d607973699609", "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1008,6 +1052,9 @@
"utf-8", "utf-8",
"utf8" "utf8"
], ],
"support": {
"source": "https://github.com/symfony/string/tree/v5.2.6"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -1022,7 +1069,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-16T10:20:28+00:00" "time": "2021-03-17T17:12:15+00:00"
} }
], ],
"aliases": [], "aliases": [],
@ -1037,5 +1084,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.3" "php": "7.3"
}, },
"plugin-api-version": "1.1.0" "plugin-api-version": "2.0.0"
} }

View File

@ -71,6 +71,10 @@
"stylecheck", "stylecheck",
"tests" "tests"
], ],
"support": {
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
},
"time": "2020-06-25T14:57:39+00:00" "time": "2020-06-25T14:57:39+00:00"
}, },
{ {
@ -129,6 +133,10 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibility"
},
"time": "2019-12-27T09:44:58+00:00" "time": "2019-12-27T09:44:58+00:00"
}, },
{ {
@ -181,6 +189,10 @@
"polyfill", "polyfill",
"standards" "standards"
], ],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
},
"time": "2021-02-15T10:24:51+00:00" "time": "2021-02-15T10:24:51+00:00"
}, },
{ {
@ -231,6 +243,10 @@
"standards", "standards",
"wordpress" "wordpress"
], ],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
},
"time": "2019-08-28T14:22:28+00:00" "time": "2019-08-28T14:22:28+00:00"
}, },
{ {
@ -282,6 +298,11 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2020-10-23T02:01:07+00:00" "time": "2020-10-23T02:01:07+00:00"
}, },
{ {
@ -322,6 +343,10 @@
"woocommerce", "woocommerce",
"wordpress" "wordpress"
], ],
"support": {
"issues": "https://github.com/woocommerce/woocommerce-sniffs/issues",
"source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master"
},
"time": "2020-08-06T18:23:45+00:00" "time": "2020-08-06T18:23:45+00:00"
}, },
{ {
@ -368,6 +393,11 @@
"standards", "standards",
"wordpress" "wordpress"
], ],
"support": {
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
},
"time": "2020-05-13T23:57:56+00:00" "time": "2020-05-13T23:57:56+00:00"
} }
], ],
@ -381,5 +411,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.0" "php": "7.0"
}, },
"plugin-api-version": "1.1.0" "plugin-api-version": "2.0.0"
} }

View File

@ -59,6 +59,10 @@
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/master"
},
"time": "2015-06-14T21:17:01+00:00" "time": "2015-06-14T21:17:01+00:00"
}, },
{ {
@ -104,6 +108,10 @@
"object", "object",
"object graph" "object graph"
], ],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.x"
},
"time": "2017-10-19T19:58:43+00:00" "time": "2017-10-19T19:58:43+00:00"
}, },
{ {
@ -159,6 +167,10 @@
} }
], ],
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
"source": "https://github.com/phar-io/manifest/tree/master"
},
"time": "2017-03-05T18:14:27+00:00" "time": "2017-03-05T18:14:27+00:00"
}, },
{ {
@ -206,6 +218,10 @@
} }
], ],
"description": "Library for handling version information and constraints", "description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/master"
},
"time": "2017-03-05T17:38:23+00:00" "time": "2017-03-05T17:38:23+00:00"
}, },
{ {
@ -260,6 +276,10 @@
"reflection", "reflection",
"static analysis" "static analysis"
], ],
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master"
},
"time": "2017-09-11T18:02:19+00:00" "time": "2017-09-11T18:02:19+00:00"
}, },
{ {
@ -312,6 +332,10 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x"
},
"time": "2019-12-28T18:55:12+00:00" "time": "2019-12-28T18:55:12+00:00"
}, },
{ {
@ -357,6 +381,10 @@
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
} }
], ],
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/master"
},
"time": "2017-12-30T13:23:38+00:00" "time": "2017-12-30T13:23:38+00:00"
}, },
{ {
@ -420,6 +448,10 @@
"spy", "spy",
"stub" "stub"
], ],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
},
"time": "2020-03-05T15:02:03+00:00" "time": "2020-03-05T15:02:03+00:00"
}, },
{ {
@ -483,6 +515,10 @@
"testing", "testing",
"xunit" "xunit"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/5.3"
},
"time": "2018-04-06T15:36:58+00:00" "time": "2018-04-06T15:36:58+00:00"
}, },
{ {
@ -530,6 +566,11 @@
"filesystem", "filesystem",
"iterator" "iterator"
], ],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5"
},
"time": "2017-11-27T13:52:08+00:00" "time": "2017-11-27T13:52:08+00:00"
}, },
{ {
@ -571,6 +612,10 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
"source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
},
"time": "2015-06-21T13:50:34+00:00" "time": "2015-06-21T13:50:34+00:00"
}, },
{ {
@ -620,6 +665,10 @@
"keywords": [ "keywords": [
"timer" "timer"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
"source": "https://github.com/sebastianbergmann/php-timer/tree/master"
},
"time": "2017-02-26T11:10:40+00:00" "time": "2017-02-26T11:10:40+00:00"
}, },
{ {
@ -669,6 +718,10 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
},
"abandoned": true, "abandoned": true,
"time": "2017-11-27T05:48:46+00:00" "time": "2017-11-27T05:48:46+00:00"
}, },
@ -754,6 +807,10 @@
"testing", "testing",
"xunit" "xunit"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/6.5.14"
},
"time": "2019-02-01T05:22:47+00:00" "time": "2019-02-01T05:22:47+00:00"
}, },
{ {
@ -813,6 +870,10 @@
"mock", "mock",
"xunit" "xunit"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
"source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/5.0.10"
},
"abandoned": true, "abandoned": true,
"time": "2018-08-09T05:50:03+00:00" "time": "2018-08-09T05:50:03+00:00"
}, },
@ -859,6 +920,10 @@
], ],
"description": "Looks up which function or method a line of code belongs to", "description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
"source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
@ -929,6 +994,10 @@
"compare", "compare",
"equality" "equality"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"source": "https://github.com/sebastianbergmann/comparator/tree/master"
},
"time": "2018-02-01T13:46:46+00:00" "time": "2018-02-01T13:46:46+00:00"
}, },
{ {
@ -981,6 +1050,10 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/master"
},
"time": "2017-08-03T08:09:46+00:00" "time": "2017-08-03T08:09:46+00:00"
}, },
{ {
@ -1031,6 +1104,10 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"source": "https://github.com/sebastianbergmann/environment/tree/master"
},
"time": "2017-07-01T08:51:00+00:00" "time": "2017-07-01T08:51:00+00:00"
}, },
{ {
@ -1098,6 +1175,10 @@
"export", "export",
"exporter" "exporter"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
@ -1155,6 +1236,10 @@
"keywords": [ "keywords": [
"global state" "global state"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0"
},
"time": "2017-04-27T15:39:26+00:00" "time": "2017-04-27T15:39:26+00:00"
}, },
{ {
@ -1202,6 +1287,10 @@
], ],
"description": "Traverses array structures and object graphs to enumerate all referenced objects", "description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/", "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
"source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
@ -1253,6 +1342,10 @@
], ],
"description": "Allows reflection of object attributes, including inherited and non-public ones", "description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/", "homepage": "https://github.com/sebastianbergmann/object-reflector/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
"source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
@ -1312,6 +1405,10 @@
], ],
"description": "Provides functionality to recursively process PHP variables", "description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1"
},
"funding": [ "funding": [
{ {
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
@ -1360,6 +1457,10 @@
], ],
"description": "Provides a list of PHP built-in functions that operate on resources", "description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations", "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"support": {
"issues": "https://github.com/sebastianbergmann/resource-operations/issues",
"source": "https://github.com/sebastianbergmann/resource-operations/tree/master"
},
"time": "2015-07-28T20:34:47+00:00" "time": "2015-07-28T20:34:47+00:00"
}, },
{ {
@ -1403,6 +1504,10 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
"source": "https://github.com/sebastianbergmann/version/tree/master"
},
"time": "2016-10-03T07:35:21+00:00" "time": "2016-10-03T07:35:21+00:00"
}, },
{ {
@ -1465,6 +1570,9 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@ -1519,6 +1627,10 @@
} }
], ],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
"source": "https://github.com/theseer/tokenizer/tree/master"
},
"time": "2019-06-13T22:48:21+00:00" "time": "2019-06-13T22:48:21+00:00"
}, },
{ {
@ -1568,6 +1680,10 @@
"check", "check",
"validate" "validate"
], ],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/1.9.1"
},
"time": "2020-07-08T17:02:28+00:00" "time": "2020-07-08T17:02:28+00:00"
} }
], ],
@ -1581,5 +1697,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.0" "php": "7.0"
}, },
"plugin-api-version": "1.1.0" "plugin-api-version": "2.0.0"
} }

View File

@ -9,16 +9,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "gettext/gettext", "name": "gettext/gettext",
"version": "v4.8.3", "version": "v4.8.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-gettext/Gettext.git", "url": "https://github.com/php-gettext/Gettext.git",
"reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321" "reference": "58bc0f7f37e78efb0f9758f93d4a0f669f0f84a1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-gettext/Gettext/zipball/57ff4fb16647e78e80a5909fe3c190f1c3110321", "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/58bc0f7f37e78efb0f9758f93d4a0f669f0f84a1",
"reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321", "reference": "58bc0f7f37e78efb0f9758f93d4a0f669f0f84a1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -67,7 +67,26 @@
"po", "po",
"translation" "translation"
], ],
"time": "2020-11-18T22:35:49+00:00" "support": {
"email": "oom@oscarotero.com",
"issues": "https://github.com/oscarotero/Gettext/issues",
"source": "https://github.com/php-gettext/Gettext/tree/v4.8.4"
},
"funding": [
{
"url": "https://paypal.me/oscarotero",
"type": "custom"
},
{
"url": "https://github.com/oscarotero",
"type": "github"
},
{
"url": "https://www.patreon.com/misteroom",
"type": "patreon"
}
],
"time": "2021-03-10T19:35:49+00:00"
}, },
{ {
"name": "gettext/languages", "name": "gettext/languages",
@ -128,6 +147,10 @@
"translations", "translations",
"unicode" "unicode"
], ],
"support": {
"issues": "https://github.com/php-gettext/Languages/issues",
"source": "https://github.com/php-gettext/Languages/tree/2.6.0"
},
"time": "2019-11-13T10:30:21+00:00" "time": "2019-11-13T10:30:21+00:00"
}, },
{ {
@ -173,6 +196,10 @@
} }
], ],
"description": "Peast is PHP library that generates AST for JavaScript code", "description": "Peast is PHP library that generates AST for JavaScript code",
"support": {
"issues": "https://github.com/mck89/peast/issues",
"source": "https://github.com/mck89/peast/tree/v1.12.0"
},
"time": "2021-01-08T15:16:19+00:00" "time": "2021-01-08T15:16:19+00:00"
}, },
{ {
@ -219,6 +246,10 @@
"mustache", "mustache",
"templating" "templating"
], ],
"support": {
"issues": "https://github.com/bobthecow/mustache.php/issues",
"source": "https://github.com/bobthecow/mustache.php/tree/master"
},
"time": "2019-11-23T21:40:31+00:00" "time": "2019-11-23T21:40:31+00:00"
}, },
{ {
@ -268,6 +299,10 @@
"iri", "iri",
"sockets" "sockets"
], ],
"support": {
"issues": "https://github.com/rmccue/Requests/issues",
"source": "https://github.com/rmccue/Requests/tree/master"
},
"time": "2016-10-13T00:11:37+00:00" "time": "2016-10-13T00:11:37+00:00"
}, },
{ {
@ -317,6 +352,9 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/3.3"
},
"time": "2017-06-01T21:01:25+00:00" "time": "2017-06-01T21:01:25+00:00"
}, },
{ {
@ -374,6 +412,10 @@
], ],
"description": "Provides internationalization tools for WordPress projects.", "description": "Provides internationalization tools for WordPress projects.",
"homepage": "https://github.com/wp-cli/i18n-command", "homepage": "https://github.com/wp-cli/i18n-command",
"support": {
"issues": "https://github.com/wp-cli/i18n-command/issues",
"source": "https://github.com/wp-cli/i18n-command/tree/v2.2.6"
},
"time": "2020-12-07T19:28:27+00:00" "time": "2020-12-07T19:28:27+00:00"
}, },
{ {
@ -422,6 +464,9 @@
], ],
"description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)",
"homepage": "https://github.com/mustangostang/spyc/", "homepage": "https://github.com/mustangostang/spyc/",
"support": {
"source": "https://github.com/wp-cli/spyc/tree/autoload"
},
"time": "2017-04-25T11:26:20+00:00" "time": "2017-04-25T11:26:20+00:00"
}, },
{ {
@ -472,6 +517,10 @@
"cli", "cli",
"console" "console"
], ],
"support": {
"issues": "https://github.com/wp-cli/php-cli-tools/issues",
"source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.12"
},
"time": "2021-03-03T12:43:49+00:00" "time": "2021-03-03T12:43:49+00:00"
}, },
{ {
@ -534,6 +583,11 @@
"cli", "cli",
"wordpress" "wordpress"
], ],
"support": {
"docs": "https://make.wordpress.org/cli/handbook/",
"issues": "https://github.com/wp-cli/wp-cli/issues",
"source": "https://github.com/wp-cli/wp-cli"
},
"time": "2020-02-18T08:15:37+00:00" "time": "2020-02-18T08:15:37+00:00"
} }
], ],
@ -547,5 +601,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.0" "php": "7.0"
}, },
"plugin-api-version": "1.1.0" "plugin-api-version": "2.0.0"
} }

View File

@ -1,7 +1,19 @@
== Changelog == == Changelog ==
= 5.2.0 RC 2 2021-04-06 =
**WooCommerce**
* Update - WooCommerce Admin package 2.1.5. #29577
**WooCommerce Admin - 2.1.5**
* Tweak - Set international country feature flag off
= 5.2.0 RC 2021-03-30 = = 5.2.0 RC 2021-03-30 =
**WooCommerce**
* Update - WooCommerce Admin package 2.1.4. #29520 * Update - WooCommerce Admin package 2.1.4. #29520
* Fix - Don't remove existing coupons from order when an invalid REST API request for updating coupons is submitted. #29474 * Fix - Don't remove existing coupons from order when an invalid REST API request for updating coupons is submitted. #29474
* Fix - Wrong logic for including or excluding the payments step in the list of completed tasks in the onboarding wizard. #29518 * Fix - Wrong logic for including or excluding the payments step in the list of completed tasks in the onboarding wizard. #29518

View File

@ -21,8 +21,8 @@
"pelago/emogrifier": "3.1.0", "pelago/emogrifier": "3.1.0",
"psr/container": "1.0.0", "psr/container": "1.0.0",
"woocommerce/action-scheduler": "3.1.6", "woocommerce/action-scheduler": "3.1.6",
"woocommerce/woocommerce-admin": "2.1.4", "woocommerce/woocommerce-admin": "2.1.5",
"woocommerce/woocommerce-blocks": "4.7.0" "woocommerce/woocommerce-blocks": "4.7.1"
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.4" "bamarni/composer-bin-plugin": "^1.4"

26
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b1d6d94c8cfae572ab27c288c6865787", "content-hash": "5005eed74baf10300e2895e9b6a4f344",
"packages": [ "packages": [
{ {
"name": "automattic/jetpack-autoloader", "name": "automattic/jetpack-autoloader",
@ -530,16 +530,16 @@
}, },
{ {
"name": "woocommerce/woocommerce-admin", "name": "woocommerce/woocommerce-admin",
"version": "2.1.4", "version": "2.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git", "url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "f992b8c8664e72b00ee7283ba1d34e74e4b67ab0" "reference": "71c233d8463f551430edbe1877e51d19a4bb2df6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/f992b8c8664e72b00ee7283ba1d34e74e4b67ab0", "url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/71c233d8463f551430edbe1877e51d19a4bb2df6",
"reference": "f992b8c8664e72b00ee7283ba1d34e74e4b67ab0", "reference": "71c233d8463f551430edbe1877e51d19a4bb2df6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -573,22 +573,22 @@
"homepage": "https://github.com/woocommerce/woocommerce-admin", "homepage": "https://github.com/woocommerce/woocommerce-admin",
"support": { "support": {
"issues": "https://github.com/woocommerce/woocommerce-admin/issues", "issues": "https://github.com/woocommerce/woocommerce-admin/issues",
"source": "https://github.com/woocommerce/woocommerce-admin/tree/v2.1.4" "source": "https://github.com/woocommerce/woocommerce-admin/tree/v2.1.5"
}, },
"time": "2021-03-29T11:59:33+00:00" "time": "2021-04-02T16:48:38+00:00"
}, },
{ {
"name": "woocommerce/woocommerce-blocks", "name": "woocommerce/woocommerce-blocks",
"version": "v4.7.0", "version": "v4.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git", "url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "bf9f70607e718c5f83785cad29b33746db0282d3" "reference": "841c49b8626f4eb717056a2d1e3eba6140f45e2c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/bf9f70607e718c5f83785cad29b33746db0282d3", "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/841c49b8626f4eb717056a2d1e3eba6140f45e2c",
"reference": "bf9f70607e718c5f83785cad29b33746db0282d3", "reference": "841c49b8626f4eb717056a2d1e3eba6140f45e2c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -624,9 +624,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues", "issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues",
"source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v4.7.0" "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v4.7.1"
}, },
"time": "2021-03-16T16:09:55+00:00" "time": "2021-04-02T11:18:50+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [

View File

@ -1218,15 +1218,30 @@ class WC_Cart extends WC_Legacy_Cart {
$products_qty_in_cart = $this->get_cart_item_quantities(); $products_qty_in_cart = $this->get_cart_item_quantities();
if ( isset( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] ) && ! $product_data->has_enough_stock( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] + $quantity ) ) { if ( isset( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] ) && ! $product_data->has_enough_stock( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ] + $quantity ) ) {
throw new Exception( $stock_quantity = $product_data->get_stock_quantity();
sprintf( $stock_quantity_in_cart = $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ];
'<a href="%s" class="button wc-forward">%s</a> %s',
wc_get_cart_url(), $message = sprintf(
__( 'View cart', 'woocommerce' ), '<a href="%s" class="button wc-forward">%s</a> %s',
/* translators: 1: quantity in stock 2: current quantity */ wc_get_cart_url(),
sprintf( __( 'You cannot add that amount to the cart &mdash; we have %1$s in stock and you already have %2$s in your cart.', 'woocommerce' ), wc_format_stock_quantity_for_display( $product_data->get_stock_quantity(), $product_data ), wc_format_stock_quantity_for_display( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ], $product_data ) ) __( 'View cart', 'woocommerce' ),
) /* translators: 1: quantity in stock 2: current quantity */
sprintf( __( 'You cannot add that amount to the cart &mdash; we have %1$s in stock and you already have %2$s in your cart.', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_quantity, $product_data ), wc_format_stock_quantity_for_display( $stock_quantity_in_cart, $product_data ) )
); );
/**
* Filters message about product not having enough stock accounting for what's already in the cart.
*
* @param string $message Message.
* @param WC_Product $product_data Product data.
* @param int $stock_quantity Quantity remaining.
* @param int $stock_quantity_in_cart
*
* @since 5.3.0
*/
$message = apply_filters( 'woocommerce_cart_product_not_enough_stock_already_in_cart_message', $message, $product_data, $stock_quantity, $stock_quantity_in_cart );
throw new Exception( $message );
} }
} }

View File

@ -139,7 +139,7 @@ class WC_Template_Loader {
if ( 0 === $validated_file ) { if ( 0 === $validated_file ) {
$templates[] = $page_template; $templates[] = $page_template;
} else { } else {
error_log( "WooCommerce: Unable to validate template path: \"$page_template\". Error Code: $validated_file." ); error_log( "WooCommerce: Unable to validate template path: \"$page_template\". Error Code: $validated_file." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
} }
} }
} }
@ -294,8 +294,8 @@ class WC_Template_Loader {
} }
// Description handling. // Description handling.
if ( ! empty( $queried_object->description ) && ( empty( $_GET['product-page'] ) || 1 === absint( $_GET['product-page'] ) ) ) { // WPCS: input var ok, CSRF ok. if ( ! empty( $queried_object->description ) && ( empty( $_GET['product-page'] ) || 1 === absint( $_GET['product-page'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$prefix = '<div class="term-description">' . wc_format_content( $queried_object->description ) . '</div>'; // WPCS: XSS ok. $prefix = '<div class="term-description">' . wc_format_content( wp_kses_post( $queried_object->description ) ) . '</div>';
} else { } else {
$prefix = ''; $prefix = '';
} }

View File

@ -887,7 +887,7 @@ function wc_terms_and_conditions_page_content() {
$page = get_post( $terms_page_id ); $page = get_post( $terms_page_id );
if ( $page && 'publish' === $page->post_status && $page->post_content && ! has_shortcode( $page->post_content, 'woocommerce_checkout' ) ) { if ( $page && 'publish' === $page->post_status && $page->post_content && ! has_shortcode( $page->post_content, 'woocommerce_checkout' ) ) {
echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . wp_kses_post( wc_format_content( $page->post_content ) ) . '</div>'; echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . wc_format_content( wp_kses_post( $page->post_content ) ) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
} }
@ -1240,8 +1240,7 @@ if ( ! function_exists( 'woocommerce_taxonomy_archive_description' ) ) {
$term = get_queried_object(); $term = get_queried_object();
if ( $term && ! empty( $term->description ) ) { if ( $term && ! empty( $term->description ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '<div class="term-description">' . wc_format_content( wp_kses_post( $term->description ) ) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<div class="term-description">' . wc_format_content( $term->description ) . '</div>';
} }
} }
} }
@ -1260,10 +1259,9 @@ if ( ! function_exists( 'woocommerce_product_archive_description' ) ) {
if ( is_post_type_archive( 'product' ) && in_array( absint( get_query_var( 'paged' ) ), array( 0, 1 ), true ) ) { if ( is_post_type_archive( 'product' ) && in_array( absint( get_query_var( 'paged' ) ), array( 0, 1 ), true ) ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) ); $shop_page = get_post( wc_get_page_id( 'shop' ) );
if ( $shop_page ) { if ( $shop_page ) {
$description = wc_format_content( $shop_page->post_content ); $description = wc_format_content( wp_kses_post( $shop_page->post_content ) );
if ( $description ) { if ( $description ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '<div class="page-description">' . $description . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<div class="page-description">' . $description . '</div>';
} }
} }
} }

View File

@ -160,8 +160,20 @@ WooCommerce comes with some sample data you can use to see how products look; im
== Changelog == == Changelog ==
= 5.2.0 RC 2 2021-04-06 =
**WooCommerce**
* Update - WooCommerce Admin package 2.1.5. #29577
**WooCommerce Admin - 2.1.5**
* Tweak - Set international country feature flag off
= 5.2.0 RC 2021-03-30 = = 5.2.0 RC 2021-03-30 =
**WooCommerce**
* Update - WooCommerce Admin package 2.1.4. #29520 * Update - WooCommerce Admin package 2.1.4. #29520
* Fix - Don't remove existing coupons from order when an invalid REST API request for updating coupons is submitted. #29474 * Fix - Don't remove existing coupons from order when an invalid REST API request for updating coupons is submitted. #29474
* Fix - Wrong logic for including or excluding the payments step in the list of completed tasks in the onboarding wizard. #29518 * Fix - Wrong logic for including or excluding the payments step in the list of completed tasks in the onboarding wizard. #29518

View File

@ -1,4 +1,4 @@
import { SimpleProduct } from '@woocommerce/api'; import { SimpleProduct, Coupon } from '@woocommerce/api';
import { import {
visitAdminPage, visitAdminPage,
switchUserToTest, switchUserToTest,
@ -56,12 +56,32 @@ async function deleteAllProducts() {
} }
} }
/**
* Use api package to delete coupons.
*
* @return {Promise} Promise resolving once coupons have been trashed.
*/
async function deleteAllCoupons() {
const repository = Coupon.restRepository( factories.api.withDefaultPermalinks );
let coupons;
coupons = await repository.list();
while ( coupons.length > 0 ) {
for (let c = 0; c < coupons.length; c++ ) {
await repository.delete( coupons[ c ].id );
}
coupons = await repository.list();
}
}
// Before every test suite run, delete all content created by the test. This ensures // Before every test suite run, delete all content created by the test. This ensures
// other posts/comments/etc. aren't dirtying tests and tests don't depend on // other posts/comments/etc. aren't dirtying tests and tests don't depend on
// each other's side-effects. // each other's side-effects.
beforeAll( async () => { beforeAll( async () => {
await trashExistingPosts(); await trashExistingPosts();
await deleteAllProducts(); await deleteAllProducts();
await deleteAllCoupons();
await clearLocalStorage(); await clearLocalStorage();
await setBrowserViewport( 'large' ); await setBrowserViewport( 'large' );
} ); } );

View File

@ -4,6 +4,7 @@
## Added ## Added
- Shopper Checkout Login Account
- Shopper My Account Create Account - Shopper My Account Create Account
## Fixed ## Fixed

View File

@ -77,6 +77,7 @@ The functions to access the core tests are:
- `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped) - `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped)
- `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product - `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product
- `runCheckoutCreateAccountTest` - Shopper can create an account during checkout - `runCheckoutCreateAccountTest` - Shopper can create an account during checkout
- `runCheckoutLoginAccountTest` - Shopper can login to an account during checkout
- `runMyAccountCreateAccountTest` - Shopper can create an account via my account page - `runMyAccountCreateAccountTest` - Shopper can create an account via my account page
### REST API ### REST API

View File

@ -20,6 +20,7 @@ const runMyAccountCreateAccountTest = require( './shopper/front-end-my-account-c
const runSingleProductPageTest = require( './shopper/front-end-single-product.test' ); const runSingleProductPageTest = require( './shopper/front-end-single-product.test' );
const runVariableProductUpdateTest = require( './shopper/front-end-variable-product-updates.test' ); const runVariableProductUpdateTest = require( './shopper/front-end-variable-product-updates.test' );
const runCheckoutCreateAccountTest = require( './shopper/front-end-checkout-create-account.test' ); const runCheckoutCreateAccountTest = require( './shopper/front-end-checkout-create-account.test' );
const runCheckoutLoginAccountTest = require( './shopper/front-end-checkout-login-account.test' );
// Merchant tests // Merchant tests
const runAddNewShippingZoneTest = require ( './merchant/wp-admin-settings-shipping-zones.test' ); const runAddNewShippingZoneTest = require ( './merchant/wp-admin-settings-shipping-zones.test' );
@ -66,6 +67,7 @@ const runShopperTests = () => {
runSingleProductPageTest(); runSingleProductPageTest();
runVariableProductUpdateTest(); runVariableProductUpdateTest();
runCheckoutCreateAccountTest(); runCheckoutCreateAccountTest();
runCheckoutLoginAccountTest();
}; };
const runMerchantTests = () => { const runMerchantTests = () => {
@ -138,5 +140,6 @@ module.exports = {
runAddShippingClassesTest, runAddShippingClassesTest,
runAnalyticsPageLoadsTest, runAnalyticsPageLoadsTest,
runCheckoutCreateAccountTest, runCheckoutCreateAccountTest,
runCheckoutLoginAccountTest,
runMyAccountCreateAccountTest runMyAccountCreateAccountTest
}; };

View File

@ -34,6 +34,7 @@ const runCartApplyCouponsTest = () => {
couponPercentage = await createCoupon('50', 'Percentage discount'); couponPercentage = await createCoupon('50', 'Percentage discount');
couponFixedProduct = await createCoupon('5', 'Fixed product discount'); couponFixedProduct = await createCoupon('5', 'Fixed product discount');
await merchant.logout(); await merchant.logout();
await shopper.emptyCart();
await shopper.goToShop(); await shopper.goToShop();
await shopper.addToCartFromShopPage('Simple product'); await shopper.addToCartFromShopPage('Simple product');
await uiUnblocked(); await uiUnblocked();

View File

@ -34,6 +34,7 @@ const runCheckoutApplyCouponsTest = () => {
couponPercentage = await createCoupon('50', 'Percentage discount'); couponPercentage = await createCoupon('50', 'Percentage discount');
couponFixedProduct = await createCoupon('5', 'Fixed product discount'); couponFixedProduct = await createCoupon('5', 'Fixed product discount');
await merchant.logout(); await merchant.logout();
await shopper.emptyCart();
await shopper.goToShop(); await shopper.goToShop();
await shopper.addToCartFromShopPage('Simple product'); await shopper.addToCartFromShopPage('Simple product');
await uiUnblocked(); await uiUnblocked();

View File

@ -28,10 +28,14 @@ const runCheckoutCreateAccountTest = () => {
beforeAll(async () => { beforeAll(async () => {
await merchant.login(); await merchant.login();
await createSimpleProduct(); await createSimpleProduct();
// Set checkbox for creating an account during checkout
await merchant.openSettings('account'); await merchant.openSettings('account');
await setCheckbox('#woocommerce_enable_signup_and_login_from_checkout'); await setCheckbox('#woocommerce_enable_signup_and_login_from_checkout');
await settingsPageSaveChanges(); await settingsPageSaveChanges();
await merchant.logout(); await merchant.logout();
// Add simple product to cart and proceed to checkout
await shopper.goToShop(); await shopper.goToShop();
await shopper.addToCartFromShopPage(simpleProductName); await shopper.addToCartFromShopPage(simpleProductName);
await uiUnblocked(); await uiUnblocked();

View File

@ -0,0 +1,74 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/expect-expect */
/**
* Internal dependencies
*/
const {
shopper,
merchant,
createSimpleProduct,
uiUnblocked,
setCheckbox,
settingsPageSaveChanges,
} = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const {
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require('config');
const simpleProductName = config.get('products.simple.name');
const runCheckoutLoginAccountTest = () => {
describe('Shopper Checkout Login Account', () => {
beforeAll(async () => {
await merchant.login();
await createSimpleProduct();
// Set checkbox for logging to account during checkout
await merchant.openSettings('account');
await setCheckbox('#woocommerce_enable_checkout_login_reminder');
await settingsPageSaveChanges();
await merchant.logout();
// Add simple product to cart and proceed to checkout
await shopper.goToShop();
await shopper.addToCartFromShopPage(simpleProductName);
await uiUnblocked();
await shopper.goToCheckout();
});
it('can login to an existing account during checkout', async () => {
// Click to login during checkout
await page.waitForSelector('.woocommerce-form-login-toggle');
await expect(page).toClick('.woocommerce-info > a.showlogin');
// Fill shopper's login credentials and proceed further
await page.type( '#username', config.get('users.customer.username') );
await page.type( '#password', config.get('users.customer.password') );
await Promise.all([
page.waitForNavigation({waitUntil: 'networkidle0'}),
page.click('button[name="login"]'),
]);
// Place an order
await shopper.placeOrder();
await expect(page).toMatchElement('h1.entry-title', {text: 'Order received'});
// Verify the email of a logged in user
await expect(page).toMatchElement('ul > li.email', {text: 'Email: john.doe@example.com'});
// Verify the user is logged in on my account page
await shopper.gotoMyAccount();
await expect(page.url()).toMatch('my-account/');
await expect(page).toMatchElement('h1', {text: 'My account'});
});
});
};
module.exports = runCheckoutLoginAccountTest;

View File

@ -0,0 +1,13 @@
{
"url": "SMOKE_TEST_URL",
"users": {
"admin": {
"username": "SMOKE_TEST_ADMIN_USER",
"password": "SMOKE_TEST_ADMIN_PASSWORD"
},
"customer": {
"username": "SMOKE_TEST_CUSTOMER_USER",
"password": "SMOKE_TEST_CUSTOMER_PASSWORD"
}
}
}

View File

@ -19,10 +19,30 @@ if ( fs.existsSync( localTestConfigFile ) ) {
); );
} }
/**
* Get test container configuration.
* @returns {any}
*/
const getTestConfig = () => { const getTestConfig = () => {
const rawTestConfig = fs.readFileSync( testConfigFile ); const rawTestConfig = fs.readFileSync( testConfigFile );
const config = require( 'config' );
const url = config.get( 'url' );
const users = config.get( 'users' );
// Support for environment variable overrides.
let testConfig = JSON.parse( rawTestConfig ); let testConfig = JSON.parse( rawTestConfig );
if ( url ) {
testConfig.url = url;
}
if ( users ) {
if ( users.admin ) {
testConfig.users.admin = users.admin;
}
if ( users.customer ) {
testConfig.users.customer = users.customer;
}
}
let testPort = testConfig.url.match( /[0-9]+/ ); let testPort = testConfig.url.match( /[0-9]+/ );
testConfig.baseUrl = testConfig.url.substr( 0, testConfig.url.length - 1 ); testConfig.baseUrl = testConfig.url.substr( 0, testConfig.url.length - 1 );
if ( Array.isArray( testPort ) ) { if ( Array.isArray( testPort ) ) {

View File

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

View File

@ -1,5 +1,7 @@
# Unreleased # Unreleased
- `emptyCart()` Shopper flow helper that empties the cart
# 0.1.4 # 0.1.4
## Fixed ## Fixed

View File

@ -78,7 +78,8 @@ describe( 'Cart page', () => {
| `productIsInCheckout` | `productTitle, quantity, total, cartSubtotal` | Verify product is in cart on checkout page | | `productIsInCheckout` | `productTitle, quantity, total, cartSubtotal` | Verify product is in cart on checkout page |
| `removeFromCart` | `productTitle` | Remove a product from the cart on the cart page | | `removeFromCart` | `productTitle` | Remove a product from the cart on the cart page |
| `setCartQuantity` | `productTitle, quantityValue` | Change the quantity of a product on the cart page | | `setCartQuantity` | `productTitle, quantityValue` | Change the quantity of a product on the cart page |
| `searchForProduct` | Searching for a product name and landing on its detail page | | `searchForProduct` | | Searching for a product name and landing on its detail page |
| `emptyCart` | | Removes any products and coupons that are in the cart |
### Page Utilities ### Page Utilities

View File

@ -24,6 +24,8 @@ const {
SHOP_PRODUCT_PAGE SHOP_PRODUCT_PAGE
} = require( './constants' ); } = require( './constants' );
const { uiUnblocked } = require( '../page-utils' );
const gotoMyAccount = async () => { const gotoMyAccount = async () => {
await page.goto( SHOP_MY_ACCOUNT_PAGE, { await page.goto( SHOP_MY_ACCOUNT_PAGE, {
waitUntil: 'networkidle0', waitUntil: 'networkidle0',
@ -127,6 +129,33 @@ const shopper = {
await removeButton.click(); await removeButton.click();
}, },
emptyCart: async () => {
await page.goto( SHOP_CART_PAGE, {
waitUntil: 'networkidle0',
} );
// Remove products if they exist
if ( await page.$( '.remove' ) !== null ) {
products = await page.$( '.remove' );
while ( products.length > 0 ) {
for (let p = 0; p < products.length; p++ ) {
await page.click( p );
await uiUnblocked();
}
products = await page.$( '.remove' );
}
}
// Remove coupons if they exist
if ( await page.$( '.woocommerce-remove-coupon' ) !== null ) {
await page.click( '.woocommerce-remove-coupon' );
await uiUnblocked();
}
await page.waitForSelector('.woocommerce-info');
await expect( page ).toMatchElement( '.woocommerce-info', { text: 'Your cart is currently empty.' } );
},
setCartQuantity: async ( productTitle, quantityValue ) => { setCartQuantity: async ( productTitle, quantityValue ) => {
const cartItemXPath = getCartItemExpression( productTitle ); const cartItemXPath = getCartItemExpression( productTitle );
const quantityInputXPath = cartItemXPath + '//' + getQtyInputExpression(); const quantityInputXPath = cartItemXPath + '//' + getQtyInputExpression();