From 0d6e1f17a1d3ac36fb765c9c3d7a7664996c0bd3 Mon Sep 17 00:00:00 2001 From: selurvedu Date: Sun, 11 Sep 2016 22:39:06 +0000 Subject: [PATCH 01/12] Convert README.md to README.rst Converted by Pandoc. --- README.md | 9 --------- README.rst | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) delete mode 100644 README.md create mode 100644 README.rst diff --git a/README.md b/README.md deleted file mode 100644 index c5b73cb42..000000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# robot_tests - -## User acceptance tests for [OpenProcurement](https://github.com/openprocurement) - -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/openprocurement/robot_tests?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -This repository contains tests which are aimed to verify performance of the central database and the brokers. - -Please visit the [Wiki](https://github.com/openprocurement/robot_tests/wiki) for more information. diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..ad2bb539c --- /dev/null +++ b/README.rst @@ -0,0 +1,17 @@ +robot_tests +=========== + +User acceptance tests for `OpenProcurement `__ +---------------------------------------------------------------------------------- + +|Gitter| + +This repository contains tests which are aimed to verify performance of +the central database and the brokers. + +Please visit the +`Wiki `__ for more +information. + +.. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg + :target: https://gitter.im/openprocurement/robot_tests From f90aae06f64604f20634868b53d787a72b3bc8eb Mon Sep 17 00:00:00 2001 From: zhurba-alina Date: Fri, 2 Sep 2016 15:48:27 +0300 Subject: [PATCH 02/12] Update etender data in brokers/users.yaml (broker name) --- op_robot_tests/tests_files/data/brokers.yaml | 10 +++++----- op_robot_tests/tests_files/data/users.yaml | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/op_robot_tests/tests_files/data/brokers.yaml b/op_robot_tests/tests_files/data/brokers.yaml index d4fb994d5..10694c44c 100644 --- a/op_robot_tests/tests_files/data/brokers.yaml +++ b/op_robot_tests/tests_files/data/brokers.yaml @@ -63,16 +63,16 @@ Quinta: tender_owner: Tender_Owner viewer: Tender_Viewer timeout_on_wait: 15 -E-tender: +Etender: intervals: default: enquiry: [0, 5] keywords_file: etender roles: - provider: E-tender_Provider1 - provider1: E-tender_Provider2 - tender_owner: E-tender_Owner - viewer: E-tender_Viewer + provider: Etender_Provider1 + provider1: Etender_Provider2 + tender_owner: Etender_Owner + viewer: Etender_Viewer timeout_on_wait: 600 DZO: intervals: diff --git a/op_robot_tests/tests_files/data/users.yaml b/op_robot_tests/tests_files/data/users.yaml index 5d07d89d6..70e4cf63f 100644 --- a/op_robot_tests/tests_files/data/users.yaml +++ b/op_robot_tests/tests_files/data/users.yaml @@ -15,32 +15,32 @@ users: api_key: "" broker: Quinta browser: firefox - E-tender_Owner: - broker: E-tender + Etender_Owner: + broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" login: Misha2 password: Password1 browser: chrome position: [0, 0] size: [800, 800] - E-tender_Provider1: - broker: E-tender + Etender_Provider1: + broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" login: st_org password: 12345678 browser: chrome position: [700, 0] size: [700, 800] - E-tender_Provider2: - broker: E-tender + Etender_Provider2: + broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" login: provider2 password: Qa123456 browser: chrome position: [700, 0] size: [640, 450] - E-tender_Viewer: - broker: E-tender + Etender_Viewer: + broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" browser: chrome position: [0, 0] From fc9569aa11688eb9871dd56248d378fba22785c9 Mon Sep 17 00:00:00 2001 From: zhurba-alina Date: Fri, 2 Sep 2016 16:58:06 +0300 Subject: [PATCH 03/12] Update etender data in users.yaml (browser size) --- op_robot_tests/tests_files/data/users.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/op_robot_tests/tests_files/data/users.yaml b/op_robot_tests/tests_files/data/users.yaml index 70e4cf63f..e276b506d 100644 --- a/op_robot_tests/tests_files/data/users.yaml +++ b/op_robot_tests/tests_files/data/users.yaml @@ -22,29 +22,29 @@ users: password: Password1 browser: chrome position: [0, 0] - size: [800, 800] + size: [1366, 800] Etender_Provider1: broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" login: st_org password: 12345678 browser: chrome - position: [700, 0] - size: [700, 800] + position: [0, 0] + size: [1366, 800] Etender_Provider2: broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" login: provider2 password: Qa123456 browser: chrome - position: [700, 0] - size: [640, 450] + position: [0, 0] + size: [1366, 800] Etender_Viewer: broker: Etender homepage: "http://bid.uat.e-tender.biz/#/" browser: chrome position: [0, 0] - size: [640, 450] + size: [1366, 800] DZO_Owner: broker: DZO homepage: "http://dz2.byustudio.in.ua" From ea0a3cc6083e0ae6342aac098c7455b22e646757 Mon Sep 17 00:00:00 2001 From: selurvedu Date: Mon, 17 Oct 2016 15:34:43 +0000 Subject: [PATCH 04/12] Stick to Selenium 2.x --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 3e9e74d9c..b02601c1e 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ 'robotframework-selenium2library', 'robotframework-debuglibrary', 'robotframework-selenium2screenshots', + 'selenium < 3.0.dev0', 'Pillow', 'iso8601', 'PyYAML', From 52d7b45588f21c3298f49ac7faf21c3f3e0fd04e Mon Sep 17 00:00:00 2001 From: selurvedu Date: Mon, 18 Jul 2016 19:17:45 +0000 Subject: [PATCH 05/12] Update ez_setup.py to the latest upstream revision Source: Repo: git://github.com/pypa/setuptools.git Branch: bootstrap Commit: 0c3bf692236350f5c2c2cab5b235e9b6d3518fcb Notice: Line 39 remained unchanged, so the default version of setuptools is still `18.3.2` instead of `LATEST`. --- ez_setup.py | 89 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index a07dd4d5b..a8fae0398 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -3,6 +3,8 @@ """ Setuptools bootstrapping installer. +Maintained at https://github.com/pypa/setuptools/tree/bootstrap. + Run this script to install or upgrade setuptools. """ @@ -16,24 +18,30 @@ import platform import textwrap import contextlib -import warnings +import json +import codecs from distutils import log try: from urllib.request import urlopen + from urllib.parse import urljoin except ImportError: from urllib2 import urlopen + from urlparse import urljoin try: from site import USER_SITE except ImportError: USER_SITE = None +LATEST = object() DEFAULT_VERSION = "18.3.2" -DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" +DEFAULT_URL = "https://pypi.io/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir +MEANINGFUL_INVALID_ZIP_ERR_MSG = 'Maybe {0} is corrupted, delete it and try again.' + def _python_cmd(*args): """ @@ -98,8 +106,16 @@ def archive_context(filename): old_wd = os.getcwd() try: os.chdir(tmpdir) - with ContextualZipFile(filename) as archive: - archive.extractall() + try: + with ContextualZipFile(filename) as archive: + archive.extractall() + except zipfile.BadZipfile as err: + if not err.args: + err.args = ('', ) + err.args = err.args + ( + MEANINGFUL_INVALID_ZIP_ERR_MSG.format(filename), + ) + raise # going in the directory subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) @@ -114,18 +130,19 @@ def archive_context(filename): def _do_download(version, download_base, to_dir, download_delay): """Download Setuptools.""" - egg = os.path.join(to_dir, 'setuptools-%s-py%d.%d.egg' - % (version, sys.version_info[0], sys.version_info[1])) + py_desig = 'py{sys.version_info[0]}.{sys.version_info[1]}'.format(sys=sys) + tp = 'setuptools-{version}-{py_desig}.egg' + egg = os.path.join(to_dir, tp.format(**locals())) if not os.path.exists(egg): archive = download_setuptools(version, download_base, - to_dir, download_delay) + to_dir, download_delay) _build_egg(egg, archive, to_dir) sys.path.insert(0, egg) # Remove previously-imported pkg_resources if present (see # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). if 'pkg_resources' in sys.modules: - del sys.modules['pkg_resources'] + _unload_pkg_resources() import setuptools setuptools.bootstrap_install_from = egg @@ -140,6 +157,7 @@ def use_setuptools( Return None. Raise SystemExit if the requested version or later cannot be installed. """ + version = _resolve_version(version) to_dir = os.path.abspath(to_dir) # prior to importing, capture the module state for @@ -189,6 +207,11 @@ def _conflict_bail(VC_err, version): def _unload_pkg_resources(): + sys.meta_path = [ + importer + for importer in sys.meta_path + if importer.__class__.__module__ != 'pkg_resources.extern' + ] del_modules = [ name for name in sys.modules if name.startswith('pkg_resources') @@ -222,8 +245,8 @@ def download_file_powershell(url, target): ps_cmd = ( "[System.Net.WebRequest]::DefaultWebProxy.Credentials = " "[System.Net.CredentialCache]::DefaultCredentials; " - "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" - % vars() + '(new-object System.Net.WebClient).DownloadFile("%(url)s", "%(target)s")' + % locals() ) cmd = [ 'powershell', @@ -248,7 +271,7 @@ def has_powershell(): def download_file_curl(url, target): - cmd = ['curl', url, '--silent', '--output', target] + cmd = ['curl', url, '--location', '--silent', '--output', target] _clean_check(cmd, target) @@ -321,6 +344,7 @@ def download_setuptools( ``downloader_factory`` should be a function taking no arguments and returning a function for downloading a URL to a target. """ + version = _resolve_version(version) # making sure we use the absolute path to_dir = os.path.abspath(to_dir) zip_name = "setuptools-%s.zip" % version @@ -333,6 +357,27 @@ def download_setuptools( return os.path.realpath(saveto) +def _resolve_version(version): + """ + Resolve LATEST version + """ + if version is not LATEST: + return version + + meta_url = urljoin(DEFAULT_URL, '/pypi/setuptools/json') + resp = urlopen(meta_url) + with contextlib.closing(resp): + try: + charset = resp.info().get_content_charset() + except Exception: + # Python 2 compat; assume UTF-8 + charset = 'UTF-8' + reader = codecs.getreader(charset) + doc = json.load(reader(resp)) + + return str(doc['info']['version']) + + def _build_install_args(options): """ Build the arguments to 'python setup.py install' on the setuptools package. @@ -347,7 +392,7 @@ def _parse_args(): parser = optparse.OptionParser() parser.add_option( '--user', dest='user_install', action='store_true', default=False, - help='install in user site package (requires Python 2.6 or later)') + help='install in user site package') parser.add_option( '--download-base', dest='download_base', metavar="URL", default=DEFAULT_URL, @@ -362,9 +407,9 @@ def _parse_args(): default=DEFAULT_VERSION, ) parser.add_option( - '--to-dir', - help="Directory to save (and re-use) package", - default=DEFAULT_SAVE_DIR, + '--to-dir', + help="Directory to save (and re-use) package", + default=DEFAULT_SAVE_DIR, ) options, args = parser.parse_args() # positional arguments are ignored @@ -372,13 +417,13 @@ def _parse_args(): def _download_args(options): - """Return args for download_setuptools function from cmdline args.""" - return dict( - version=options.version, - download_base=options.download_base, - downloader_factory=options.downloader_factory, - to_dir=options.to_dir, - ) + """Return args for download_setuptools function from cmdline args.""" + return dict( + version=options.version, + download_base=options.download_base, + downloader_factory=options.downloader_factory, + to_dir=options.to_dir, + ) def main(): From 87ac2a0f8d778f959724e49365c90724a869c63c Mon Sep 17 00:00:00 2001 From: selurvedu Date: Tue, 19 Jul 2016 15:00:08 +0000 Subject: [PATCH 06/12] Pin versions of essential packages In essence, Robot Framework packages and buildout-related packages, including `setuptools` as a dependency of `zc.buildout`. --- buildout.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildout.cfg b/buildout.cfg index 4a0f9c963..d0705f830 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -48,7 +48,13 @@ robot_tests.broker.smarttender = git ${remotes:gh}openprocurement/robot_tests.b [versions] fake-factory = 0.5.3 +mr.developer = 1.34 restkit = 4.2.2.op1 rfc6266 = 0.0.6.op1 robotframework = 3.0.0 +robotframework-debuglibrary = 0.8 +robotframework-lint = 0.7 robotframework-selenium2library = 1.7.4 +setuptools = 18.3.2 +zc.buildout = 2.5.3 +zc.recipe.egg = 2.0.3 From 81325d3197d62bb6ba8a26082f265e14a31a6ffc Mon Sep 17 00:00:00 2001 From: selurvedu Date: Wed, 21 Dec 2016 17:47:21 +0000 Subject: [PATCH 07/12] Bump the `robotframework-selenium2library` version --- buildout.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildout.cfg b/buildout.cfg index afe72b40d..a49b849b2 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -77,7 +77,7 @@ rfc6266 = 0.0.6.op1 robotframework = 3.0.0 robotframework-debuglibrary = 0.8 robotframework-lint = 0.7 -robotframework-selenium2library = 1.7.4 +robotframework-selenium2library = 1.8.0 setuptools = 18.3.2 zc.buildout = 2.5.3 zc.recipe.egg = 2.0.3 From 151e7d07540d83ca04dee38d8a2669b04720cfc3 Mon Sep 17 00:00:00 2001 From: selurvedu Date: Wed, 21 Dec 2016 17:49:50 +0000 Subject: [PATCH 08/12] Replace `fake-factory` with `Faker`; bump its ver. This is the same package, it was submitted to PyPI under a new name. --- buildout.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildout.cfg b/buildout.cfg index a49b849b2..096ace2a4 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -70,7 +70,7 @@ robot_tests.broker.uub = git ${remotes:gh}openprocurement/robot_tests.b robot_tests.broker.aps = git ${remotes:gh}openprocurement/robot_tests.broker.aps.git [versions] -fake-factory = 0.5.3 +Faker = 0.7.7 mr.developer = 1.34 restkit = 4.2.2.op1 rfc6266 = 0.0.6.op1 diff --git a/setup.py b/setup.py index b05958170..d8db75dee 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ 'iso8601', 'PyYAML', 'munch', - 'fake-factory', + 'Faker', 'dpath', 'jsonpath-rw', 'dateutils', From fe57d771f3ef352031671d5a72d5097cb4cd6dac Mon Sep 17 00:00:00 2001 From: selurvedu Date: Wed, 21 Dec 2016 22:18:36 +0000 Subject: [PATCH 09/12] Fix broken `catch_phrase` for the `ru_RU` locale --- op_robot_tests/tests_files/initial_data.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/op_robot_tests/tests_files/initial_data.py b/op_robot_tests/tests_files/initial_data.py index fb4d4a4a2..14748f709 100644 --- a/op_robot_tests/tests_files/initial_data.py +++ b/op_robot_tests/tests_files/initial_data.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 - from datetime import timedelta from faker import Factory +from faker.providers.company.en_US import Provider as CompanyProviderEnUs +from faker.providers.company.ru_RU import Provider as CompanyProviderRuRu from munch import munchify from uuid import uuid4 from tempfile import NamedTemporaryFile @@ -10,10 +12,16 @@ import random -fake = Factory.create('uk_UA') -fake_ru = Factory.create('ru') -fake_en = Factory.create() -fake.add_provider(OP_Provider) +fake_en = Factory.create(locale='en_US') +fake_ru = Factory.create(locale='ru_RU') +fake_uk = Factory.create(locale='uk_UA') +fake_uk.add_provider(OP_Provider) +fake = fake_uk + +# This workaround fixes an error caused by missing "catch_phrase" class method +# for the "ru_RU" locale in Faker >= 0.7.4 +fake_ru.add_provider(CompanyProviderEnUs) +fake_ru.add_provider(CompanyProviderRuRu) def create_fake_sentence(): From 39825d86d3fb938894b2edd654592c814ac91366 Mon Sep 17 00:00:00 2001 From: selurvedu Date: Tue, 19 Jul 2016 16:22:02 +0000 Subject: [PATCH 10/12] Properly generate scripts of `robotframework` egg This will generate `bin/pybot`, `bin/robot` and `bin/rebot` scripts. `op_robot_tests/rebot.py` is not needed anymore. --- buildout.cfg | 1 + op_robot_tests/rebot.py | 5 ----- setup.py | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 op_robot_tests/rebot.py diff --git a/buildout.cfg b/buildout.cfg index 096ace2a4..8f01d570f 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -14,6 +14,7 @@ recipe = zc.recipe.egg eggs = op_robot_tests openprocurement_client + robotframework robotframework-lint robotframework-debuglibrary robot_tests.broker.dzo diff --git a/op_robot_tests/rebot.py b/op_robot_tests/rebot.py deleted file mode 100644 index 03da5d5d8..000000000 --- a/op_robot_tests/rebot.py +++ /dev/null @@ -1,5 +0,0 @@ -from robot.rebot import rebot_cli -import sys - -def rebot(): - rebot_cli(sys.argv[1:]) \ No newline at end of file diff --git a/setup.py b/setup.py index d8db75dee..06357fec0 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,6 @@ 'console_scripts': [ 'openprocurement_tests = op_robot_tests.runner:runner', 'op_tests = op_robot_tests.runner:runner', - 'rebot = op_robot_tests.rebot:rebot' ], } ) From ba66f3235ea8fa37c9bd3efb59924afb013e0447 Mon Sep 17 00:00:00 2001 From: selurvedu Date: Tue, 19 Jul 2016 16:29:15 +0000 Subject: [PATCH 11/12] Remove unneeded dependencies from setup.py Both libraries are still present in buildout.cfg for development purposes. --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index 06357fec0..c5a24bdba 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,6 @@ # -*- Extra requirements: -*- 'robotframework', 'robotframework-selenium2library', - 'robotframework-debuglibrary', - 'robotframework-selenium2screenshots', 'selenium < 3.0.dev0', 'Pillow', 'iso8601', From 48dfbf78e1ac893ef8a6393785112c710e4b9e0e Mon Sep 17 00:00:00 2001 From: selurvedu Date: Wed, 21 Dec 2016 17:56:31 +0000 Subject: [PATCH 12/12] Sort `install_requires` in setup.py Also, the `bin/openprocurement_tests` script was removed in favour of `bin/op_tests`. --- setup.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index c5a24bdba..9af4480db 100644 --- a/setup.py +++ b/setup.py @@ -18,26 +18,25 @@ zip_safe=False, install_requires=[ # -*- Extra requirements: -*- - 'robotframework', - 'robotframework-selenium2library', - 'selenium < 3.0.dev0', + 'Faker', 'Pillow', - 'iso8601', 'PyYAML', - 'munch', - 'Faker', + 'barbecue', + 'chromedriver', + 'dateutils', 'dpath', + 'haversine', + 'iso8601', 'jsonpath-rw', - 'dateutils', - 'pytz', + 'munch', 'parse', - 'chromedriver', - 'barbecue', - 'haversine' + 'pytz', + 'robotframework', + 'robotframework-selenium2library', + 'selenium < 3.0.dev0', ], entry_points={ 'console_scripts': [ - 'openprocurement_tests = op_robot_tests.runner:runner', 'op_tests = op_robot_tests.runner:runner', ], }