Browse Source

Fixed: TC.STAGE & DB commit

aguryev 4 years ago
parent
commit
3bfb2d4b91

+ 1 - 1
baangt/base/ExportResults/ExportResults.py

@@ -235,7 +235,7 @@ class ExportResults:
 
     def __save_commit(self, session):
         try:
-            session.commit
+            session.commit()
         except IntegrityError as e:
             logger.critical(f"Integrity Error during commit to database: {e}")
         except Exception as e:

+ 4 - 9
baangt/base/TestRun/TestRun.py

@@ -80,15 +80,6 @@ class TestRun:
 
         self.browserFactory = BrowserFactory(self)
 
-        # DEBUG
-        '''
-        print(self.testRunUtils.testRunAttributes)
-        import json
-        with open ('testrun.json', 'w') as f:
-            json.dump(list(self.testRunUtils.testRunAttributes.values())[0], f)
-        exit()
-        '''
-
         self.executeTestRun()
         self.tearDown()
 
@@ -275,6 +266,10 @@ class TestRun:
         if self.globalSettingsFileNameAndPath:
             self.globalSettings = utils.openJson(self.globalSettingsFileNameAndPath)
 
+        # Set default execution STAGE
+        if self.globalSettings.get(GC.EXECUTION_STAGE, None) is None:
+            self.globalSettings[GC.EXECUTION_STAGE] = GC.EXECUTION_STAGE_TEST
+
         # Support for new dataClass to load different Classes
         for key, value in self.globalSettings.items():
             if "CL." in key:

BIN
example_googleImages.xlsx


+ 1 - 1
examples/globals_headless.json

@@ -3,7 +3,7 @@
     "TC.Stage": "Test",
     "TC.Lines": "",
     "TC.dontCloseBrowser": "True",
-    "TC.BrowserAttributes": {"HEADLESS": "True"},
+    "TC.BrowserAttributes": "{'HEADLESS': 'True'}",
     "TC.slowExecution": "True",
     "TC.NetworkInfo": "True",
     "TX.DEBUG": "True"

+ 0 - 7
globals.json

@@ -1,7 +0,0 @@
-{
-    "TC.Lines": "",
-    "TC.dontCloseBrowser": "",
-    "TC.slowExecution": "",
-    "TC.NetworkInfo": "",
-    "TX.DEBUG": "True"
-}

+ 0 - 10
globals_headless.json

@@ -1,10 +0,0 @@
-{
-    "exportFilesBasePath": "",
-    "TC.Stage": "Test",
-    "TC.Lines": "",
-    "TC.dontCloseBrowser": "True",
-    "TC.BrowserAttributes": {"HEADLESS": "True"},
-    "TC.slowExecution": "True",
-    "TC.NetworkInfo": "True",
-    "TX.DEBUG": "True"
-}

File diff suppressed because it is too large
+ 1 - 0
jsons/testrun.json