-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Extending playwright coverage over the group messaging system. (#6020)
- Updating the playwright.yml to contain the group messaging system suite for both scheduled & workflow dispatch executions. - Fix twitter profile link test since twitter is now "x". - Fix footer test. - Added group page to POM & flows.
- Loading branch information
1 parent
40b3842
commit 5fa79c8
Showing
17 changed files
with
603 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
playwright_tests/flows/user_groups_flows/user_group_flow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from playwright_tests.core.testutilities import TestUtilities | ||
from playwright_tests.pages.contribute.groups_page import GroupsPage | ||
from playwright.sync_api import Page | ||
|
||
|
||
class UserGroupFlow(TestUtilities, GroupsPage): | ||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
def remove_a_user_from_group(self, user: str): | ||
super()._click_on_edit_group_members() | ||
super()._click_on_remove_a_user_from_group_button(user) | ||
super()._click_on_remove_member_confirmation_button() | ||
|
||
def add_a_user_to_group(self, user: str): | ||
super()._click_on_edit_group_members() | ||
super()._type_into_add_member_field(user) | ||
super()._group_click_on_a_searched_username(user) | ||
super()._click_on_add_member_button() |
2 changes: 1 addition & 1 deletion
2
playwright_tests/messages/my_profile_pages_messages/my_profile_page_messages.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class UserGroupMessages: | ||
def get_user_added_success_message(self, username: str) -> str: | ||
return f"{username} added to the group successfully!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from playwright_tests.core.basepage import BasePage | ||
from playwright.sync_api import Page, Locator | ||
|
||
|
||
class GroupsPage(BasePage): | ||
__private_message_group_members_button = "//section[@id='main-area']/p[@class='pm']/a" | ||
__user_added_notification = "//ul[@class='user-messages']//p" | ||
__edit_group_members_option = "//div[@id='group-members']/a" | ||
__add_group_member_field = "//div[@id='group-members']//input[@id='token-input-id_users']" | ||
__add_member_button = "//div[@id='group-members']//input[@value='Add Member']" | ||
__remove_user_from_group_confirmation_button = "//input[@value='Remove member']" | ||
|
||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
# Add Group member | ||
def _get_user_added_successfully_message(self) -> str: | ||
return super()._get_text_of_element(self.__user_added_notification) | ||
|
||
def _get_pm_group_members_button(self) -> Locator: | ||
return super()._get_element_locator(self.__private_message_group_members_button) | ||
|
||
def _click_on_a_particular_group(self, group_name): | ||
super()._click(f"//a[text()='{group_name}']") | ||
|
||
def _click_on_pm_group_members_button(self): | ||
super()._click(self.__private_message_group_members_button) | ||
|
||
def _click_on_edit_group_members(self): | ||
super()._click(self.__edit_group_members_option) | ||
|
||
def _click_on_remove_a_user_from_group_button(self, username: str): | ||
super()._click(f"//div[@class='info']/a[text()='{username}']/../..//a" | ||
f"[@title='Remove user from group']") | ||
|
||
def _click_on_remove_member_confirmation_button(self): | ||
super()._click(self.__remove_user_from_group_confirmation_button) | ||
|
||
def _type_into_add_member_field(self, text: str): | ||
super()._type(self.__add_group_member_field, text, delay=0) | ||
|
||
def _group_click_on_a_searched_username(self, username: str): | ||
super()._click(f"//div[@class='name_search']/b[text()='{username}']") | ||
|
||
def _click_on_add_member_button(self): | ||
super()._click(self.__add_member_button) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.