remove hardcoded test_reports dir

The aim of this PS is to remove hardcoded test_reports dir path
so test run can get screenshot dir from the specified configuration.

Change-Id: I454ccdccbed93b831c41199481caf8b5eb302337
This commit is contained in:
Pallav Gupta 2020-05-20 16:41:08 -05:00
parent 5ff708aed5
commit 039b208f7f
3 changed files with 5 additions and 5 deletions

View File

@ -123,7 +123,7 @@ SeleniumGroup = [
help='Timeout in seconds to wait for a page to become available'), help='Timeout in seconds to wait for a page to become available'),
cfg.StrOpt( cfg.StrOpt(
'screenshots_directory', 'screenshots_directory',
default='integration_tests_screenshots', default='test_reports',
help='Output directory for screenshots'), help='Output directory for screenshots'),
cfg.BoolOpt( cfg.BoolOpt(
'maximize_browser', 'maximize_browser',

View File

@ -224,9 +224,9 @@ class BaseTestCase(testtools.TestCase):
@property @property
def _test_report_dir(self): def _test_report_dir(self):
report_dir = os.path.join(ROOT_PATH, 'test_reports', report_dir = os.path.join(
'{}.{}'.format(self.__class__.__name__, ROOT_PATH, self.CONFIG.selenium.screenshots_directory,
self._testMethodName)) '{}.{}'.format(self.__class__.__name__, self._testMethodName))
if not os.path.isdir(report_dir): if not os.path.isdir(report_dir):
os.makedirs(report_dir) os.makedirs(report_dir)
return report_dir return report_dir

View File

@ -20,7 +20,7 @@ page_timeout=60
# Output directory for screenshots. # Output directory for screenshots.
# (string value) # (string value)
screenshots_directory=integration_tests_screenshots screenshots_directory=test_reports
# Implicit timeout to wait until element become available, # Implicit timeout to wait until element become available,
# this timeout is used for every find_element, find_elements call. # this timeout is used for every find_element, find_elements call.