Commit Graph

10 Commits

Author SHA1 Message Date
Tung Du e59c931a9b E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554)
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-11-16 08:52:51 +07:00
Niels Lange f10bb2da82 Critical flows: Merchant → Checkout → Can adjust T&S and Privacy Policy options (https://github.com/woocommerce/woocommerce-blocks/pull/6211)
* Add test to check if T&C and Privacy links are visible

* Fix filling wrong type of form error

With a virtual product we shouldn't need to fill the shipping details
We need to fill the billing instead

* Fix undefined 'termsCheckbox' bug

* Fix terms checkbox name

* Activate test case

* Replace static URL with dynamic one

* Convert external plugin into mock

* Fix JS linting issue

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2022-04-25 10:48:54 +02:00
Alex Florisca 5c396c4e26 Tidy up and organise e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/6206)
* rename some things

* Refactor e2e tests

* remove only from checkout test

* Typo in test

* Add --testPathIgnorePatterns performance back into package.json

* Niels feedback and fix a test

* Update import from utils
2022-04-11 11:52:33 +01:00
Thomas Roberts 10793e8e18 Try adding performance tests (https://github.com/woocommerce/woocommerce-blocks/pull/6119)
* Add performance script to measure load times of cart and checkout blocks

* Temp commit

* Temp commit

* Temp commit

* Remove specific test from performance e2e command

* Add performance reporter

* Add step to clean performance file before running tests

* Add test report constant & average and logPerformanceResult test utils

* Update uses of product name constant

* Add cart coupon performance test

* Check if report file is empty before parsing

* Limit performance tests to only ones in performance directory

* Round the averages and add a linebreak after each entry in the log

* Fix formatting of report and only output after all tests

* Log each loading metric as an individual data point

* Improve formatting

* Get load times in ms from profiler

* Revert changes to fixtures

* Remove trace.json from git

* Remove checkout test file (tests not implemented)

* Check performance log file exists before truncating it

* Fix checkout coupon test

* Remove console logs

* Revert to use virtual products after rename of constant

* Ignore performance tests when running regular e2e tests

* Feedback changes

* Tidy up

* Fix packag-log.json:

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-04-04 13:30:07 +01:00
Niels Lange 8943629a86 Shopper → Checkout → Can have different shipping and billing addresses (https://github.com/woocommerce/woocommerce-blocks/pull/5860)
* Shopper can have different shipping and billing addresses

* Shopper can have different shipping and billing addresses

* Shopper can have different shipping and billing addresses

* Correct billing field IDs

* Remove unused variable

* Remove unused timeout

* Remove unused commands

* Activate company field using setCheckbox

* Deactivate company field using unsetCheckbox

* Remove obsolete command

* Empty cart before and after each test

* Remove obsolete import

* Check billing and shipping company

* Remove manual code with unsetCheckbox

* Fill company if field exist

* Get checkbox ID from label

* Remove duplicate company field toFill method

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-03-31 13:10:50 +02:00
Saad Tarhi ba2308f729 Shopper → Checkout → Can see warnings when form is incomplete (https://github.com/woocommerce/woocommerce-blocks/pull/6116)
* Create "isLoggedIn" shopper function

This function checks if a shopper is logged in

* Add "Can see warnings when form is incomplete" test

* Optimize login check and logout process for the test

Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-03-25 18:34:17 +01:00
Alex Florisca fcadeaa2e1 E2E test improvements and consolidatng (https://github.com/woocommerce/woocommerce-blocks/pull/6013)
* Refactor e2e tests slightly for better efficiency

* Add "proceedToCheckout" shopper method & refactor code

* Use "beforeEach" in case we add more test cases

I've kept the "afterAll" function to reset any side effects at the end
of this file's tests

* Use "beforeEach" in "checkout-place-order-as-guest" file

* Use BASE_URL in shopper.block.goToBlockPage

Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-03-09 10:16:24 +00:00
Saad Tarhi 1e15672b7b Shopper → Checkout → Can place an order as guest (https://github.com/woocommerce/woocommerce-blocks/pull/6009)
* Add "goToCheckout" method in "shopper.block"

Instead of using "shopper.goToCheckoutBlock" method, it will much easier
to maintain the following structure "shopper.block.goToCheckout"

* Create a constant for billing details

* Create "fillBillingDetails" shopper method

* Add "placeOrder" method to "shopper"

* Enable "Cash on delivery" payment method for our test

* Update "@woocommerce/e2e-utils" package

Some new useful e2e utility functions weren't avaiable in the previous version

* Add E2E test for "Can place an order as guest"

* Fix mini-cart failing E2E tests

In case this fix woocommerce/woocommerce-blocks#6006 isn't merged yet, this commit can be used to pass all
E2E tests

Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-03-08 14:52:40 +01:00
Saad Tarhi dee5032d41 Shopper → Cart → Can proceed to checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5901)
* Shopper → Cart → Can proceed to checkout

* Refactor the code for E2E testing

Introduce some discussed solution to structure and optimize the code

* Resolve some conflicts with the trunk branch

* Remove method overriding and refactor code

We are trying to avoid overriding exiting E2E Woo's utility functions

Instead we can use our own "shopper.block"

* Use a consistent constant naming convention

Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-03-07 16:23:31 +01:00
Raluca Stan e01592e736 Add constants for C & C pages in our E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/5938)
* Add constants for C & C pages in our E2E tests

Inspired by WC E2E this will avoid going to admin to find out the links for these pages.

* Select C & C pages by using the main navigation links

* Fix function calls

* Revert back to using constants for C & C block pages' URLs

reverts 9587a0bd5efa5d97b484cd8d1bf927ff50f8e014 and bd7e2f996792d887756c0a0f4a10e6886574e77b
2022-02-25 10:44:16 +01:00