Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
0.1.7
* Add pillow to required dependencies
* Fix pillow Image import
* Add print for 'device has no screenshots'
* Set maximum device run limit to 1000

0.1.6
* Timeout for download request
* Retry feature for screenshot download

0.1.5
* Ability to change the project config

0.1.4
* Add the facility to await (poll) a scheduled test run
* Workaround for the token expiry problem
* Download-on-finish function

0.1.3
* Support additional data zip upload
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Example:
{u'displayName': u'Test Run 1', u'logZipState': u'BLANK', u'screenshotZipState': u'BLANK', u'projectId': 12340, u'number': 1, u'successRatio': 0.814815, u'createTime': 1393595647000, u'executionRatio': 1.0, u'state': u'FINISHED', u'startedByDisplayName': u'John Doe', u'id': 10}
```

+Developing and testing
Developing and testing
----------------------

Set up sandbox
Expand All @@ -38,5 +38,10 @@ Set up sandbox

Build example

`python setup.py clean && python setup.py sdist && pip install -U dist/testdroid-0.1.2dev.tar.gz && bin/testdroid-api-client me`
`python setup.py clean && python setup.py sdist && pip install -U dist/testdroid-0.1.7.tar.gz`

Usage

`testdroid`


8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages
import sys, os

version = '0.1.6'
version = '0.1.7'

setup(name='testdroid',
version=version,
Expand All @@ -13,20 +13,20 @@
'Topic :: Software Development',
'Intended Audience :: Developers'], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='testdroid rest api client',
author='Henri Kivelä <henri.kivela@bitbar.com>, Sakari Rautiainen <sakari.rautiainen@bitbar.com>',
author='Henri Kivelä <henri.kivela@bitbar.com>, Sakari Rautiainen <sakari.rautiainen@bitbar.com>, Teppo Malinen <teppo.malinen@bitbar.com, Jarno Tuovinen <jarno.tuovinen@bitbar.com>',
author_email='info@bitbar.com',
url='http://www.testdroid.com',
license='Apache License v2.0',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=True,
install_requires=[
'requests'
'requests', 'pillow',
],

entry_points = {
'console_scripts': [
'testdroid = testdroid:main',
],
],
},
)
12 changes: 9 additions & 3 deletions testdroid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-

import os, sys, requests, json, logging, time, httplib, Image
import os, sys, requests, json, logging, time, httplib
from PIL import Image
from optparse import OptionParser
from urlparse import urljoin
from collections import namedtuple
from datetime import datetime

FORMAT = '%(message)s'
__version__ = '0.1.5'
__version__ = '0.1.7'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('testdroid')
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -448,7 +449,7 @@ def get_test_run(self, project_id, test_run_id):

""" Return device runs for a project
"""
def get_device_runs(self, project_id, test_run_id, limit=100):
def get_device_runs(self, project_id, test_run_id, limit=1000):
return self.get("me/projects/%s/runs/%s/device-runs?limit=%s" % (project_id, test_run_id, limit))

""" Downloads screenshots list for a device run
Expand Down Expand Up @@ -500,8 +501,10 @@ def download_test_screenshots(self, project_id, test_run_id):
if device_run['currentState']['status'] == "SUCCEEDED":
directory = "%s-%s/%d-%s/screenshots" % (test_run['id'], test_run['displayName'], device_run['id'], device_run['device']['displayName'])
screenshots = self.get_device_run_screenshots_list(project_id, test_run_id, device_run['id'])
no_screenshots = True

for screenshot in screenshots['data']:
no_screenshots = False
full_path = "%s/%s" % (directory, screenshot['originalName'])
if not os.path.exists(directory):
os.makedirs(directory)
Expand All @@ -523,6 +526,9 @@ def download_test_screenshots(self, project_id, test_run_id):
prog = DownloadProgressBar()
self.download(url, full_path, callback=lambda pos, total: prog.update(int(pos), int(total)))
print

if no_screenshots:
logger.info("Device %s has no screenshots - skipping" % device_run['device']['displayName'])
else:
logger.info("Device %s has failed or has not finished - skipping" % device_run['device']['displayName'])

Expand Down