I made a method to click on the calendar field and then choose the date, but when I move the parameters, is returning error.
My method
def select_current_date(self, *locator1, *locator2):
self.driver.find_element(*locator1).click()
WebDriverWait(self.driver, AUTOCOMPLETE_TIMEOUT).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, ".ui-icon.ui-icon-circle-triangle-w")))
self.driver.find_element(*locator2).click()
WebDriverWait(self.driver, AUTOCOMPLETE_TIMEOUT).until(
EC.invisibility_of_element_located((By.CSS_SELECTOR, ".ui-datepicker-title")))
Passing the parameters
self.select_current_date(*EventsLocators.RECEIVED, *EventsLocators.CURRENT_DATE)
My error
E File "/Users/rafael/Desktop/projects/automated_tests/base.py", line 23
E def select_current_date(self, *locator1, *locator2):
E ^
E SyntaxError: invalid syntax
Any idea?
Cheers!