From 02e08bccb2fa50d2ddba78cfe7090686c75d0c15 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Fri, 24 Dec 2021 12:50:04 -0300 Subject: [PATCH 1/5] Add missing entries to default.json --- .../config/default/default.json | 126 ++++++++++- .../tests/e2e/config/default.json.bk | 207 ++++++++++++++++++ 2 files changed, 330 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/tests/e2e/config/default.json.bk diff --git a/packages/js/e2e-environment/config/default/default.json b/packages/js/e2e-environment/config/default/default.json index e01ee4e9a27..5479953cbad 100644 --- a/packages/js/e2e-environment/config/default/default.json +++ b/packages/js/e2e-environment/config/default/default.json @@ -16,13 +16,122 @@ "name": "Simple product" }, "variable": { - "name": "Variable Product with Three Variations" - } + "name": "Variable Product with Three Variations", + "attributes": [ + { + "id": 0, + "name": "Colour", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Red", + "Green", + "Blue" + ], + "sortOrder": 0 + }, + { + "id": 0, + "name": "Size", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Small", + "Medium", + "Large" + ], + "sortOrder": 0 + }, + { + "id": 0, + "name": "Logo", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Woo", + "WordPress" + ], + "sortOrder": 0 + } + ] + }, + "variations": [ + { + "regularPrice": "19.99", + "attributes": [ + { + "name": "Size", + "option": "Large" + }, + { + "name": "Colour", + "option": "Red" + } + ] + }, + { + "regularPrice": "18.99", + "attributes": [ + { + "name": "Size", + "option": "Medium" + }, + { + "name": "Colour", + "option": "Green" + } + ] + }, + { + "regularPrice": "17.99", + "attributes": [ + { + "name": "Size", + "option": "Small" + }, + { + "name": "Colour", + "option": "Blue" + } + ] + } + ], + "grouped": { + "name": "Grouped Product with Three Children", + "groupedProducts": [ + { + "name": "Base Unit", + "regularPrice": "29.99" + }, + { + "name": "Add-on A", + "regularPrice": "11.95" + }, + { + "name": "Add-on B", + "regularPrice": "18.97" + } + ] + }, + "external": { + "name": "External product", + "regularPrice": "24.99", + "buttonText": "Buy now", + "externalUrl": "https://wordpress.org/plugins/woocommerce" + } + }, + "coupons": { + "percentage": { + "code": "20percent", + "discountType": "percent", + "amount": "20.00" + } }, "addresses": { "admin": { "store": { - "firstname": "John", + "email": "admin@woocommercecoree2etestsuite.com", + "firstname": "John", "lastname": "Doe", "company": "Automattic", "country": "United States (US)", @@ -61,6 +170,17 @@ } } }, + "orders": { + "basicPaidOrder": { + "paymentMethod": "cod", + "status": "processing", + "billing": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com" + } + } + }, "onboardingwizard": { "industry": "Test industry", "numberofproducts": "1 - 10", diff --git a/plugins/woocommerce/tests/e2e/config/default.json.bk b/plugins/woocommerce/tests/e2e/config/default.json.bk new file mode 100644 index 00000000000..e70b3c6c5d8 --- /dev/null +++ b/plugins/woocommerce/tests/e2e/config/default.json.bk @@ -0,0 +1,207 @@ +{ + "url": "http://localhost:8084/", + "users": { + "admin": { + "username": "admin", + "password": "password" + }, + "customer": { + "username": "customer", + "password": "password" + } + }, + "products": { + "simple": { + "name": "Simple product" + }, + "variable": { + "name": "Variable Product with Three Attributes", + "defaultAttributes": [ + { + "id": 0, + "name": "Size", + "option": "Medium" + }, + { + "id": 0, + "name": "Colour", + "option": "Blue" + } + ], + "attributes": [ + { + "id": 0, + "name": "Colour", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Red", + "Green", + "Blue" + ], + "sortOrder": 0 + }, + { + "id": 0, + "name": "Size", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Small", + "Medium", + "Large" + ], + "sortOrder": 0 + }, + { + "id": 0, + "name": "Logo", + "isVisibleOnProductPage": true, + "isForVariations": true, + "options": [ + "Woo", + "WordPress" + ], + "sortOrder": 0 + } + ] + }, + "variations": [ + { + "regularPrice": "19.99", + "attributes": [ + { + "name": "Size", + "option": "Large" + }, + { + "name": "Colour", + "option": "Red" + } + ] + }, + { + "regularPrice": "18.99", + "attributes": [ + { + "name": "Size", + "option": "Medium" + }, + { + "name": "Colour", + "option": "Green" + } + ] + }, + { + "regularPrice": "17.99", + "attributes": [ + { + "name": "Size", + "option": "Small" + }, + { + "name": "Colour", + "option": "Blue" + } + ] + } + ], + "grouped": { + "name": "Grouped Product with Three Children", + "groupedProducts": [ + { + "name": "Base Unit", + "regularPrice": "29.99" + }, + { + "name": "Add-on A", + "regularPrice": "11.95" + }, + { + "name": "Add-on B", + "regularPrice": "18.97" + } + ] + }, + "external": { + "name": "External product", + "regularPrice": "24.99", + "buttonText": "Buy now", + "externalUrl": "https://wordpress.org/plugins/woocommerce" + } + }, + "coupons": { + "percentage": { + "code": "20percent", + "discountType": "percent", + "amount": "20.00" + } + }, + "addresses": { + "admin": { + "store": { + "email": "admin@woocommercecoree2etestsuite.com", + "firstname": "John", + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "countryandstate": "United States (US) — California", + "city": "San Francisco", + "state": "CA", + "postcode": "94107" + } + }, + "customer": { + "billing": { + "firstname": "John", + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "city": "San Francisco", + "state": "CA", + "postcode": "94107", + "phone": "123456789", + "email": "john.doe@example.com" + }, + "shipping": { + "firstname": "John", + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "city": "San Francisco", + "state": "CA", + "postcode": "94107" + } + } + }, + "orders": { + "basicPaidOrder": { + "paymentMethod": "cod", + "status": "processing", + "billing": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com" + } + } + }, + "onboardingwizard": { + "industry": "Test industry", + "numberofproducts": "1 - 10", + "sellingelsewhere": "No" + }, + "settings": { + "shipping": { + "zonename": "United States", + "zoneregions": "United States (US)", + "shippingmethod": "Free shipping" + } + } +} From 2d233bc003891441173347fc4f6957ed8698bd61 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Fri, 24 Dec 2021 13:04:54 -0300 Subject: [PATCH 2/5] Delete bk file --- .../tests/e2e/config/default.json.bk | 207 ------------------ 1 file changed, 207 deletions(-) delete mode 100644 plugins/woocommerce/tests/e2e/config/default.json.bk diff --git a/plugins/woocommerce/tests/e2e/config/default.json.bk b/plugins/woocommerce/tests/e2e/config/default.json.bk deleted file mode 100644 index e70b3c6c5d8..00000000000 --- a/plugins/woocommerce/tests/e2e/config/default.json.bk +++ /dev/null @@ -1,207 +0,0 @@ -{ - "url": "http://localhost:8084/", - "users": { - "admin": { - "username": "admin", - "password": "password" - }, - "customer": { - "username": "customer", - "password": "password" - } - }, - "products": { - "simple": { - "name": "Simple product" - }, - "variable": { - "name": "Variable Product with Three Attributes", - "defaultAttributes": [ - { - "id": 0, - "name": "Size", - "option": "Medium" - }, - { - "id": 0, - "name": "Colour", - "option": "Blue" - } - ], - "attributes": [ - { - "id": 0, - "name": "Colour", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Red", - "Green", - "Blue" - ], - "sortOrder": 0 - }, - { - "id": 0, - "name": "Size", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Small", - "Medium", - "Large" - ], - "sortOrder": 0 - }, - { - "id": 0, - "name": "Logo", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Woo", - "WordPress" - ], - "sortOrder": 0 - } - ] - }, - "variations": [ - { - "regularPrice": "19.99", - "attributes": [ - { - "name": "Size", - "option": "Large" - }, - { - "name": "Colour", - "option": "Red" - } - ] - }, - { - "regularPrice": "18.99", - "attributes": [ - { - "name": "Size", - "option": "Medium" - }, - { - "name": "Colour", - "option": "Green" - } - ] - }, - { - "regularPrice": "17.99", - "attributes": [ - { - "name": "Size", - "option": "Small" - }, - { - "name": "Colour", - "option": "Blue" - } - ] - } - ], - "grouped": { - "name": "Grouped Product with Three Children", - "groupedProducts": [ - { - "name": "Base Unit", - "regularPrice": "29.99" - }, - { - "name": "Add-on A", - "regularPrice": "11.95" - }, - { - "name": "Add-on B", - "regularPrice": "18.97" - } - ] - }, - "external": { - "name": "External product", - "regularPrice": "24.99", - "buttonText": "Buy now", - "externalUrl": "https://wordpress.org/plugins/woocommerce" - } - }, - "coupons": { - "percentage": { - "code": "20percent", - "discountType": "percent", - "amount": "20.00" - } - }, - "addresses": { - "admin": { - "store": { - "email": "admin@woocommercecoree2etestsuite.com", - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "countryandstate": "United States (US) — California", - "city": "San Francisco", - "state": "CA", - "postcode": "94107" - } - }, - "customer": { - "billing": { - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "San Francisco", - "state": "CA", - "postcode": "94107", - "phone": "123456789", - "email": "john.doe@example.com" - }, - "shipping": { - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "San Francisco", - "state": "CA", - "postcode": "94107" - } - } - }, - "orders": { - "basicPaidOrder": { - "paymentMethod": "cod", - "status": "processing", - "billing": { - "firstName": "John", - "lastName": "Doe", - "email": "john.doe@example.com" - } - } - }, - "onboardingwizard": { - "industry": "Test industry", - "numberofproducts": "1 - 10", - "sellingelsewhere": "No" - }, - "settings": { - "shipping": { - "zonename": "United States", - "zoneregions": "United States (US)", - "shippingmethod": "Free shipping" - } - } -} From 0f29032a93433a824fc1e269fc8dddf15913adbb Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Mon, 27 Dec 2021 08:40:07 -0300 Subject: [PATCH 3/5] Add "defaultAttributes" JSON key --- .../config/default/default.json | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/js/e2e-environment/config/default/default.json b/packages/js/e2e-environment/config/default/default.json index 5479953cbad..a91a71ec789 100644 --- a/packages/js/e2e-environment/config/default/default.json +++ b/packages/js/e2e-environment/config/default/default.json @@ -13,10 +13,22 @@ }, "products": { "simple": { - "name": "Simple product" - }, - "variable": { - "name": "Variable Product with Three Variations", + "name": "Simple product" + }, + "variable": { + "name": "Variable Product with Three Attributes", + "defaultAttributes": [ + { + "id": 0, + "name": "Size", + "option": "Medium" + }, + { + "id": 0, + "name": "Colour", + "option": "Blue" + } + ], "attributes": [ { "id": 0, From 65d622558fd1a088104b84b75ce676d54a8b5fd7 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Mon, 27 Dec 2021 11:30:40 -0300 Subject: [PATCH 4/5] Add changelog --- packages/js/e2e-environment/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/js/e2e-environment/CHANGELOG.md b/packages/js/e2e-environment/CHANGELOG.md index f3aabfc7a84..a73b7838292 100644 --- a/packages/js/e2e-environment/CHANGELOG.md +++ b/packages/js/e2e-environment/CHANGELOG.md @@ -4,6 +4,7 @@ - Added `post-results-to-github-pr.js` to post smoke test results to a GitHub PR. - Added jest flags to generate a json test report +- Added more entries to `default.json` ## Added From e89b8829bb5e4c91be4661f66bf30c2c2b887735 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Mon, 27 Dec 2021 16:27:08 -0300 Subject: [PATCH 5/5] Normalized 4 spaces as tabs --- .../config/default/default.json | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/packages/js/e2e-environment/config/default/default.json b/packages/js/e2e-environment/config/default/default.json index a91a71ec789..cf613320940 100644 --- a/packages/js/e2e-environment/config/default/default.json +++ b/packages/js/e2e-environment/config/default/default.json @@ -2,17 +2,17 @@ "url": "http://localhost:8084/", "appName": "woocommerce_e2e", "users": { - "admin": { - "username": "admin", - "password": "password" - }, - "customer": { - "username": "customer", - "password": "password" - } + "admin": { + "username": "admin", + "password": "password" + }, + "customer": { + "username": "customer", + "password": "password" + } }, "products": { - "simple": { + "simple": { "name": "Simple product" }, "variable": { @@ -66,7 +66,7 @@ "sortOrder": 0 } ] - }, + }, "variations": [ { "regularPrice": "19.99", @@ -140,47 +140,47 @@ } }, "addresses": { - "admin": { - "store": { + "admin": { + "store": { "email": "admin@woocommercecoree2etestsuite.com", "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "countryandstate": "United States (US) — California", - "city": "San Francisco", - "state": "CA", - "postcode": "94107" - } - }, - "customer": { - "billing": { - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "San Francisco", - "state": "CA", - "postcode": "94107", - "phone": "123456789", - "email": "john.doe@example.com" - }, - "shipping": { - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "San Francisco", - "state": "CA", - "postcode": "94107" - } - } + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "countryandstate": "United States (US) — California", + "city": "San Francisco", + "state": "CA", + "postcode": "94107" + } + }, + "customer": { + "billing": { + "firstname": "John", + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "city": "San Francisco", + "state": "CA", + "postcode": "94107", + "phone": "123456789", + "email": "john.doe@example.com" + }, + "shipping": { + "firstname": "John", + "lastname": "Doe", + "company": "Automattic", + "country": "United States (US)", + "addressfirstline": "addr 1", + "addresssecondline": "addr 2", + "city": "San Francisco", + "state": "CA", + "postcode": "94107" + } + } }, "orders": { "basicPaidOrder": { @@ -194,15 +194,15 @@ } }, "onboardingwizard": { - "industry": "Test industry", - "numberofproducts": "1 - 10", - "sellingelsewhere": "No" + "industry": "Test industry", + "numberofproducts": "1 - 10", + "sellingelsewhere": "No" }, "settings": { - "shipping": { - "zonename": "United States", - "zoneregions": "United States (US)", - "shippingmethod": "Free shipping" - } + "shipping": { + "zonename": "United States", + "zoneregions": "United States (US)", + "shippingmethod": "Free shipping" + } } }