Skip to content
Snippets Groups Projects
Commit 48e95f7a authored by Tam Thai Hoang Minh's avatar Tam Thai Hoang Minh
Browse files

Merge branch 'main' into 'main'

Shorten the test traversal

See merge request !8
parents ad5caea7 f38d1a90
No related branches found
No related tags found
1 merge request!8Shorten the test traversal
No preview for this file type
......@@ -21,10 +21,10 @@
"cannotSwitchTo_private": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EFailed%20to%20switch%20from%20private%20mode%20to%20public%20mode%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EClick%20on%20the%20'Select%20Model'%20button.%3C%2Fli%3E%3Cli%3ECreate%20a%20new%20model%20and%20click%20the%20'Change%20to%20public'%20button%20to%20see%20if%20it%20switches%20to%20public%20mode.%3C%2Fli%3E%3Cli%3EThen%20click%20'Change%20to%20private'%20button%20to%20see%20if%20it%20switches%20back%20to%20private%20mode.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"empty_userList_in_addUserButton": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EFailed%20to%20switch%20from%20private%20mode%20to%20public%20mode%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EClick%20on%20the%20'Select%20Model'%20button.%3C%2Fli%3E%3Cli%3ECreate%20a%20new%20model%20and%20click%20the%20'Add%20user'%20button%20to%20see%20if%20the%20list%20of%20user%20is%20empty%20or%20not.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"filter_list_in_addUser_isNotWorking": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20filter%20list%20in%20the%20add%20user%20pop%20up%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EClick%20on%20the%20'Select%20Model'%20button.%3C%2Fli%3E%3Cli%3ECreate%20a%20new%20model%20and%20click%20the%20'Add%20user'%20button.%3C%2Fli%3E%3Cli%3EThen%20type%20some%20characters%20in%20the%20search%20box%20to%20see%20if%20the%20filter%20list%20is%20working%20properly.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"bosch_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Bosch%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Bosch%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"covesa_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Covesa%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Covesa%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"eclipse_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Eclipse%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Eclipse%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"institut_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Ferdinand%20Steinbeis%20Institut%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Ferdinand%20Steinbeis%20Institut%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"Bosch_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Bosch%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Bosch%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"Covesa_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Covesa%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Covesa%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"Eclipse_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Eclipse%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Eclipse%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"Ferdinand_Steinbeis_Institut_link_failed": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3EThe%20Ferdinand%20Steinbeis%20Institut%20Link%20in%20the%20Home%20page%20doesn't%20work%20properly.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page.%3C%2Fli%3E%3Cli%3EScroll%20down%20and%20click%20the%20Ferdinand%20Steinbeis%20Institut%20logo.%3C%2Fli%3E%3Cli%3EWait%20to%20see%20if%20it%20opens%20the%20correct%20webpage.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"addWidget_invalidBoxes": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3E'Add%20widget'%20button%20appeared%20when%20invalid%20boxes%20are%20selected%20in%20prototype%20page.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page%2C%20choose%20a%20prototype%20or%20create%20a%20new%20one.%3C%2Fli%3E%3Cli%3EOpen%20the%20prototype%20detail%20page%20and%20navigate%20to%20the%20Dashboard%20Config%20in%20Code%20section.%3C%2Fli%3E%3Cli%3EClick%20boxes%201%2C3%2C4%2C8%2C9%20and%20see%20if%20the%20'Add%20widget'%20button%20appears.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"addWidget_validBoxes": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3E'Add%20widget'%20button%20did%20not%20appear%20when%20valid%20boxes%20are%20selected%20in%20prototype%20page.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page%2C%20choose%20a%20prototype%20or%20create%20a%20new%20one.%3C%2Fli%3E%3Cli%3EOpen%20the%20prototype%20detail%20page%20and%20navigate%20to%20the%20Dashboard%20Config%20in%20Code%20section.%3C%2Fli%3E%3Cli%3EClick%20boxes%203%2C4%2C8%2C9%20and%20see%20if%20the%20'Add%20widget'%20button%20appears.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
"addWidget_widgetList_empty": "%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D'en'%3E%3Cbody%3E%3Cp%3E'List%20of%20widgets%20is%20empty%20in%20the%20prototype%20page.%3C%2Fp%3E%3Cp%3ESteps%20to%20Reproduce%3A%3C%2Fp%3E%3Col%3E%3Cli%3ENavigate%20to%20the%20home%20page%2C%20choose%20a%20prototype%20or%20create%20a%20new%20one.%3C%2Fli%3E%3Cli%3EOpen%20the%20prototype%20detail%20page%20and%20navigate%20to%20the%20Dashboard%20Config%20in%20Code%20section.%3C%2Fli%3E%3Cli%3EClick%20boxes%203%2C4%2C8%2C9%20and%20click%20'Add%20Widget'%20button.%3C%2Fli%3E%3Cli%3ECheck%20if%20the%20widget%20list%20is%20empty%20or%20not.%3C%2Fli%3E%3C%2Fol%3E%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E",
......
......@@ -10,8 +10,8 @@
"signUp_name": "Automation Test Account",
"admin_email": "dev@gmail.com",
"admin_password": "abcd1234",
"bosch_link": "https://www.bosch.com/",
"covesa_link": "https://covesa.global/",
"eclipse_link": "https://www.eclipse.org/",
"institut_link": "https://ferdinand-steinbeis-institut.de/"
"Bosch_link": "https://www.bosch.com/",
"Covesa_link": "https://www.covesa.global",
"Eclipse_link": "https://www.eclipse.org",
"Ferdinand_Steinbeis_Institut_link": "https://ferdinand-steinbeis-institut.de"
}
from util import *
class Test_PageTraversal(BaseTest, unittest.TestCase):
# NOT DONE, WAIT FOR CONSISTENCY IN THE HREF LINK AND ACTUAL LINK
def test_open_links(self):
if (self.next is True):
self.open_partner_link()
def open_partner_link(self):
self.base.beginOfTest_logFormat("open_partner_link")
self.verify_link("Bosch")
self.verify_link("Covesa")
self.verify_link("Eclipse")
self.verify_link("Ferdinand_Steinbeis_Institut")
def verify_link(self, name):
self.base.beginOfTest_logFormat(f"open_{name}_link")
try:
self.driver.find_element(By.XPATH, "//a[@href='https://www.bosch.com/']").click()
page_url = self.configInfo[f"{name}_link"]
self.driver.find_element(By.XPATH, f"//a[@href='{page_url}']").click()
windows_opened = self.driver.window_handles
self.driver.switch_to.window(windows_opened[1])
assert (self.driver.current_url == self.configInfo["bosch_link"])
self.logger.info("Success. Opened and verified Bosch Link")
assert (self.driver.current_url == page_url)
self.logger.info(f"Success. Opened and verified {name} Link")
self.driver.close()
self.driver.switch_to.window(windows_opened[0])
except Exception as e:
error_handler(self.logger, self.configInfo, "Failure. Cannot open Bosch Link in the Home Page", e,
self.configError["bosch_link_failed"], "Home")
self.driver.close()
self.driver.switch_to.window(windows_opened[0])
try:
self.driver.find_element(By.XPATH, "//a[@href='https://www.covesa.global']").click()
windows_opened = self.driver.window_handles
self.driver.switch_to.window(windows_opened[1])
assert (self.driver.current_url == self.configInfo["covesa_link"])
self.logger.info("Success. Opened and verified Covesa Link")
except Exception as e:
error_handler(self.logger, self.configInfo, "Failure. Cannot open Covesa Link in the Home Page", e,
self.configError["covesa_link_failed"], "Home")
self.driver.close()
self.driver.switch_to.window(windows_opened[0])
try:
self.driver.find_element(By.XPATH, "//a[@href='https://www.eclipse.org']").click()
windows_opened = self.driver.window_handles
self.driver.switch_to.window(windows_opened[1])
assert (self.driver.current_url == self.configInfo["eclipse_link"])
self.logger.info("Success. Opened and verified Eclipse Partner Link")
except Exception as e:
error_handler(self.logger, self.configInfo, "Failure. Cannot open Eclipse Link in the Home Page", e,
self.configError["eclipse_link_failed"], "Home")
self.driver.close()
self.driver.switch_to.window(windows_opened[0])
try:
self.driver.find_element(By.XPATH, "//a[@href='https://ferdinand-steinbeis-institut.de']").click()
windows_opened = self.driver.window_handles
self.driver.switch_to.window(windows_opened[1])
assert (self.driver.current_url == self.configInfo["institut_link"])
self.logger.info("Success. Opened and verified Ferdinand Steinbeis Institut Partner Link")
except Exception as e:
error_handler(self.logger, self.configInfo, "Failure. Cannot open Ferdinand Steinbeis Institut Link in the Home Page", e,
self.configError["institut_link_failed"], "Home")
\ No newline at end of file
error_handler(self.logger, self.configInfo, f"Failure. Cannot open {name} Link in the Home Page", e,
self.configError[f"{name}_link_failed"], "Home")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment