From d11ce135a66ff8bd465db033971a6b07ad375bb9 Mon Sep 17 00:00:00 2001 From: pavloburykh Date: Wed, 12 Apr 2023 13:01:24 +0300 Subject: [PATCH] e2e: fix xpath for link preview --- test/appium/views/chat_view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 09233d1e98..8420a3b63a 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -467,7 +467,7 @@ class PreviewMessage(ChatElementByText): class PreviewTitle(SilentButton): def __init__(self, driver, parent_locator: str): super().__init__(driver, prefix=parent_locator, - xpath="//*[@content-desc='member-photo']/preceding-sibling::android.widget.TextView[2]") + xpath="//*[@content-desc='member-photo']/ancestor::android.view.ViewGroup[1]/preceding-sibling::android.widget.TextView[2]") return PreviewMessage.return_element_or_empty(PreviewTitle(self.driver, self.locator)) @@ -476,7 +476,7 @@ class PreviewMessage(ChatElementByText): class PreviewSubTitle(SilentButton): def __init__(self, driver, parent_locator: str): super().__init__(driver, prefix=parent_locator, - xpath="//*[@content-desc='member-photo']/preceding-sibling::android.widget.TextView[3]") + xpath="//*[@content-desc='member-photo']/ancestor::android.view.ViewGroup[1]/preceding-sibling::android.widget.TextView[3]") return PreviewMessage.return_element_or_empty(PreviewSubTitle(self.driver, self.locator))