Commit Graph

2733 Commits

Author SHA1 Message Date
Shiki a9bf6b71ac OrdersV2: Add test for line items meta_data
This currently fails because it's not implemented yet.
2020-10-13 22:32:32 +05:30
Shiki 871a9e0b8f Add line items meta_data schema test for Orders V2 and V3
This currently fails because the expected meta_data properties are only
available in V3.
2020-10-13 22:32:32 +05:30
Shiki c5fd3ed21c WC_Tests_API_Orders: Add test data for site-level attributes 2020-10-13 22:32:31 +05:30
Shiki 62f1705690 WC_Tests_API_Orders: Rearrange order variable for clarity 2020-10-13 22:32:31 +05:30
Shiki c16ec9bf54 WC_Tests_API_Orders: Rename first_meta_data to size_* 2020-10-13 22:32:31 +05:30
Shiki a0d9b49e43 Add unit test for an Order's line item meta data. 2020-10-13 22:32:31 +05:30
Rodrigo Primo 5f5e739d7a
Update e2e test documentation to fix invalid example
This commit just updates the e2e test documentation to use a test file that exists in the section on how to run individual tests
2020-10-10 10:33:41 -03:00
Ron Rennick 903b86677c add readme to core tests package 2020-10-09 10:31:45 -03:00
Ron Rennick 62acca06e1 don't run tests if testing host not ready 2020-10-09 05:14:57 -03:00
Ron Rennick 7f57906959 add test:e2e-debug command 2020-10-09 05:00:03 -03:00
Néstor Soriano c15488d840
Merge pull request #27830 from woocommerce/php8/fix-round-function-with-non-numeric-argument 2020-10-09 08:01:44 +02:00
Christopher Allford f9ef91adc1
Merge pull request #27836 from woocommerce/packages/api/add/repository-listing
@woocommerce/api: Added list() repository operation and classes for managing store settings
2020-10-08 13:20:12 -07:00
Christopher Allford 1d0cbc8187 Merge branch 'master' into packages/api/add/repository-listing 2020-10-08 11:48:22 -07:00
Ron Rennick 31001036c9
Merge branch 'master' into fix/25962 2020-10-08 15:30:25 -03:00
Néstor Soriano e4b78cedbf
Merge pull request #27748 from woocommerce/remove-leftovers-from-improved-filtering-by-attribute-for-variations
Remove leftovers from the reverted improved filtering mechanism for variations
2020-10-08 15:45:09 +02:00
Néstor Soriano ab529835fa
Merge pull request #27840 from woocommerce/php8/fix-required-parameters-after-optional
[PHP 8] Convert optional-before-required parameters into required parameters
2020-10-08 14:22:52 +02:00
Nestor Soriano ac0641d02a Fix a couple of incompatibilities with NumberUtils::round
- Passing a string that represents a number but has spaces (e.g. ' 1 ')
  now works as expected (the number is properly interpreted)
- Passing the boolean true now returns 1, not 0
- Passing an object throws an error, instead of returning 0
2020-10-08 13:13:53 +02:00
Nestor Soriano b71f876cba Reintroduce the dependency injection related code.
After the League's Container package has been reintroduced, all the
code that implements the dependency injection mechanism in woocommerce
can be brought back as well.
2020-10-08 09:28:05 +02:00
Néstor Soriano 3e6861189e
Merge pull request #27848 from woocommerce/php8/remove-useless-test-assertion
[PHP 8] Remove a useless test assertion that fails in PHP 8
2020-10-08 09:06:39 +02:00
Ron Rennick 3a980a1241 merge current master 2020-10-07 03:17:38 -03:00
Ron Rennick 84fdfb6769 merge master 2020-10-07 03:05:04 -03:00
Julia Amosova aac4db94b2
Merge pull request #27679 from woocommerce/packages/e2e/config-functions
add eslint & babel config functions to e2e-environment
2020-10-06 14:15:56 -04:00
Ron Rennick df60bfb054
Merge pull request #27276 from woocommerce/fix/docker-ssh
Fix e2e docker:ssh command to work in any repo
2020-10-05 09:51:56 -03:00
Ron Rennick 610e787a86 package lock maintenance 2020-10-05 09:31:48 -03:00
Ron Rennick 5139c73029 allow running named test files that don't match test spec pattern 2020-10-05 09:16:27 -03:00
Christopher Allford 3558a9a025 Fixed a bug caused by differences in the URL when creating signatures on the client and server 2020-10-02 16:34:07 -07:00
Christopher Allford 6b5ff6d494 Fixed a bug that would cause Axios errors to be consumed by interceptors 2020-10-02 15:37:09 -07:00
Christopher Allford b74adf215a Adjusted the error mechanism to better follow the standard practice of rejecting HTTP errors 2020-10-02 14:10:24 -07:00
Nestor Soriano ed33a607a7 Remove a useless test assertion that fails in PHP 8
The assertion is useless (the constant is already tested a few Lines
above), and it was failing in PHP 8 because 'auto' < 2 is evaluated
as false, while it's evaluated to true in PHP 7.
2020-10-02 15:27:26 +02:00
Nestor Soriano 7485b9165f Convert optional-before-required arguments to required.
In PHP 8 required parameters after optional parameters in
function/method signatures trigger a deprecation notice. These type
of parameters are pointless since a value needs to always be
provided for them anyway, so they are actually de-facto required.

This commit converts all these not-so-optional parameters into
truly required parameters by removing their default values.
2020-10-02 09:45:09 +02:00
Christopher Allford 54b876fc75 Adjusted the typing of the ModelRepository and related interfaces to better distinguish between parent & child models 2020-10-01 18:06:34 -07:00
Christopher Allford 8f5ff436a2 Added support for flat parents to simplify calls with them 2020-10-01 17:48:37 -07:00
Christopher Allford a01da2da93 Updated the lock files 2020-10-01 16:04:03 -07:00
Christopher Allford e6efbdde34 Merge branch 'master' into packages/api/add/repository-listing 2020-10-01 15:58:48 -07:00
Christopher Allford 8ee89eb85d Documentation fixes 2020-10-01 15:53:30 -07:00
Christopher Allford cfa20570c1 Added appropriate HTTP errors to REST repository methods 2020-10-01 15:37:58 -07:00
Christopher Allford f8574bed56 Added a utility service for updating settings 2020-10-01 15:23:46 -07:00
Christopher Allford f0ad6e4fc2 Added aliases to make repository types easier to read 2020-10-01 15:00:27 -07:00
Christopher Allford 787040db4c Adjusted the ModelRepository to make repository methods more type-safe 2020-10-01 14:31:55 -07:00
Christopher Allford f2dda16c40 Updated lock files 2020-10-01 14:28:14 -07:00
Ron Rennick c17b6b5ad0 Update expected industry count 2020-10-01 14:46:04 -03:00
Ron Rennick 4af90518da lock file maintenance 2020-10-01 14:21:40 -03:00
Ron Rennick 8910357437 add missing test stubs 2020-10-01 10:25:22 -03:00
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.

This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
Nestor Soriano b1e81d02da Fix code style/sniffer errors in a few files. 2020-10-01 11:08:51 +02:00
Christopher Allford f6cbab8d07 Added missing static helpers for fetching repositories 2020-09-30 13:16:46 -07:00
Christopher Allford fccf1fb66e Added settings and group repositories with some basic functionality 2020-09-30 13:11:31 -07:00
Ron Rennick be15429c30 restore ability to run individual tests 2020-09-30 17:05:02 -03:00
Ron Rennick 72219b2323 move merchant tests to package 2020-09-30 14:41:31 -03:00
Christopher Allford 4c2637c479 Added a `list` operation to the repository 2020-09-30 07:59:10 -07:00
Christopher Allford f571324a09 Added better type-safety when distinguishing between resources that are children and those that are not 2020-09-29 18:40:50 -07:00
Ron Rennick 76f591251a move front end tests to package 2020-09-29 17:00:34 -03:00
Ron Rennick 27e79f465f split activation, onboarding, setup tests into separate files 2020-09-29 16:16:43 -03:00
Christopher Allford 8c5548d06e Added @template JSDoc tag to API package for better IDE support 2020-09-29 12:00:09 -07:00
Ron Rennick 1abbe3f273 initial core test package files, move setup tests to package 2020-09-29 15:22:20 -03:00
Ron Rennick fd60f7052a Merge branch 'master' into fix/e2e-url-no-port 2020-09-28 16:15:22 -03:00
Christopher Allford ef93f22321 Moved the product model for consistency with other model types 2020-09-25 14:08:19 -07:00
Christopher Allford 789773c65c Fixed E2E test 2020-09-25 14:05:11 -07:00
Christopher Allford 44c7428358 Updated package lock files and fixed test error 2020-09-25 13:49:54 -07:00
Christopher Allford 760b0e4cdb Merge branch 'master' into packages/factories-to-api-refactor 2020-09-25 13:19:36 -07:00
Christopher Allford c09d91f6ce Finished adding appropriate documentation to the API package 2020-09-25 11:11:17 -07:00
Ron Rennick 6b7d67e587 update onboarding flow for 4.6 2020-09-25 12:06:45 -03:00
vedanshujain d51dd26816 Add unit tests. 2020-09-25 19:41:20 +05:30
Christopher Allford ca0ea88e52 Updated the JSDoc and type-safety of repositories to better document the implemented operations 2020-09-24 14:22:38 -07:00
Ron Rennick 2ab59149ad revert testing change to default.json 2020-09-24 12:27:35 -03:00
Julia Amosova dcd0c46ab5
Merge pull request #27714 from woocommerce/fix/headless-flag-e2e-dev-mode
Add missing headless flag for running e2e tests in dev mode + README updates
2020-09-23 17:05:45 -04:00
Ron Rennick bde41799af merge master 2020-09-23 17:20:43 -03:00
Ron Rennick a80dc37684 merge master 2020-09-23 16:26:17 -03:00
Ron Rennick 3fbdf46192 always remove the trailing slash from the base URL 2020-09-23 16:22:15 -03:00
Nestor Soriano a94ea7f51f Remove logic for storage of attribute terms for variations
A mechanism for improved filtering by attribute for variations was
introduced some time ago. This mechanism implied maintaining term
relationships for variations, where the terms were the attributes
that defined the variation.

The mechanism was reverted because it was complex and presented many
issues, but the code that created those term relationships was kept.
This pull request removes that code and the associated unit tests.
2020-09-22 16:31:06 +02:00
Christopher Allford a7175c5ad4 Adjusted create method signature to better replicate TypeScript behavior 2020-09-21 13:44:45 -07:00
Christopher Allford 1674c05b66 Fixed the package.json files array to exclude development content 2020-09-21 13:33:57 -07:00
Christopher Allford 5297b27c79 Moved the factories from the @woocommerce/api package into the @woocommerce/e2e-utils package 2020-09-21 13:14:26 -07:00
Christopher Allford b962c10cee Updated the readme for the API package 2020-09-21 12:32:44 -07:00
Christopher Allford fba5a46243 Integrated the API package into the utils package again to generate simple products 2020-09-21 11:22:43 -07:00
Christopher Allford 8e7ef263a2 Adjusted the package exports to be easier to consume 2020-09-21 11:21:35 -07:00
Julia Amosova 12d546b280 Add `PUPPETEER_SLOWMO` to global process.env to enable it. 2020-09-20 15:34:47 -04:00
Julia Amosova c78051c7a5 Place back `scrollIntoView` to OBW e2e test. 2020-09-18 19:15:53 -04:00
Julia Amosova ff8e5bbc8b Remove `scrollIntoView` from OBW e2e test as it is not needed. 2020-09-18 18:33:21 -04:00
Christopher Allford 27d8892b28 Merge branch 'master' into packages/factories-to-api-refactor 2020-09-18 14:45:39 -07:00
Christopher Allford bf70a3ea74 Updated lock files 2020-09-18 14:43:00 -07:00
Christopher Allford d22ed6547e Merge branch 'master' into package/e2e-environment/better-container-detection 2020-09-18 14:32:11 -07:00
Christopher Allford 866ab47dda Adjusted the exports for clarity of use 2020-09-18 14:26:00 -07:00
Julia Amosova 6a93c8dd68 Added note to README on how to use `PUPPETEER_SLOWMO` variable. 2020-09-18 16:53:48 -04:00
Christopher Allford b3b92e2d4d Separated the construction of factories & repositories from the models for simplicity 2020-09-18 13:53:10 -07:00
Julia Amosova 30c904db68 Added `headless` & `slowMo` flags back to Puppeteer config. 2020-09-18 16:39:45 -04:00
Julia Amosova 38f14747fa Update commands that need to be run to build e2e test env. 2020-09-18 16:05:36 -04:00
Julia Amosova 68c06683e7 Add note regarding re-initializing test container when `docker:down/up`. 2020-09-18 15:26:50 -04:00
Julia Amosova 24b987a409 Add link to `Test Variables` section when mentioning changing the port. 2020-09-18 15:22:25 -04:00
Julia Amosova 6a562f8dfa Correct type: from `MariaDV` to `MariaDB` throughout e2e README. 2020-09-18 15:17:59 -04:00
Julia Amosova 085d7d884f Add `Install NVM` section to README's Table of Contents. 2020-09-18 14:52:46 -04:00
Julia Amosova 2455a82f36 Add to README how to run tests using custom WP, PHP and MariaDV versions. 2020-09-18 14:48:26 -04:00
Julia Amosova d66e7ef3b3 Update README with more accurate details on how to run e2e tests. 2020-09-18 14:30:54 -04:00
Julia Amosova 98edbef9a9 Add missing headless flag for running e2e tests in dev mode. 2020-09-18 13:43:44 -04:00
Ron Rennick 9915a5b142 merge master 2020-09-18 12:53:28 -03:00
Rodrigo Primo 197e8d274c
Merge pull request #27616 from woocommerce/fix/26960
Paypal gateway: protect code against a fatal error if WooCommerce is unable to communicate with PayPal
2020-09-18 09:34:57 -03:00
vedanshujain 140dafb704 Add unit tests for when PayPal API will return error 2020-09-18 17:12:33 +05:30
Claudio Sanches 29b8b0d60d
Merge pull request #27701 from woocommerce/fix/rest-api-package-tag
Fixed usage of package tag in REST API and templates
2020-09-17 18:45:14 -03:00
Christopher Allford a9ee9806a4 Implemented the factory & repository for simple products 2020-09-17 13:31:39 -07:00
Claudio Sanches 7fae819928 Fixed package tag 2020-09-17 14:34:36 -03:00