commit 042b9723635f38dbbafe4621fae5cd30de17c9a2 Author: Greg Gauthier Date: Wed Sep 16 17:02:39 2020 +0100 initial commit 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