initial commit
This commit is contained in:
commit
042b972363
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.lock
|
||||||
|
*.iml
|
||||||
|
.idea/
|
17
Pipfile
Normal file
17
Pipfile
Normal file
@ -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"
|
0
behave.ini
Normal file
0
behave.ini
Normal file
0
features/__init__.py
Normal file
0
features/__init__.py
Normal file
0
features/demo.feature
Normal file
0
features/demo.feature
Normal file
0
features/environment.py
Normal file
0
features/environment.py
Normal file
0
features/steps/__init__.py
Normal file
0
features/steps/__init__.py
Normal file
0
fixtures.py
Normal file
0
fixtures.py
Normal file
0
harness/__init__.py
Executable file
0
harness/__init__.py
Executable file
44
harness/conftest.py
Executable file
44
harness/conftest.py
Executable file
@ -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
|
0
helpers/__init__.py
Normal file
0
helpers/__init__.py
Normal file
0
webdriver/__init__.py
Normal file
0
webdriver/__init__.py
Normal file
Loading…
Reference in New Issue
Block a user