CW-942-New-Swap-UI-Flow (#2036)

* feat: Implement New Swap UI including fee items and coin control and extract common fee logic to a feeViewModel, use that in SendViewModel and ExchangeViewModel

* feat: Implement New Swap UI with fee items and coin control and extract common fee logic to a feeViewModel for use in SendViewModel and ExchangeViewModel

* Update colors

* Show warning if user choose a below default transaction priority

* fix: Add warning when user select less than default transaction priority and add condition to show extraId

* Complete Swap UI flow

* Handle edgecases for XRP

* Switch swap page button texts

* Handle edgecases for XLM

* Switch prompt text and handle edgecases

---------

Co-authored-by: tuxpizza <tuxsudo@tux.pizza>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
David Adegoke 2025-03-14 17:31:31 +01:00 committed by GitHub
parent 0f301a71a2
commit 9f3078740e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 1048 additions and 327 deletions

View file

@ -84,7 +84,7 @@ void main() {
exchangeTradePageRobot.hasInformationDialog();
await exchangeTradePageRobot.onGotItButtonPressed();
await exchangeTradePageRobot.onConfirmSendingButtonPressed();
await exchangeTradePageRobot.onSendFromCakeButtonPressed();
await exchangeTradePageRobot.handleConfirmSendResult();

View file

@ -27,11 +27,11 @@ class ExchangeTradePageRobot {
await commonTestCases.defaultSleepTime();
}
Future<void> onConfirmSendingButtonPressed() async {
tester.printToConsole('Now confirming sending');
Future<void> onSendFromCakeButtonPressed() async {
tester.printToConsole('Now sending from cake');
await commonTestCases.tapItemByKey(
'exchange_trade_page_confirm_sending_button_key',
'exchange_trade_page_send_from_cake_button_key',
shouldPumpAndSettle: false,
);
@ -134,7 +134,7 @@ class ExchangeTradePageRobot {
await commonTestCases.defaultSleepTime();
await onConfirmSendingButtonPressed();
await onSendFromCakeButtonPressed();
tester.printToConsole('Confirm sending button tapped');
hasError = await hasErrorWhileSending();

View file

@ -51,7 +51,7 @@ class SendPageRobot {
commonTestCases.hasValueKey('send_page_fiat_amount_textfield_key');
}
if (sendViewModel.hasFees) {
if (sendViewModel.feesViewModel.hasFees) {
commonTestCases.hasValueKey('send_page_select_fee_priority_button_key');
}
@ -104,12 +104,12 @@ class SendPageRobot {
SendPage sendPage = tester.widget(find.byType(SendPage));
final sendViewModel = sendPage.sendViewModel;
if (!sendViewModel.hasFees || priority == null) return;
if (!sendViewModel.feesViewModel.hasFees || priority == null) return;
final transactionPriorityPickerKey = 'send_page_select_fee_priority_button_key';
await commonTestCases.tapItemByKey(transactionPriorityPickerKey);
if (priority == sendViewModel.transactionPriority) {
if (priority == sendViewModel.feesViewModel.transactionPriority) {
await commonTestCases
.tapItemByKey('picker_items_index_${priority.title}_selected_item_button_key');
return;
@ -188,8 +188,8 @@ class SendPageRobot {
await authPageRobot.enterPinCode(CommonTestConstants.pin);
}
final onAuthPageDesktop = authPageRobot.onAuthPageDesktop();
if (onAuthPageDesktop) {
final onAuthPageDesktop = authPageRobot.onAuthPageDesktop();
if (onAuthPageDesktop) {
await authPageRobot.enterPassword(CommonTestConstants.pin.join(""));
}
}