Skip to content

Commit

Permalink
e2e: updated communities join flow
Browse files Browse the repository at this point in the history
  • Loading branch information
yevh-berdnyk committed Aug 28, 2023
1 parent 255a3b9 commit 2d47f28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/appium/tests/critical/test_public_chat_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ def prepare_devices(self):
self.text_message = 'hello'

# self.home_2.just_fyi("Send message to contact (need for blocking contact) test")
self.home_1.get_chat(self.username_2).wait_for_visibility_of_element()
self.chat_1 = self.home_1.get_chat(self.username_2).click()
self.chat_1.send_message('hey')
self.chat_2 = self.home_2.get_chat(self.username_1).click()
Expand Down Expand Up @@ -912,7 +913,7 @@ def test_community_contact_block_unblock_offline(self):
self.errors.append("Messages from blocked user is not cleared in public chat ")
self.chat_1.navigate_back_to_home_view()
self.home_1.chats_tab.click()
if not self.home_1.element_by_translation_id( "no-messages").is_element_displayed():
if not self.home_1.element_by_translation_id("no-messages").is_element_displayed():
self.errors.append("1-1 chat from blocked user is not removed and messages home is not empty!")
self.chat_1.toggle_airplane_mode()

Expand Down
1 change: 1 addition & 0 deletions test/appium/views/base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def __init__(self, driver):
self.driver = driver
self.send_message_button = SendMessageButton(self.driver)
self.send_contact_request_button = Button(self.driver, translation_id="send-request")
self.password_input = EditBox(self.driver, accessibility_id="password-input")

# Old UI Tabs
self.home_button = HomeButton(self.driver)
Expand Down
7 changes: 5 additions & 2 deletions test/appium/views/chat_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from appium.webdriver.common.touch_action import TouchAction
from selenium.common.exceptions import NoSuchElementException, TimeoutException

from tests import emojis
from tests import emojis, common_password
from views.base_element import Button, EditBox, Text, BaseElement, SilentButton
from views.base_view import BaseView
from views.home_view import HomeView
Expand Down Expand Up @@ -410,12 +410,15 @@ def __init__(self, driver):
# Communities initial page
self.community_description_text = Text(self.driver, accessibility_id="community-description-text")

def join_community(self):
def join_community(self, password=common_password):
self.driver.info("Joining community")
self.join_button.click()
self.checkbox_button.scroll_to_element()
self.checkbox_button.enable()
self.join_community_button.scroll_and_click()
self.password_input.set_value(password)
Button(self.driver,
xpath="//*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']").click()

def get_channel(self, channel_name: str):
self.driver.info("Getting %s channel element in community" % channel_name)
Expand Down
1 change: 0 additions & 1 deletion test/appium/views/sign_in_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def __init__(self, driver):
self.sign_in_intro_button = Button(self.driver, accessibility_id="already-use-status-button")
self.i_m_new_in_status_button = Button(self.driver, accessibility_id="new-to-status-button")

self.password_input = EditBox(self.driver, accessibility_id="password-input")
self.migration_password_input = EditBox(self.driver, accessibility_id="enter-password-input")
self.login_button = LogInButton(self.driver)
self.access_key_button = AccessKeyButton(self.driver)
Expand Down

0 comments on commit 2d47f28

Please sign in to comment.