Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions lidlplus/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,21 +209,16 @@ def _check_2fa_auth(self, browser, wait, verify_mode="phone", verify_token_func=
browser.find_element(By.NAME, "VerificationCode").send_keys(verify_code)
self._click(browser, (By.CLASS_NAME, "role_next"))

def login(self, phone, password, **kwargs):
def login(self, email, password, **kwargs):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The login form now seems to require email instead of phone. Could you also replace all other occurences of this (e.g. in the login CLI) where there's "phone" to "email"?

I can see at least one occurence, where the variable should probably be named email and the (phone number) part of the string should be changed to (email).

username = args.get("user") or input("Enter your lidl plus username (phone number): ")

"""Simulate app auth"""
browser = self._get_browser(headless=kwargs.get("headless", True))
browser.get(self._register_link)
wait = WebDriverWait(browser, 10)
wait.until(expected_conditions.visibility_of_element_located((By.ID, "button_welcome_login"))).click()
wait.until(expected_conditions.visibility_of_element_located((By.NAME, "EmailOrPhone"))).send_keys(phone)
self._click(browser, (By.ID, "button_btn_submit_email"))
self._click(
browser,
(By.ID, "button_btn_submit_email"),
request=f"{self._AUTH_API}/api/phone/exists.*",
)
wait.until(expected_conditions.element_to_be_clickable((By.ID, "field_Password"))).send_keys(password)
self._click(browser, (By.ID, "button_submit"))
wait.until(expected_conditions.visibility_of_element_located((By.XPATH, '//*[@id="duple-button-block"]/button[1]/span'))).click()
#wait.until(expected_conditions.visibility_of_element_located((By.NAME, "EmailOrPhone"))).send_keys(phone)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is this comment for? Did you forget to remove it? If not, please explain its purpose in the code.

wait.until(expected_conditions.element_to_be_clickable((By.NAME, "input-email"))).send_keys(email)
wait.until(expected_conditions.element_to_be_clickable((By.NAME, "Password"))).send_keys(password)
self._click(browser, (By.XPATH, '//*[@id="duple-button-block"]/button'))
self._check_login_error(browser)
self._check_2fa_auth(
browser,
Expand Down