Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
6
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/__init__.py
Executable file
6
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/__init__.py
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from gaia import *
|
||||
from imagecompare import GaiaImageCompareArguments
|
||||
75
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/gaia.py
Executable file
75
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/gaia.py
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
import time
|
||||
|
||||
|
||||
class GaiaArguments(object):
|
||||
name = 'Gaia Arguments'
|
||||
args = [
|
||||
[['--restart'],
|
||||
{'action': 'store_true',
|
||||
'dest': 'restart',
|
||||
'default': False,
|
||||
'help': 'restart target instance between tests',
|
||||
}],
|
||||
[['--locale'],
|
||||
{'default': "undefined",
|
||||
'help': 'locale for the device, This value overrides the value from testvars.json file',
|
||||
}],
|
||||
[['--capture'],
|
||||
{'dest': 'capture',
|
||||
'default': "off",
|
||||
'help': 'Enabling screen video capture for max 3 minutes, saves in /sdcard folder of the device, '
|
||||
'then pulls it to the specified directory '
|
||||
'always: always pull the video file '
|
||||
'whenfail: only pull when the test failed '
|
||||
'off: off',
|
||||
}],
|
||||
[['--capturefolder'],
|
||||
{'dest': 'capturefolder',
|
||||
'default': 'videocapture',
|
||||
'help': 'directory path to saved video captures, relative to the current location, '
|
||||
'Default folder is %(default)s',
|
||||
}],
|
||||
]
|
||||
|
||||
|
||||
class GaiaTestRunnerMixin(object):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
width = 80
|
||||
if not (self.testvars.get('acknowledged_risks') is True or os.environ.get('GAIATEST_ACKNOWLEDGED_RISKS')):
|
||||
url = 'http://gaiatest.readthedocs.org/en/latest/testrunner.html#risks'
|
||||
heading = 'Acknowledge risks'
|
||||
message = 'These tests are destructive and may remove data from the target Firefox OS instance as well ' \
|
||||
'as using services that may incur costs! Before you can run these tests you must follow the ' \
|
||||
'steps to indicate you have acknowledged the risks detailed at the following address:'
|
||||
print '\n' + '*' * 5 + ' %s ' % heading.upper() + '*' * (width - len(heading) - 7)
|
||||
print '\n'.join(textwrap.wrap(message, width))
|
||||
print url
|
||||
print '*' * width + '\n'
|
||||
sys.exit(1)
|
||||
if not (self.testvars.get('skip_warning') is True or os.environ.get('GAIATEST_SKIP_WARNING')):
|
||||
delay = 30
|
||||
heading = 'Warning'
|
||||
message = 'You are about to run destructive tests against a Firefox OS instance. These tests ' \
|
||||
'will restore the target to a clean state, meaning any personal data such as contacts, ' \
|
||||
'messages, photos, videos, music, etc. will be removed. This may include data on the ' \
|
||||
'microSD card. The tests may also attempt to initiate outgoing calls, or connect to ' \
|
||||
'services such as cellular data, wifi, gps, bluetooth, etc.'
|
||||
try:
|
||||
print '\n' + '*' * 5 + ' %s ' % heading.upper() + '*' * (width - len(heading) - 7)
|
||||
print '\n'.join(textwrap.wrap(message, width))
|
||||
print '*' * width + '\n'
|
||||
print 'To abort the test run hit Ctrl+C on your keyboard.'
|
||||
print 'The test run will continue in %d seconds.' % delay
|
||||
time.sleep(delay)
|
||||
except KeyboardInterrupt:
|
||||
print '\nTest run aborted by user.'
|
||||
sys.exit(1)
|
||||
print 'Continuing with test run...\n'
|
||||
33
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/imagecompare.py
Executable file
33
gaia/tests/python/gaia-ui-tests/gaiatest/mixins/imagecompare.py
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
class GaiaImageCompareArguments(object):
|
||||
name = 'Gaia Image Compare'
|
||||
args = [
|
||||
[['--store-reference-image'],
|
||||
{'action': 'store_true',
|
||||
'default': False,
|
||||
'help': 'Store the captured screenshots as reference images',
|
||||
}],
|
||||
[['--fuzz-factor'],
|
||||
{'type': int,
|
||||
'default': 15,
|
||||
'metavar': int,
|
||||
'help': 'fuzz value supplied to ImageMagick call, in percentage. Default value is %(default)s percent.',
|
||||
}],
|
||||
[['--reference-path'],
|
||||
{'default': 'reference_images',
|
||||
'help': 'Location of reference images, relative to the current location, Default folder is %(default)s',
|
||||
}],
|
||||
[['--screenshots-path'],
|
||||
{'default': 'screenshots',
|
||||
'help': 'Path of screenshot images, relative to the current location, Default folder is %(default)s',
|
||||
}]
|
||||
]
|
||||
|
||||
# verify_usage
|
||||
def verify_usage_handler(self, args):
|
||||
if not 0 <= args.fuzz_factor <= 100:
|
||||
raise ValueError('fuzz_factor must be between 0 and 100')
|
||||
Loading…
Reference in a new issue