Tests
Tests are the main resources within Litmus. A test includes data for which browsers or email clients were tested, information about the page or email which was tested, and the screenshots which were returned as the results.
For more detailed information about the data types returned, take a look at the data reference.
Show
GET /tests/#{id}.xml
Returns details of a single test.
Response:
Status: 200 OK
<test-set> <created-at type="datetime">2008-02-19T14:55:59Z</created-at> <id type="integer">11347</id> <public-sharing type="boolean">true</public-sharing> <updated-at type="datetime">2008-02-19T16:26:44Z</updated-at> <name>Litmus Insider, February 08 - Preview</name> <service>email</service> <public_path>http://salted.litmusapp.com/pub/c854ae2</public_path> <test-set-versions type="array"> <test-set-version> <version type="integer">1</version> <url_or_guid>abc123@emailtests.com</url_or_guid> <received>true</received> <results type="array"> <result> <error-at type="datetime" nil="true"></error-at> <finished-at type="datetime">2008-02-19T14:56:33Z</finished-at> <id type="integer">129127</id> <started-at type="datetime">2008-02-19T14:56:11Z</started-at> <state>complete</state> <testing_application> <name>Hotmail</name> <code>hotmail</code> <platform>Web Based</platform> </testing_application> <result-images type="array"> <result-image> <id type="integer">339686</id> <image_type>full_off</image_type> <full_image>s3.amazonaws.com/sitevista/8a9cc6ce-0be5-4756-9ef5-fp.png</full_image> <thumbnail_image>s3.amazonaws.com/sitevista/8a9cc6ce-0be5-4756-fp-thumb.png</thumbnail_image> </result-image> ... </result-images> </result> ... </results> </test-set-version> ... </test-set-versions> </test-set>
For more detailed examples of the data returned, see the data reference.
Create a web page test
POST /pages.xml
Creates a new web page test in your account.
This will create a new web page test, but bear in mind there are a few steps to the process of creating a test and displaying it to your user:
- Create the new test with the URL to the page you're testing, along with the browsers you wish to test it on. (POST to /pages.xml)
- Record the new test's ID. (Contained in response to previous POST)
- Continually poll Litmus on the test's progress. (GET to /tests/#{id}.xml)
- Once the test is complete, record the URLs to the result screenshots, and present these to your user. (GET to /tests/#{id}.xml)
Request:
<test_set> <applications>saf2</applications> <applications>ie7</applications> <applications>ie6</applications> <url>http://google.com</url> <save_defaults>false</save_defaults> </test_set>
Response:
Status: 201 Created Location: http://companyx.litmusapp.com/tests/11450.xml
<test_set> <created_at type="datetime">2008-04-21T16:47:34Z</created_at> <id type="integer">11450</id> <public_sharing type="boolean">false</public_sharing> <updated_at type="datetime">2008-04-21T16:47:43Z</updated_at> <name>Google</name> <service>page</service> <test_set_versions type="array"> <test_set_version> <version type="integer">1</version> <url_or_guid>http://google.com</url_or_guid> <received>true</received> <results type="array"> <result> <error_at type="datetime" nil="true"></error_at> <finished_at type="datetime" nil="true"></finished_at> <started_at type="datetime" nil="true"></started_at> <test_code>saf2</test_code> <state>pending</state> <testing_application> <code>saf2</code> <name>Safari 2.0</name> <platform>Mac OS</platform> </testing_application> <result_images type="array"> <result_image> <image_type>window</image_type> </result_image> <result_image> <image_type>full</image_type> </result_image> </result_images> </result> ... </results> </test_set_version> </test_set_versions> </test_set>
For more detailed examples of the data returned, see the data reference.
Create an email test
POST /emails.xml
Creates a new email test in your account.
This will create a new email test, but bear in mind there are a few steps to the process of creating an email test and displaying it to your user:
- Create the new email test, specifying the email clients you wish to test it on. (POST to /emails.xml)
- Record the new test's ID, and its GUID. (Contained in response to previous POST)
- Send the email that is to be tested, to the address specified in the GUID field. (Contained in response to previous POST)
- Poll Litmus on the test's progress. The
enabledfield will be set totruewhen the email has been received by our system. (GET to /tests/#{id}.xml) - Once the test is complete, record the URLs to the result screenshots, and present these to your user. (GET to /tests/#{id}.xml)
Request:
<test_set> <applications>hotmail</applications> <applications>gmail</applications> <applications>notes8</applications> <save_defaults>false</save_defaults> </test_set>
Response:
Status: 201 Created Location: http://companyx.litmusapp.com/tests/11450.xml
<test_set> <created_at type="datetime">2008-04-22T09:08:29Z</created_at> <id type="integer">11451</id> <public_sharing type="boolean">false</public_sharing> <updated_at type="datetime">2008-04-22T09:08:29Z</updated_at> <name>No subject</name> <service>email</service> <test_set_versions type="array"> <test_set_version> <version type="integer">1</version> <url_or_guid>8026348@emailtests.com</url_or_guid> <received>false</received> <nil_classes type="array"/> </test_set_version> </test_set_versions> </test_set>
For more detailed examples of the data returned, see the data reference.
Delete
DELETE /tests/#{id}.xml
Deletes a test from your account.
Response:
Status: 200 OK