From 042b9723635f38dbbafe4621fae5cd30de17c9a2 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 16 Sep 2020 17:02:39 +0100 Subject: [PATCH] initial commit --- .gitignore | 3 +++ Pipfile | 17 +++++++++++++++ README.md | 0 behave.ini | 0 features/__init__.py | 0 features/demo.feature | 0 features/environment.py | 0 features/steps/__init__.py | 0 fixtures.py | 0 harness/__init__.py | 0 harness/conftest.py | 44 ++++++++++++++++++++++++++++++++++++++ helpers/__init__.py | 0 webdriver/__init__.py | 0 13 files changed, 64 insertions(+) create mode 100644 .gitignore create mode 100644 Pipfile create mode 100644 README.md create mode 100644 behave.ini create mode 100644 features/__init__.py create mode 100644 features/demo.feature create mode 100644 features/environment.py create mode 100644 features/steps/__init__.py create mode 100644 fixtures.py create mode 100755 harness/__init__.py create mode 100755 harness/conftest.py create mode 100644 helpers/__init__.py create mode 100644 webdriver/__init__.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8223859 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.lock +*.iml +.idea/ \ No newline at end of file diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..55e43ca --- /dev/null +++ b/Pipfile @@ -0,0 +1,17 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flask = "*" +pytest = "*" +behave = "*" + +[packages] +flask = "*" +pytest = "*" +behave = "*" + +[requires] +python_version = "3.8" \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/behave.ini b/behave.ini new file mode 100644 index 0000000..e69de29 diff --git a/features/__init__.py b/features/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/features/demo.feature b/features/demo.feature new file mode 100644 index 0000000..e69de29 diff --git a/features/environment.py b/features/environment.py new file mode 100644 index 0000000..e69de29 diff --git a/features/steps/__init__.py b/features/steps/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fixtures.py b/fixtures.py new file mode 100644 index 0000000..e69de29 diff --git a/harness/__init__.py b/harness/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/harness/conftest.py b/harness/conftest.py new file mode 100755 index 0000000..7dd0114 --- /dev/null +++ b/harness/conftest.py @@ -0,0 +1,44 @@ +import configparser +import pytest + +config = configparser.ConfigParser() + + +def pytest_addoption(parser): + """ attaches optional cmd-line args to the pytest machinery """ + parser.addoption('--properties', + action='store', + default='staging', + help='the name of the environment for which you need properties.') + parser.addoption('--fixtures', + action='store', + default='default', + help='the name of the environment for which you need fixture accounts.') + + +@pytest.fixture(scope="session", autouse=True) +def service_base_url(pytestconfig): + """ + The url of the live sme-service under test + """ + env = pytestconfig.getoption("env") + return _read_config_section(fixtures, env)['target_url'] + + +@pytest.fixture(scope="session", autouse=True) +def fixture_data(pytestconfig): + """ + The fixture data items for the account under test + """ + env = pytestconfig.getoption("env") + return _read_config_section(fixtures, env) + + +def _read_config_section(source, section): + config.read(source) + return config[section] + + +def _read_fixture_file(fixtures): + fixture_data = config.read(fixtures) + return fixture_data diff --git a/helpers/__init__.py b/helpers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/webdriver/__init__.py b/webdriver/__init__.py new file mode 100644 index 0000000..e69de29