Google Cloud Print Logo Certification Tool

The Logo Certification tool is a group of tests designed to aide in running Logo Certification tests that printers must pass in order to obtain Logo Certification. The tool is made up of a number of python files, and utilizes the python UnitTest module to actually execute the tests.

List of modules and their purpose

Test Suites

The tests are divided into suites the focus on specific areas. The areas tested are:

DEPENDENCIES

ChromeDriver

In order to execute the tests, ChromeDriver is required on the system used to execute the tests. ChromeDriver can be downloaded from:

https://sites.google.com/a/chromium.org/chromedriver/

Install ChromeDriver and ensure the binary is in the system path. Make sure you get at least version 2.17, which has a feature that allows access the Chrome Print Dialog. Earlier versions of ChromeDriver cannot access the print dialog.

ChromeDriver 2.17 requires Chrome version 43 or higher. Install at least version 43 on your system.

Selenium

Selenium is also required, as ChromeDriver has a dependency on Selenium. To install Selenium, use the commands:

sudo pip install selenium

or download Selenium from: http://docs.seleniumhq.org/download/

ZeroConf

The Python Zeroconf package is used to execute some of the mDNS tests. Install ZeroConf from the package located here:

Using PIP:

sudo pip install zeroconf

Or download from one of the following:

https://pypi.python.org/pypi/zeroconf
https://github.com/jstasiak/python-zeroconf

Gdata

The tool will also store test results into a Google Spreadsheet. If you want to use this functionality, you will need to install gdata. Install gdata from:

https://github.com/google/gdata-python-client

gdata also depends on ElementTree; however, most systems will have ElementTree installed already. To test if it's installed, from a Python shell try:

from xml.etree import ElementTree

Configuration

Before executing the Logo Certification Tool, a number of steps are required to get your test environment set up correctly.

  1. Test Account - Use a test account that uses Gmail, in order to properly authenticate against Google properties and also use OAuth2 credentials. Once you have obtained a test account, obtain OAuth2 credentials from the Google Developers Console. You'll also need a 2nd test account, without the OAuth2 credentials.

  1. Edit _config.py

The following sections should be edited:

The documents and emails must belong to the USER account you set up below. USER2 does not need those documents or mail messages.

Save the _config.py and then all of the prepatory work is completed. Now simply execute testcert.py:

Execution

./testcert.py

Note that the first time Chrome signs in, you may need to sign in manually, as ChromeDriver cannot access the fields in chrome://chrome-signin field. Watch the command line prompt for instructions. During the tests, sometimes you'll be prompted to accept printer registration, and other times to ignore or cancel registration requests. Pay attention to the testcert.py output as it will ask you to turn the printer on and off at various times during the test process.

If you need to remove some of the test suites, edit testcert.py, and comment out the the suite.addTest lines of the suites you don't want to run. The following suites require the printer to be registered:

The order that the tests run in is not deterministic, but the suites will run in the order they are placed in.

Once the test has run, results will be placed in a log file. Log files are created with a date-time stamp in the logname. All of the test results will be annotated with passed, skipped, blocked, or failed, and possibly some other debug information. And if TEST['SPREADSHEET'] = True, then the results will be placed in a spreadsheet for easy reading of the test results.

Known Issues

There are a number of conditions that might cause the automation to fail. Here are some known conditions that might cause failures:

1 If you have a large printer list, the automation may not find the printer, as it will only search for the printer under test on the first page.

2 If a page gets updated after chromedriver finds an element, it may error with the message: "stale element reference". There is no way to prevent this type of error, so just be aware it may occur from time to time.

3 When you finish running tests, if Chrome does not entirely close (like on OS X), then you may need to close Chrome completely before running the tests again.