feat(@DesktopApp): Login- 12 Seed Phrase

https://github.com/status-im/status-desktop/issues/6274

Login for 12 seed Phrase
This commit is contained in:
femi 2022-06-29 02:12:35 +01:00 committed by Olufemi Ade-Olusile
parent 1da749ebe9
commit 00dc09fb18
8 changed files with 188 additions and 6 deletions

View File

@ -0,0 +1,34 @@
# ******************************************************************************
# Status.im
# *****************************************************************************/
# /**
# * \file SettingsScreen.py
# *
# * \date June 2022
# * \brief Home Screen.
# *****************************************************************************/
from enum import Enum
from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *
class MainScreenComponents(Enum):
ADVANCED_OPTION = "advanced_StatusBaseText"
class AdvancedOptionScreen(Enum):
ACTIVATE_OR_DEACTIVATE_WALLET = "o_StatusSettingsLineButton"
I_UNDERSTAND_POP_UP = "i_understand_StatusBaseText"
class SettingsScreen:
def __init__(self):
verify_screen(MainScreenComponents.ADVANCED_OPTION.value)
def activate_wallet(self):
click_obj_by_name(MainScreenComponents.ADVANCED_OPTION.value)
click_obj_by_name(AdvancedOptionScreen.ACTIVATE_OR_DEACTIVATE_WALLET.value)
click_obj_by_name(AdvancedOptionScreen.I_UNDERSTAND_POP_UP.value)

View File

@ -18,6 +18,7 @@ class MainScreenComponents(Enum):
STATUS_ICON = "mainWindow_statusIcon_StatusIcon_2"
PUBLIC_CHAT_ICON = "mainWindow_dropRectangle_Rectangle"
JOIN_PUBLIC_CHAT = "join_public_chat_StatusMenuItemDelegate"
SETTINGS_BUTTON = "statusIcon_StatusIcon_4"
class ChatNamePopUp(Enum):
@ -36,3 +37,8 @@ class StatusMainScreen:
click_obj_by_name(MainScreenComponents.JOIN_PUBLIC_CHAT.value)
type(ChatNamePopUp.INPUT_ROOM_TOPIC_TEXT.value, room)
click_obj_by_name(ChatNamePopUp.START_CHAT.value)
def open_settings(self):
click_obj_by_name(MainScreenComponents.SETTINGS_BUTTON.value)

View File

@ -35,6 +35,16 @@ class SignUpComponents(Enum):
FINALIZE_PASSWORD_STEP = "mainWindow_Finalise_Status_Password_Creation_StatusBaseText"
PASSWORD_PREFERENCE = "mainWindow_I_prefer_to_use_my_password_StatusBaseText"
class SeedPhraseComponents(Enum):
IMPORT_A_SEED_TEXT = "import_a_seed_phrase_StatusBaseText"
IMPORT_A_SEED_BUTTON = "mainWindow_button_StatusButton"
TWELVE_WORDS_BUTTON = "switchTabBar_12_words_StatusBaseText"
EIGHTEEN_WORDS_BUTTON = "switchTabBar_18_words_StatusBaseText"
TWENTY_FOUR_BUTTON = "switchTabBar_24_words_StatusBaseText"
SEEDS_WORDS_TEXTFIELD = "mainWindow_placeholder_StatusBaseText"
SUBMIT_BUTTON = "mainWindow_submitButton_StatusButton"
class StatusWelcomeScreen:
@ -42,12 +52,28 @@ class StatusWelcomeScreen:
verify_screen(AgreementPopUp.OK_GOT_IT_BUTTON.value)
def agree_terms_conditions_and_generate_new_key(self):
click_obj_by_name(AgreementPopUp.OK_GOT_IT_BUTTON.value)
click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
check_obj_by_name(AgreementPopUp.TERMS_OF_USE_CHECK_BOX.value)
click_obj_by_name(AgreementPopUp.GET_STARTED_BUTTON.value)
click_obj_by_name(SignUpComponents.NEW_TO_STATUS.value)
self._agree_terms_and_conditions()
click_obj_by_name(SignUpComponents.GENERATE_NEW_KEYS.value)
def agree_terms_conditions_and_navigate_to_import_seed_phrase(self):
self._agree_terms_and_conditions()
click_obj_by_name(SeedPhraseComponents.IMPORT_A_SEED_TEXT.value)
click_obj_by_name(SeedPhraseComponents.IMPORT_A_SEED_BUTTON.value)
def input_seed_phrase(self, seed, words, occurrences):
if words =='18':
click_obj_by_name(SeedPhraseComponents.EIGHTEEN_WORDS_BUTTON.value)
if words == '24':
click_obj_by_name(SeedPhraseComponents.TWENTY_FOUR_BUTTON.value)
if words == '12':
click_obj_by_name(SeedPhraseComponents.TWELVE_WORDS_BUTTON.value)
type(SeedPhraseComponents.SEEDS_WORDS_TEXTFIELD.value, seed)
def input_username_and_password_and_finalize_sign_up(self, username, password):
self.input_username(username)
@ -72,3 +98,11 @@ class StatusWelcomeScreen:
def input_confirmation_password(self, password):
type(SignUpComponents.PASSWORD_CONFIRM_INPUT.value, password)
click_obj_by_name(SignUpComponents.CREATE_PASSWORD.value)
def _agree_terms_and_conditions(self):
click_obj_by_name(AgreementPopUp.OK_GOT_IT_BUTTON.value)
click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
check_obj_by_name(AgreementPopUp.TERMS_OF_USE_CHECK_BOX.value)
click_obj_by_name(AgreementPopUp.GET_STARTED_BUTTON.value)
click_obj_by_name(SignUpComponents.NEW_TO_STATUS.value)

View File

@ -56,3 +56,58 @@ scrollView_messageInputField_TextArea = {"container": mainWindow_scrollView_Scro
reactionImage_SVGImage = {"container": statusDesktop_mainWindow_overlay, "id": "reactionImage", "source": "qrc:/imports/assets/icons/emojiReactions/heart.svg", "type": "SVGImage", "unnamed": 1, "visible": True}
mainWindow_statusIcon_StatusIcon_2 = {"container": statusDesktop_mainWindow, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/public-chat.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
scrollView_Type_a_message_PlaceholderText = {"container": mainWindow_scrollView_ScrollView, "text": "Type a message.", "type": "PlaceholderText", "unnamed": 1, "visible": True}
import_a_seed_phrase_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Import a seed phrase", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText = {"container": statusDesktop_mainWindow, "id": "placeholder", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_2 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 7, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Image = {"container": statusDesktop_mainWindow, "source": "qrc:/imports/assets/png/traffic_lights/close.png", "type": "Image", "unnamed": 1, "visible": True}
mainWindow_edit_TextEdit_2 = {"container": statusDesktop_mainWindow, "id": "edit", "occurrence": 7, "type": "TextEdit", "unnamed": 1, "visible": True}
mainWindow_edit_TextEdit_3 = {"container": statusDesktop_mainWindow, "id": "edit", "occurrence": 2, "type": "TextEdit", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_3 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 5, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_edit_TextEdit_4 = {"container": statusDesktop_mainWindow, "id": "edit", "occurrence": 8, "type": "TextEdit", "unnamed": 1, "visible": True}
mainWindow_btnOk_StatusButton = {"container": statusDesktop_mainWindow, "id": "btnOk", "type": "StatusButton", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_4 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 6, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Rectangle_2 = {"container": statusDesktop_mainWindow, "occurrence": 32, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_switchTabBar_StatusSwitchTabBar = {"container": statusDesktop_mainWindow, "id": "switchTabBar", "type": "StatusSwitchTabBar", "unnamed": 1, "visible": True}
switchTabBar_18_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "18 words", "type": "StatusBaseText", "unnamed": 1, "visible": True}
switchTabBar_24_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "24 words", "type": "StatusBaseText", "unnamed": 1, "visible": True}
switchTabBar_12_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "12 words", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_5 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 2, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_6 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 8, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_7 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 3, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_8 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 9, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_9 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 4, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_10 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 10, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_11 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 11, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_grid_GridView = {"container": statusDesktop_mainWindow, "id": "grid", "type": "GridView", "unnamed": 1, "visible": True}
grid_seedWordInput_StatusSeedPhraseInput = {"container": mainWindow_grid_GridView, "id": "seedWordInput", "index": 5, "type": "StatusSeedPhraseInput", "unnamed": 1, "visible": True}
seedWordInput_background_Rectangle = {"container": grid_seedWordInput_StatusSeedPhraseInput, "id": "background", "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_placeholder_StatusBaseText_12 = {"container": statusDesktop_mainWindow, "id": "placeholder", "occurrence": 12, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_statusIcon_StatusIcon_3 = {"container": statusDesktop_mainWindow, "id": "statusIcon", "occurrence": 3, "source": "qrc:/StatusQ/src/assets/img/icons/arrow-left.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
mainWindow_statusIcon_StatusIcon_4 = {"container": statusDesktop_mainWindow, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/arrow-left.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
mainWindow_Rectangle_3 = {"container": statusDesktop_mainWindow, "occurrence": 4, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_edit_TextEdit_5 = {"container": statusDesktop_mainWindow, "id": "edit", "occurrence": 3, "type": "TextEdit", "unnamed": 1, "visible": True}
grid_seedWordInput_StatusSeedPhraseInput_2 = {"container": mainWindow_grid_GridView, "id": "seedWordInput", "index": 2, "type": "StatusSeedPhraseInput", "unnamed": 1, "visible": True}
seedWordInput_seedSuggestionsList_ListView = {"container": grid_seedWordInput_StatusSeedPhraseInput_2, "id": "seedSuggestionsList", "type": "ListView", "unnamed": 1, "visible": True}
seedSuggestionsList_txtDelegate_Item = {"container": seedWordInput_seedSuggestionsList_ListView, "id": "txtDelegate", "index": 0, "type": "Item", "unnamed": 1, "visible": True}
txtDelegate_Rectangle = {"container": seedSuggestionsList_txtDelegate_Item, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_edit_TextEdit_6 = {"container": statusDesktop_mainWindow, "id": "edit", "occurrence": 4, "type": "TextEdit", "unnamed": 1, "visible": True}
grid_seedWordInput_StatusSeedPhraseInput_3 = {"container": mainWindow_grid_GridView, "id": "seedWordInput", "index": 3, "type": "StatusSeedPhraseInput", "unnamed": 1, "visible": True}
seedWordInput_seedSuggestionsList_ListView_2 = {"container": grid_seedWordInput_StatusSeedPhraseInput_3, "id": "seedSuggestionsList", "type": "ListView", "unnamed": 1, "visible": True}
seedSuggestionsList_txtDelegate_Item_2 = {"container": seedWordInput_seedSuggestionsList_ListView_2, "id": "txtDelegate", "index": 0, "type": "Item", "unnamed": 1, "visible": True}
txtDelegate_survey_StatusBaseText = {"container": seedSuggestionsList_txtDelegate_Item_2, "text": "survey", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Restore_Status_Profile_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Restore Status Profile", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Rectangle_4 = {"container": statusDesktop_mainWindow, "occurrence": 31, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_submitButton_StatusButton = {"container": statusDesktop_mainWindow, "id": "submitButton", "type": "StatusButton", "unnamed": 1, "visible": True}
i_understand_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "I understand", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_navBarListView_ListView = {"container": statusDesktop_mainWindow, "id": "navBarListView", "type": "ListView", "unnamed": 1, "visible": True}
navBarListView_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "occurrence": 3, "type": "StatusNavBarTabButton", "unnamed": 1, "visible": True}
statusIcon_StatusIcon_3 = {"container": navBarListView_StatusNavBarTabButton, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/settings.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
mainWindow_ScrollView = {"container": statusDesktop_mainWindow, "type": "ScrollView", "unnamed": 1, "visible": True}
privacy_and_security_StatusBaseText = {"container": mainWindow_ScrollView, "text": "Privacy and security", "type": "StatusBaseText", "unnamed": 1, "visible": True}
settingsMenuDelegate_StatusNavigationListItem = {"container": mainWindow_ScrollView, "id": "settingsMenuDelegate", "occurrence": 4, "type": "StatusNavigationListItem", "unnamed": 1, "visible": True}
language_Currency_StatusBaseText = {"container": mainWindow_ScrollView, "text": "Language & Currency", "type": "StatusBaseText", "unnamed": 1, "visible": True}
advanced_StatusBaseText = {"container": mainWindow_ScrollView, "text": "Advanced", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_ScrollView_2 = {"container": statusDesktop_mainWindow, "occurrence": 2, "type": "ScrollView", "unnamed": 1, "visible": True}
o_StatusSettingsLineButton = {"container": mainWindow_ScrollView_2, "occurrence": 4, "type": "StatusSettingsLineButton", "unnamed": 1, "visible": True}
navBarListView_StatusNavBarTabButton_2 = {"checkable": True, "container": mainWindow_navBarListView_ListView, "occurrence": 2, "type": "StatusNavBarTabButton", "unnamed": 1, "visible": True}
statusIcon_StatusIcon_4 = {"container": navBarListView_StatusNavBarTabButton_2, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/settings.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}

View File

@ -0,0 +1,17 @@
from screens.StatusMainScreen import StatusMainScreen
from screens.SettingsScreen import SettingsScreen
_statusMain = StatusMainScreen()
_settingsScreen =SettingsScreen()
@When("the user opens app settings screen")
def step(context):
_statusMain.open_settings()
@When("the user activates wallet")
def step(context):
_settingsScreen.activate_wallet()

View File

@ -9,6 +9,11 @@ def step(context):
_welcomeScreen.agree_terms_conditions_and_generate_new_key()
@Given("A first time user lands on the status desktop and navigates to import seed phrase")
def step(context):
_welcomeScreen.agree_terms_conditions_and_navigate_to_import_seed_phrase()
@When("user signs up with username |any| and password |any|")
def step(context, username, password):
_welcomeScreen.input_username_and_password_and_finalize_sign_up(username, password)
@ -20,5 +25,11 @@ def step(context, username):
@Then("the user lands on the signed in app")
def step(context):
def step(context):
StatusMainScreen()
@When("The user inputs |any| seed phrases")
def step(context, seedPhraseAmount):
table = context.table
for row in table[1:]:
_welcomeScreen.input_seed_phrase(row[0], seedPhraseAmount, row[1])

View File

@ -73,3 +73,26 @@ Feature: Status Desktop Sign Up
| tester123 | Invalid34 | TesTEr16843/!@00 |
| tester123 | TesTEr16843/!@) | TesTEr16843/!@01 |
Scenario: User signs up with imported seed phrase
Given A first time user lands on the status desktop and navigates to import seed phrase
When The user inputs 12 seed phrases
| phrases | occurrence |
| lawn | 1 |
| corn | 3 |
| paddle | 5 |
| survey | 7 |
| shrimp | 9 |
| mind | 11 |
| select | 2 |
| gaze | 4 |
| arrest | 6 |
| pear | 8 |
| reduce | 10 |
| scan | 12 |
And user clicks on the following ui-component mainWindow_submitButton_StatusButton
When user signs up with username tester123 and password TesTEr16843/!@00
Then the user lands on the signed in app
When the user opens app settings screen
And the user activates wallet

View File

@ -117,6 +117,8 @@ OnboardingBasePage {
model: root.tabs
StatusSwitchTabButton {
text: qsTr("%1 words").arg(modelData)
id: seedPhraseWords
objectName: qsTr("%1SeedButton").arg(modelData)
}
}
onCurrentIndexChanged: {