Skip to content

Running the Test Suite

Dickson Law edited this page Apr 4, 2021 · 3 revisions

Running the Test Suite

The source code in the repository contains the test suites for Request Master and all of its dependencies (including the optional JSON Struct).

In the Room Creation Code of the only room in the project, you will see 2 lines:

reqm_test_all();
reqm_test_requests();

The first line contains tests for the encoding and decoding functions, which can be run anywhere.

The second line contains live request tests conducted by objRequestMaster_test. You must either comment out this line, or run the tests from a device that can access https://request-master-test-target.herokuapp.com/echo_request.php.

Setting up the request target (optional)

The project contains an Included File named echo_request.php, which can be served from a server environment running PHP 7.x or higher.

In a local setup, you may use XAMPP on Windows, or MAMP on Mac OS X, or an equivalent stack using Docker or Vagrant.

Once you have set up the request target, visit it using the browser on the device you are testing with (which is not necessarily the system you are running the server on) and make sure it gives this exact response, with nothing else coming before or after it:

{"GET":[],"POST":[],"FILES":[]}

After confirming your setup, go to objRequestMaster_test's User Event 14 and input your URL between the marked comments, like this:

/* START CUSTOM URL SETUP HERE */
url = "http://localhost:8080/tests/echo_request.php";
/* END CUSTOM URL SETUP HERE */

Then you can run the project with F5 (normal) or F6 (debug). The screen will turn yellow after the encoding/decoding tests pass, then green after the request tests pass. There should not be any popup windows or sudden shutdowns.

For contributors: If you are contributing new content back to the repository, make sure to restore User Event 14 back to the way it was before committing your changes.