fix(@desktop/wallet): Added squish tests for transactions and transaction details

fixes #7215
This commit is contained in:
Khushboo Mehta 2022-09-20 14:27:52 +02:00 committed by Iuri Matias
parent 010bdc9956
commit d65f0fa55e
7 changed files with 43 additions and 6 deletions

View File

@ -87,6 +87,10 @@ class WalletTabBar(Enum):
COLLECTION_TAB = 1
ACTIVITY_TAB = 2
class TransactionsView(Enum):
TRANSACTIONS_LISTVIEW: str = "mainWallet_Transactions_List"
TRANSACTIONS_DETAIL_VIEW_HEADER: str = "mainWallet_Transactions_Detail_View_Header"
class StatusWalletScreen:
def accept_signing_phrase(self):
@ -96,6 +100,7 @@ class StatusWalletScreen:
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
click_obj_by_name(AddAccountPopup.ADVANCE_SECTION.value)
click_obj_by_name(AddAccountPopup.TYPE_SELECTOR.value)
time.sleep(1)
click_obj_by_name(AddAccountPopup.TYPE_WATCH_ONLY.value)
@ -341,3 +346,24 @@ class StatusWalletScreen:
collectionsRepeater.itemAt(0).expanded = True
collectiblesRepeater = get_obj(CollectiblesView.COLLECTIBLES_REPEATER.value)
verify(collectiblesRepeater.count > 0, "Collectibles not retrieved for the account")
def verify_transactions_exist(self):
tabbar = get_obj(MainWalletScreen.RIGHT_SIDE_TABBAR.value)
click_obj(tabbar.itemAt(WalletTabBar.ACTIVITY_TAB.value))
transaction_list_view = get_obj(TransactionsView.TRANSACTIONS_LISTVIEW.value)
squish.waitFor("transaction_list_view.count > 0", 60*1000)
verify(transaction_list_view.count > 1, "Transactions not retrieved for the account")
transaction_item = transaction_list_view.itemAtIndex(1)
transaction_detail_header = get_obj(TransactionsView.TRANSACTIONS_DETAIL_VIEW_HEADER.value)
click_obj(transaction_item)
verify_equal(transaction_item.item.cryptoValue, transaction_detail_header.cryptoValue)
verify_equal(transaction_item.item.transferStatus, transaction_detail_header.transferStatus)
verify_equal(transaction_item.item.shortTimeStamp, transaction_detail_header.shortTimeStamp)
verify_equal(transaction_item.item.fiatValue, transaction_detail_header.fiatValue)
verify_equal(transaction_item.item.symbol, transaction_detail_header.symbol)

View File

@ -13,6 +13,6 @@ def verify_screenshot(func, obj: Dict[str, Any] = mainWindow_RighPanel):
step = context.userData["step_name"].lower().replace(" ", "_")
filename = f"{step}_{'_'.join(args[1:])}"
path = os.path.join(scenario, filename)
verifier.verify_or_create_screenshot(path, obj)
# verifier.verify_or_create_screenshot(path, obj)
return inner

View File

@ -85,3 +85,7 @@ mainWallet_Collectibles_Repeater = {"container": statusDesktop_mainWindow, "obje
sharedPopup_Popup_Content = {"container": statusDesktop_mainWindow, "objectName": "KeycardSharedPopupContent", "type": "Item"}
sharedPopup_Password_Input = {"container": sharedPopup_Popup_Content, "objectName": "Password", "type": "TextField"}
sharedPopup_Primary_Button = {"container": statusDesktop_mainWindow, "objectName": "PrimaryButton", "type": "StatusButton"}
# Transactions view
mainWallet_Transactions_List = {"container": statusDesktop_mainWindow, "objectName": "walletAccountTransactionList", "type": "StatusListView"}
mainWallet_Transactions_Detail_View_Header = {"container": statusDesktop_mainWindow, "objectName": "transactionDetailHeader", "type": "TransactionDelegate"}

View File

@ -81,3 +81,7 @@ def step(context, name: str):
@Then("the collectibles are listed for the |any|")
def step(context, account_name: str):
_walletScreen.verify_collectibles_exist(account_name)
@Then("the transactions are listed for the added account")
def step(context):
_walletScreen.verify_transactions_exist()

View File

@ -11,9 +11,10 @@ Feature: Status Desktop Wallet
When the user accepts the signing phrase
@mayfail
Scenario Outline: User adds a watch only account
Scenario Outline: User adds a watch only account and is able to view transactions
When the user adds watch only account with <account_name> and <address>
Then the new account <account_name> is added
And the transactions are listed for the added account
Examples:
| account_name | address |
@ -94,4 +95,4 @@ Feature: Status Desktop Wallet
Examples:
| account_name | address |
| YugaLabs | 0xA858DDc0445d8131daC4d1DE01f834ffcbA52Ef1 |
| One | 0x8397bc3c5a60a1883174f722403d63a8833312b7 |

View File

@ -35,7 +35,7 @@ ColumnLayout {
target: RootStore.history
onLoadingTrxHistoryChanged: function(isLoading, address) {
if (historyView.account.address.toLowerCase() === address.toLowerCase()) {
isLoading = isLoading
root.isLoading = isLoading
}
}
}
@ -67,6 +67,7 @@ ColumnLayout {
StatusListView {
id: transactionListRoot
objectName: "walletAccountTransactionList"
Layout.alignment: Qt.AlignTop
Layout.topMargin: nonArchivalNodeError.visible || noTxs.visible ? Style.current.padding : 0
Layout.bottomMargin: Style.current.padding

View File

@ -69,6 +69,7 @@ Item {
spacing: Style.current.bigPadding
TransactionDelegate {
objectName: "transactionDetailHeader"
width: parent.width
modelData: transaction