diff options
Diffstat (limited to 'tests/uiTests/test_ui_base.py')
-rw-r--r-- | tests/uiTests/test_ui_base.py | 119 |
1 files changed, 70 insertions, 49 deletions
diff --git a/tests/uiTests/test_ui_base.py b/tests/uiTests/test_ui_base.py index d4f1a62..26dd2a5 100644 --- a/tests/uiTests/test_ui_base.py +++ b/tests/uiTests/test_ui_base.py @@ -1,41 +1,40 @@ - -# ============LICENSE_START========================================== -# org.onap.vvp/test-engine -# =================================================================== -# Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# -# Unless otherwise specified, all software contained herein is licensed -# under the Apache License, Version 2.0 (the “License”); -# you may not use this software except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ============LICENSE_END============================================ -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# ============LICENSE_START==========================================
+# org.onap.vvp/test-engine
+# ===================================================================
+# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# ===================================================================
+#
+# Unless otherwise specified, all software contained herein is licensed
+# under the Apache License, Version 2.0 (the “License”);
+# you may not use this software except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+#
+# Unless otherwise specified, all documentation contained herein is licensed
+# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# you may not use this documentation except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://creativecommons.org/licenses/by/4.0/
+#
+# Unless required by applicable law or agreed to in writing, documentation
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ============LICENSE_END============================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
import logging
import platform
import sys
@@ -85,8 +84,12 @@ class TestUiBase(unittest.TestCase): self.fullClassName = __name__
self.className = self.__class__.__name__
- logger.debug("---------------------- TestCase - Start - Class " +
- self.className + " Function " + self._testMethodName + " ----------------------")
+ logger.debug(
+ "---------------------- TestCase - Start - Class " +
+ self.className +
+ " Function " +
+ self._testMethodName +
+ " ----------------------")
self.ice_driver = session.get_driver()
@@ -111,12 +114,17 @@ class TestUiBase(unittest.TestCase): self.endTime = timer()
self.testDuration = str(self.endTime - self.startTime)
self.results()
- if self.one_web_driver_enabled is None or not self.one_web_driver_enabled:
+ if self.one_web_driver_enabled is None \
+ or not self.one_web_driver_enabled:
session.ice_driver.quit()
else:
self.go_to_web_page(Constants.Default.LoginURL.TEXT)
- logger.debug("---------------------- TestCase - End - Class " + self.className +
- " Function " + self._testMethodName + " ----------------------\n")
+ logger.debug(
+ "---------------------- TestCase - End - Class " +
+ self.className +
+ " Function " +
+ self._testMethodName +
+ " ----------------------\n")
try:
logging.getLogger().info("BB")
finally:
@@ -133,14 +141,27 @@ class TestUiBase(unittest.TestCase): @logFuncEntry
def results(self):
- params = {"testType": "E2E Test", "testFeature": self.className,
- "testResult": "PASS", "testName": self.funcName, "duration": self.testDuration}
+ params = {
+ "testType": "E2E Test",
+ "testFeature": self.className,
+ "testResult": "PASS",
+ "testName": self.funcName,
+ "duration": self.testDuration}
if (session.errorCounter == 0):
- DBGeneral.insert_results(params["testType"], params["testFeature"], params[
- "testResult"], params["testName"], params['duration'])
+ DBGeneral.insert_results(
+ params["testType"],
+ params["testFeature"],
+ params["testResult"],
+ params["testName"],
+ params['duration'])
else:
params["testResult"] = "FAIL" # Mark test as fail.
# Add the errors to notes column in table.
params["notes"] = session.errorList
- DBGeneral.insert_results(params["testType"], params["testFeature"], params[
- "testResult"], params["testName"], params['duration'], params["notes"])
+ DBGeneral.insert_results(
+ params["testType"],
+ params["testFeature"],
+ params["testResult"],
+ params["testName"],
+ params['duration'],
+ params["notes"])
|