tests: Can change own display name in ProfilePopup
This commit is contained in:
parent
b267364960
commit
66b79fbda8
|
@ -31,7 +31,16 @@ class MainScreenComponents(Enum):
|
|||
USERSTATUSMENU_ALWAYS_ACTIVE_ACTION = "userContextmenu_AlwaysActiveButton"
|
||||
USERSTATUSMENU_INACTIVE_ACTION = "userContextmenu_InActiveButton"
|
||||
USERSTATUSMENU_AUTOMATIC_ACTION = "userContextmenu_AutomaticButton"
|
||||
USERSTATUSMENU_OPEN_PROFILE_POPUP = "userContextMenu_ViewMyProfileAction"
|
||||
class ProfilePopup(Enum):
|
||||
USER_IMAGE = "ProfileHeader_userImage"
|
||||
DISPLAY_NAME = "ProfileHeader_displayName"
|
||||
DISPLAY_NAME_EDIT_ICON = "ProfileHeader_displayNameEditIcon"
|
||||
|
||||
class DisplayNamePopup(Enum):
|
||||
DISPLAY_NAME_INPUT = "DisplayNamePopup_displayNameInput"
|
||||
DISPLAY_NAME_OK_BUTTON = "DisplayNamePopup_okButton"
|
||||
|
||||
class ChatNamePopUp(Enum):
|
||||
CHAT_NAME_TEXT = "chat_name_PlaceholderText"
|
||||
INPUT_ROOM_TOPIC_TEXT = "joinPublicChat_input"
|
||||
|
@ -127,3 +136,16 @@ class StatusMainScreen:
|
|||
def set_user_state_to_automatic(self):
|
||||
click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)
|
||||
click_obj_by_name(MainScreenComponents.USERSTATUSMENU_AUTOMATIC_ACTION.value)
|
||||
|
||||
def open_own_profile_popup(self):
|
||||
click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)
|
||||
click_obj_by_name(MainScreenComponents.USERSTATUSMENU_OPEN_PROFILE_POPUP.value)
|
||||
|
||||
def verify_profile_popup_display_name(self, display_name: str):
|
||||
verify_text_matching(ProfilePopup.DISPLAY_NAME.value, display_name)
|
||||
|
||||
def set_profile_popup_display_name(self, display_name: str):
|
||||
click_obj_by_name(ProfilePopup.DISPLAY_NAME_EDIT_ICON.value)
|
||||
name_changed = setText(DisplayNamePopup.DISPLAY_NAME_INPUT.value, display_name)
|
||||
verify(name_changed, "set display name")
|
||||
click_obj_by_name(DisplayNamePopup.DISPLAY_NAME_OK_BUTTON.value)
|
||||
|
|
|
@ -64,12 +64,6 @@ class PasswordStrengthPossibilities(Enum):
|
|||
class MainScreen(Enum):
|
||||
SETTINGS_BUTTON = "settings_navbar_settings_icon_StatusIcon"
|
||||
|
||||
class UserContextStatusMenu(Enum):
|
||||
USER_CONTEXT_MENU_VIEW_MY_PROFILE_BUTTON: str = "userContextMenu_ViewMyProfile_Action"
|
||||
|
||||
class MyProfileModal(Enum):
|
||||
MY_PROFILE_MODAL_USER_IMAGE: str = "myProfileModal_UserImage"
|
||||
|
||||
class LoginView(Enum):
|
||||
LOGIN_VIEW_USER_IMAGE: str = "loginView_userImage"
|
||||
PASSWORD_INPUT = "loginView_passwordInput"
|
||||
|
@ -201,7 +195,7 @@ class StatusWelcomeScreen:
|
|||
|
||||
def profile_modal_image_is_updated(self):
|
||||
click_obj_by_name(MainScreenComponents.PROFILE_NAVBAR_BUTTON.value)
|
||||
click_obj_by_name(UserContextStatusMenu.USER_CONTEXT_MENU_VIEW_MY_PROFILE_BUTTON.value)
|
||||
click_obj_by_name(MainScreenComponents.USERSTATUSMENU_OPEN_PROFILE_POPUP.value)
|
||||
imagePresent("profiletestimage", True, 97, 95, 100, True)
|
||||
|
||||
def profile_settings_image_is_updated(self):
|
||||
|
|
|
@ -12,7 +12,10 @@ mainWindow_ProfileNavBarButton = {"container": statusDesktop_mainWindow, "object
|
|||
settings_navbar_settings_icon_StatusIcon = {"container": mainWindow_navBarListView_ListView, "objectName": "settings-icon", "type": "StatusIcon", "visible": True}
|
||||
|
||||
# User Status Profile Menu
|
||||
userContextMenu_ViewMyProfile_Action = {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusViewMyProfileAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextmenu_AlwaysActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAlwaysOnlineAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextmenu_InActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuInactiveAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextmenu_AutomaticButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAutomaticAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextMenu_ViewMyProfileAction = {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusViewMyProfileAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
|
||||
# popups
|
||||
modal_Close_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "modalCloseButtonRectangle", "type": "Rectangle", "visible": True}
|
||||
|
@ -22,3 +25,11 @@ mainWindow_public_chat_icon_StatusIcon = {"container": statusDesktop_mainWindow,
|
|||
chatList_Repeater = {"container": statusDesktop_mainWindow, "objectName": "chatListItems", "type": "Repeater"}
|
||||
mainWindow_startChat = {"checkable": True, "container": statusDesktop_mainWindow, "objectName": "startChatButton", "type": "StatusIconTabButton"}
|
||||
join_public_chat_StatusMenuItemDelegate = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "text": "Join public chat", "type": "StatusMenuItemDelegate", "unnamed": 1, "visible": True}
|
||||
|
||||
# My Profile Popup
|
||||
ProfileHeader_userImage = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileHeader_userImage", "type": "UserImage", "visible": True}
|
||||
ProfileHeader_displayName = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileHeader_displayName", "type": "StyledText", "visible": True}
|
||||
ProfileHeader_displayNameEditIcon = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileHeader_displayNameEditIcon", "type": "SVGImage", "visible": True}
|
||||
DisplayNamePopup_displayNameInput = {"container": statusDesktop_mainWindow_overlay, "objectName": "DisplayNamePopup_displayNameInput", "type": "TextEdit", "visible": True}
|
||||
DisplayNamePopup_okButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "DisplayNamePopup_okButton", "type": "StatusButton", "visible": True}
|
||||
|
||||
|
|
|
@ -107,9 +107,6 @@ languageView_language_StatusPickerButton = {"container": languageView_language_S
|
|||
languageView_language_ListView = {"container": languageView_language_StatusListPicker, "type": "ListView", "unnamed": 1}
|
||||
languageView_language_StatusInput = {"container": languageView_language_ListView, "type": "StatusInput", "unnamed": 1}
|
||||
|
||||
# My Profile Modal
|
||||
myProfileModal_UserImage = {"container": statusDesktop_mainWindow_overlay, "objectName": "myProfileModalUserImage", "type": "UserImage", "visible": True}
|
||||
|
||||
# Backup seed phrase:
|
||||
backup_seed_phrase_popup_Acknowledgements_havePen_checkbox = {"container": statusDesktop_mainWindow_overlay, "objectName": "Acknowledgements_havePen", "type": "StatusCheckBox", "checkable": True, "visible": True}
|
||||
backup_seed_phrase_popup_Acknowledgements_writeDown_checkbox = {"container": statusDesktop_mainWindow_overlay, "objectName": "Acknowledgements_writeDown", "type": "StatusCheckBox", "checkable": True, "visible": True}
|
||||
|
@ -123,9 +120,3 @@ backup_seed_phrase_popup_BackupSeedStepBase_confirmSecondWord = {"container": st
|
|||
backup_seed_phrase_popup_BackupSeedStepBase_confirmSecondWord_inputText = {"container": backup_seed_phrase_popup_BackupSeedStepBase_confirmSecondWord, "objectName": "BackupSeedStepBase_inputText", "type": "TextEdit", "visible": True}
|
||||
backup_seed_phrase_popup_ConfirmStoringSeedPhrasePanel_storeCheck = {"container": statusDesktop_mainWindow_overlay, "objectName": "ConfirmStoringSeedPhrasePanel_storeCheck", "type": "StatusCheckBox", "checkable": True, "visible": True}
|
||||
backup_seed_phrase_popup_BackupSeedModal_completeAndDeleteSeedPhraseButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "BackupSeedModal_completeAndDeleteSeedPhraseButton", "type": "StatusButton", "visible": True}
|
||||
|
||||
# User Status Profile Menu
|
||||
userContextmenu_AlwaysActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAlwaysOnlineAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextmenu_InActiveButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuInactiveAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
userContextmenu_AutomaticButton= {"container": statusDesktop_mainWindow_overlay, "objectName": "userStatusMenuAutomaticAction", "type": "StatusMenuItemDelegate", "visible": True}
|
||||
|
||||
|
|
|
@ -174,3 +174,15 @@ def step(context: any):
|
|||
@Then("the user status is automatic")
|
||||
def step(context: any):
|
||||
_statusMain.user_is_set_to_automatic()
|
||||
|
||||
@When("the user opens own profile popup")
|
||||
def step(context: any):
|
||||
_statusMain.open_own_profile_popup()
|
||||
|
||||
@Then("in profile popup the user's display name should be \"|any|\"")
|
||||
def step(context, display_name):
|
||||
_statusMain.verify_profile_popup_display_name(display_name)
|
||||
|
||||
@When("in profile popup the user sets display name to \"|any|\"")
|
||||
def step(context, display_name):
|
||||
_statusMain.set_profile_popup_display_name(display_name)
|
|
@ -36,9 +36,11 @@ Feature: Status Desktop Settings Menu
|
|||
And the user tester123 logs in with password TesTEr16843/!@00
|
||||
Then the user appears online
|
||||
|
||||
Scenario: The user can switch his state to automatic
|
||||
Scenario: The user can switch his state to automatic
|
||||
When the users switches his state to automatic
|
||||
Then the user status is automatic
|
||||
When the user restarts the app
|
||||
And the user tester123 logs in with password TesTEr16843/!@00
|
||||
Then the user status is automatic
|
||||
|
||||
|
||||
|
|
|
@ -2,10 +2,12 @@ Feature: User Identity
|
|||
|
||||
As a user I want to set my identity, that is: display name, bio and social links.
|
||||
|
||||
Scenario: User sets display name, bio and social links
|
||||
Background: Sign up and land
|
||||
Given A first time user lands on the status desktop and generates new key
|
||||
When user signs up with username tester123 and password TesTEr16843/!@00
|
||||
Then the user lands on the signed in app
|
||||
|
||||
Scenario: User sets display name, bio and social links
|
||||
When the user opens app settings screen
|
||||
And the user opens the profile settings
|
||||
Then the user's display name should be "tester123"
|
||||
|
@ -22,3 +24,9 @@ Feature: User Identity
|
|||
Then the user's display name should be "tester123_changed"
|
||||
And the user's bio should be "Hello, I am super tester!"
|
||||
And the user's social links should be: "twitter_handle", personal site: "status.im", "customLink": "customUrl"
|
||||
|
||||
Scenario: The user sets can change own display name in profile popup
|
||||
When the user opens own profile popup
|
||||
Then in profile popup the user's display name should be "tester123"
|
||||
When in profile popup the user sets display name to "tester123_changed"
|
||||
Then in profile popup the user's display name should be "tester123_changed"
|
|
@ -72,7 +72,7 @@ Item {
|
|||
|
||||
UserImage {
|
||||
id: userImage
|
||||
objectName: "myProfileModalUserImage"
|
||||
objectName: "ProfileHeader_userImage"
|
||||
name: root.displayName
|
||||
pubkey: root.pubkey
|
||||
image: root.icon
|
||||
|
@ -122,6 +122,7 @@ Item {
|
|||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: root.displayNamePlusIconsVisible
|
||||
StyledText {
|
||||
objectName: "ProfileHeader_displayName"
|
||||
Layout.maximumWidth: root.width - Style.current.xlPadding
|
||||
text: root.displayName
|
||||
elide: Text.ElideRight
|
||||
|
@ -153,6 +154,7 @@ Item {
|
|||
|
||||
Loader {
|
||||
sourceComponent: SVGImage {
|
||||
objectName: "ProfileHeader_displayNameEditIcon"
|
||||
height: compact ? 10 : 16
|
||||
width: compact ? 10 : 16
|
||||
source: Style.svg("edit-message")
|
||||
|
|
|
@ -23,6 +23,7 @@ StatusModal {
|
|||
contentItem: Item {
|
||||
StatusInput {
|
||||
id: displayNameInput
|
||||
input.edit.objectName: "DisplayNamePopup_displayNameInput"
|
||||
width: parent.width - Style.current.padding
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.padding
|
||||
|
@ -35,7 +36,8 @@ StatusModal {
|
|||
|
||||
rightButtons: [
|
||||
StatusButton {
|
||||
id: doneBtn
|
||||
id: okBtn
|
||||
objectName: "DisplayNamePopup_okButton"
|
||||
text: qsTr("OK")
|
||||
enabled: !!displayNameInput.text && displayNameInput.valid
|
||||
onClicked: {
|
||||
|
|
Loading…
Reference in New Issue