Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpath fix: send_picture xpaths updated #118

Merged
merged 1 commit into from
May 2, 2023
Merged
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
8 changes: 2 additions & 6 deletions alright/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ def find_attachment(self):
clipButton.click()

def send_attachment(self):

# Waiting for the pending clock icon to disappear
self.wait.until_not(
EC.presence_of_element_located(
Expand All @@ -508,7 +507,7 @@ def send_attachment(self):
EC.presence_of_element_located(
(
By.XPATH,
'//*[@id="app"]/div[1]/div[1]/div[2]/div[2]/span/div[1]/span/div[1]/div/div[2]/div/div[2]/div[2]/div/div/span',
"/html/body/div[1]/div/div/div[3]/div[2]/span/div/span/div/div/div[2]/div/div[2]/div[2]/div/div/span",
)
)
)
Expand Down Expand Up @@ -543,7 +542,7 @@ def send_picture(self, picture, message):
)
)
imgButton.send_keys(filename)
inp_xpath = "/html/body/div[1]/div/div/div[2]/div[2]/span/div/span/div/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div[1]/div[1]"
inp_xpath = "/html/body/div[1]/div/div/div[3]/div[2]/span/div/span/div/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div[1]/div"
input_box = self.wait.until(
EC.presence_of_element_located((By.XPATH, inp_xpath))
)
Expand Down Expand Up @@ -677,9 +676,7 @@ def get_last_message_received(self, query: str):
query (string): query value to be located in the chat name
"""
try:

if self.find_by_username(query):

self.wait.until(
EC.presence_of_element_located(
(
Expand Down Expand Up @@ -749,7 +746,6 @@ def get_last_message_received(self, query: str):
header_group.get_attribute("data-testid") == "default-group"
and msg_sender.strip() in header_text.text
):

LOGGER.info(f"Message sender: {msg_sender}.")
elif (
msg_sender.strip() != msg[0].strip()
Expand Down