Skip to content
Snippets Groups Projects
Verified Commit 9a48dc0d authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

They've changed every ID. I hate them

parent 7266a3cd
Branches
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ from selenium.webdriver.support import expected_conditions as EC
RESET_PERIOD = '//input[@id="frmSelLog:qryPerSel:cmdBtnSlPerAllEntf"]'
FRENCH_PLEASE = '//a[@id="formServNav:j_idt23"]'
FRENCH_PLEASE = '//a[@id="formServNav:j_idt22"]'
CLEAR_MERCHANDISE_SELECTION = '//input[@id="frmSelLog:qryWaSel:cmdBtnSlWaAllEntf"]'
......@@ -31,21 +31,16 @@ DATE_SELECTION_MONTH_START = '//select[@id="formSelectionMain:slctMPerPerV"]'
DATE_SELECTION_MONTH_END = '//select[@id="formSelectionMain:slctMPerPerB"]'
DATE_SELECTION_SEND_MANIFESTO = '//a[@id="formSelectionMain:j_idt147"]'
MERCHANDISE_NUMBER_SELECTOR = '//input[@id="formSelectionMain:j_idt159:rdbNummerText:_2"]'
MERCHANDISE_SELECTOR = '//input[@id="formSelectionMain:j_idt159:txtSuche"]'
MERCHANDISE_SELECT_ALL = '//a[@id="formSelectionMain:j_idt159:j_idt225"]'
MERCHANDISE_NUMBER_SELECTOR = '//input[@id="formSelectionMain:j_idt163:rdbNummerText:_2"]'
MERCHANDISE_SELECTOR = '//input[@id="formSelectionMain:j_idt163:txtSuche"]'
MERCHANDISE_SELECT_ALL = '//a[@id="formSelectionMain:j_idt163:j_idt232"]'
MERCHANDISE_TOTAL_COMMERCE_REMOVE_BUTTON = '//input[@id="frmSelLog:qryWaSel:dataTblSlWa:0:cmdBtnSlWaBtn"]'
MERCHANDISE_SELECTED = '//tbody[@id="frmSelLog:qryWaSel:dataTblSlWa:tbody"]/tr'
COUNTRY_SELECT_ALL = '//a[@id="formSelectionMain:j_idt230:j_idt248"]'
COUNTRY_SELECT_ALL = '//a[@id="formSelectionMain:j_idt237:j_idt257"]'
COUNTRY_TOTAL_COMMERCE_REMOVE_BUTTON = '//input[@id="frmSelLog:qryHpSel:dataTblSlHp:0:cmdBtnSlHp"]'
TOTAL_SELECTION_ID = '//input[@id="formSelectionMain:j_idt257:_2"]'
NEXT_STEP = '//a[@id="formSelectionMain:j_idt123:j_idt128"]'
READY = '//div[@class="iceOutConStatInactv"]'
IS_LOADING = '//div[@id="j_idt42:j_idt43"]'
NEXT_STEP = '//a[@id="formSelectionMain:j_idt126:j_idt131"]'
DONE_OPTIONS_BUTTON = '//a[@id="formErgMainErgebnis:j_idt142"]'
DONE_TOGGLE_OPTIONS_BUTTON = '//input[@id="frmEditQuery:j_idt42:cmdToggleOptions"]'
......@@ -54,7 +49,7 @@ DONE_FILENAME = '//input[@id="frmEditQuery:j_idt42:ptsEditQuery:0:j_idt50:j_idt5
DONE_LOOK_BUTTON = '//span[@id="frmEditQuery:j_idt42:ptsEditQuery:0:j_idt109"]'
DONE_SHOW_EMPTY_CELLS_BUTTON = '//td[@id="frmEditQuery:j_idt42:ptsEditQuery:0:j_idt110:pnlGrdAbfrBAnzLZ-0-1"]'
DONE_EXPORT_BUTTON = '//a[@id="frmEditQuery:j_idt42:ptsEditQuery:0:j_idt50:j_idt56"]'
DONE_TABLE_ITEMS = '//table[@id="{0}"]/tbody/tr'
DONE_TABLE_ITEMS = '//table[@class="impex-resultTable"]/tbody/tr'
DONE_URL = "https://www.gate.ezv.admin.ch/swissimpex/public/bereiche/waren/result.xhtml"
......@@ -297,7 +292,7 @@ class Parser:
logger.info("Ensuring result table is correct...")
# We check the server received that particular order because sometimes it just ignores it
while len(self.driver.find_elements_by_xpath(DONE_TABLE_ITEMS.format(self.selectedMerchandise))) <= 2:
while len(self.driver.find_elements_by_xpath(DONE_TABLE_ITEMS)) <= 2:
logger.warning("Result table does not show the empty cells, clicking again")
ActionChains(self.driver).click(self.driver.find_element_by_xpath(DONE_SHOW_EMPTY_CELLS_BUTTON)) \
.pause(1.5).perform()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment