1

Background: I developed a system which allows one to upload articles and products to remote wordpress instances. This system connects via Basic Authentication and the WooCommerce REST-API over HTTPS.

From the description alone you can see many parts are involved. As of last week, we ran into multiple problems associated with authentication and https. Whenever we introduce a fix for one bug, another bug will be introduced a few days later.

Thus I believe we need to perform integration testing. Note that we already have unit tests which mocks out request libraries and verifies if an API call is invoked with the correct arguments.

I don't exactly know how I should go about setting up integration tests for my situation. Currently, I see two systems are required to test the syncing of contents from our server to a client.

Currently, I can only think of one testing strategy that involves setting up a framework that generates disposable wordpress instances for syncing? However, I don't think this is the best choice given how unreliable distributed systems can be.

Can you think of other approaches to testing my system?

1

Well an end to end test with selenium is technically an integration test. A Selenium test will test the system as a whole from the user's perspective.

Alternatively, you can perform actions on the UI and if you have database access, you can verify that the correct columns of the database are updated properly.

1

If I understand it correctly you are dealing with your own system and all other systems are wordpress instances with woocommerce extension, right?

Have you checked what the root cause of the issues was? Were those scenario's covered in the tests? Did you update the tests to better cover those scenario's? It might not always be doable, some scenario's can be tested much easier via the UI, provided that you have the infrastructure to test this.

I read that you have unit tests and that you have mocked some of the request libraries. What you could do is not mock those libraries, but use only production code of your platform and mock/stub wordpress and then either extend the integration tests, or create UI tests with Selenium. (probably depends on the issues that you ran into) However, this might not give the confidence in the tests that you need?

If you want to use a real wordpress instances to test, you could either generate an instance from scratch and dispose it after testing, or you could have one wordpress environment that you restore to the default state before each test. Either way, you probably need to use some database scripts to provide content/product data/users on the wordpress system that your tests depend on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.