From 717bb0c53b527440c173fe659893baeaf8902eb8 Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Tue, 29 Apr 2025 11:27:45 +0100 Subject: [PATCH] fix(integration-tests): Fix issues relating to send flow integration tests. This change: - Handles the slider during the send confirmation flow during the send integration test - Adds the missing seeds for the restore flow to the relevant workflow files --- .../workflows/automated_integration_test.yml | 4 + .github/workflows/pr_test_build_linux.yml | 3 + integration_test/robots/send_page_robot.dart | 5 +- .../widgets/standard_slide_button_widget.dart | 144 ++++++++++-------- 4 files changed, 87 insertions(+), 69 deletions(-) diff --git a/.github/workflows/automated_integration_test.yml b/.github/workflows/automated_integration_test.yml index 2a6edfa04..f3b147f82 100644 --- a/.github/workflows/automated_integration_test.yml +++ b/.github/workflows/automated_integration_test.yml @@ -150,6 +150,8 @@ jobs: echo "const tronTestWalletSeeds = '${{ secrets.TRON_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const nanoTestWalletSeeds = '${{ secrets.NANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const wowneroTestWalletSeeds = '${{ secrets.WOWNERO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart + echo "const zanoTestWalletSeeds = '${{ secrets.ZANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart + echo "const decredTestWalletSeeds = '${{ secrets.DECRED_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const moneroTestWalletReceiveAddress = '${{ secrets.MONERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const bitcoinTestWalletReceiveAddress = '${{ secrets.BITCOIN_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const ethereumTestWalletReceiveAddress = '${{ secrets.ETHEREUM_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart @@ -160,6 +162,8 @@ jobs: echo "const tronTestWalletReceiveAddress = '${{ secrets.TRON_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart + echo "const zanoTestWalletReceiveAddress = '${{ secrets.ZANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart + echo "const decredTestWalletReceiveAddress = '${{ secrets.DECRED_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart # end of test secrets echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart diff --git a/.github/workflows/pr_test_build_linux.yml b/.github/workflows/pr_test_build_linux.yml index 1d54e3c8c..1b50af24a 100644 --- a/.github/workflows/pr_test_build_linux.yml +++ b/.github/workflows/pr_test_build_linux.yml @@ -153,6 +153,7 @@ jobs: echo "const nanoTestWalletSeeds = '${{ secrets.NANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const wowneroTestWalletSeeds = '${{ secrets.WOWNERO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const zanoTestWalletSeeds = '${{ secrets.ZANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart + echo "const decredTestWalletSeeds = '${{ secrets.DECRED_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart echo "const moneroTestWalletReceiveAddress = '${{ secrets.MONERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const bitcoinTestWalletReceiveAddress = '${{ secrets.BITCOIN_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const ethereumTestWalletReceiveAddress = '${{ secrets.ETHEREUM_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart @@ -163,6 +164,8 @@ jobs: echo "const tronTestWalletReceiveAddress = '${{ secrets.TRON_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart + echo "const zanoTestWalletReceiveAddress = '${{ secrets.ZANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart + echo "const decredTestWalletReceiveAddress = '${{ secrets.DECRED_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart # end of test secrets echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart diff --git a/integration_test/robots/send_page_robot.dart b/integration_test/robots/send_page_robot.dart index 9dd913bf5..e42169974 100644 --- a/integration_test/robots/send_page_robot.dart +++ b/integration_test/robots/send_page_robot.dart @@ -231,7 +231,7 @@ class SendPageRobot { } catch (e) { tester.printToConsole('Auth failed, retrying'); await tester.pump(); - _handleAuthPage(); + await _handleAuthPage(); } } await tester.pump(); @@ -309,8 +309,7 @@ class SendPageRobot { final double sliderWidth = state.sliderWidth; final double threshold = effectiveMaxWidth - sliderWidth - 10; - final sliderFinder = - find.byKey(const ValueKey('standard_slide_button_widget_slider_container_key')); + final sliderFinder = find.byKey(const ValueKey('standard_slide_button_widget_slider_key')); expect(sliderFinder, findsOneWidget); // Using the center of the container as the drag start. diff --git a/lib/src/widgets/standard_slide_button_widget.dart b/lib/src/widgets/standard_slide_button_widget.dart index ecb8be556..e15a1d417 100644 --- a/lib/src/widgets/standard_slide_button_widget.dart +++ b/lib/src/widgets/standard_slide_button_widget.dart @@ -44,73 +44,85 @@ class StandardSlideButtonState extends State { ? Colors.black.withOpacity(0.5) : Theme.of(context).extension()!.buttonColor; - return accessible - ? PrimaryButton( - text: widget.accessibleNavigationModeButtonText, - color: Theme.of(context).primaryColor, - textColor: Colors.white, - onPressed: () => widget.onSlideComplete()) - : LayoutBuilder(builder: (context, constraints) { - final double maxWidth = constraints.maxWidth; - const double sideMargin = 4.0; - final double effectiveMaxWidth = maxWidth - 2 * sideMargin; - const double sliderWidth = 42.0; + if (accessible) { + return PrimaryButton( + text: widget.accessibleNavigationModeButtonText, + color: Theme.of(context).primaryColor, + textColor: Colors.white, + onPressed: widget.onSlideComplete, + ); + } - return Container( - height: widget.height, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: tileBackgroundColor), - child: Stack( - alignment: Alignment.centerLeft, - children: [ - Center( - child: Text(widget.buttonText, - style: TextStyle( - fontSize: 16, - fontFamily: 'Lato', - fontWeight: FontWeight.w600, - color: Theme.of(context).extension()!.titleColor))), - Positioned( - left: sideMargin + _dragPosition, - child: GestureDetector( - key: ValueKey('standard_slide_button_widget_slider_key'), - onHorizontalDragUpdate: (details) { - setState(() { - _dragPosition += details.delta.dx; - if (_dragPosition < 0) _dragPosition = 0; - if (_dragPosition > effectiveMaxWidth - sliderWidth) { - _dragPosition = effectiveMaxWidth - sliderWidth; - } - }); - }, - onHorizontalDragEnd: (details) { - if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) { - widget.onSlideComplete(); - } else { - setState(() => _dragPosition = 0); - } - }, - child: Container( - key: ValueKey('standard_slide_button_widget_slider_container_key'), - width: sliderWidth, - height: widget.height - 8, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Theme.of(context).extension()!.titleColor, - ), - alignment: Alignment.center, - child: Icon( - key: ValueKey('standard_slide_button_widget_slider_icon_key'), - Icons.arrow_forward, - color: widget.currentTheme.type == ThemeType.bright - ? Theme.of(context).extension()!.backgroundColor - : Theme.of(context).extension()!.buttonColor), - ), - ), - ) - ], + return LayoutBuilder( + builder: (context, constraints) { + final maxWidth = constraints.maxWidth; + sideMargin = 4.0; + effectiveMaxWidth = maxWidth - 2 * sideMargin; + sliderWidth = 42.0; + + return Container( + height: widget.height, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: tileBackgroundColor, + ), + child: Stack( + alignment: Alignment.centerLeft, + children: [ + Center( + child: Text( + widget.buttonText, + style: TextStyle( + fontSize: 16, + fontFamily: 'Lato', + fontWeight: FontWeight.w600, + color: Theme.of(context).extension()!.titleColor, + ), + ), ), - ); - }); + Positioned( + left: sideMargin + _dragPosition, + child: GestureDetector( + key: ValueKey('standard_slide_button_widget_slider_key'), + onHorizontalDragUpdate: (details) { + setState(() { + _dragPosition += details.delta.dx; + if (_dragPosition < 0) _dragPosition = 0; + if (_dragPosition > effectiveMaxWidth - sliderWidth) { + _dragPosition = effectiveMaxWidth - sliderWidth; + } + }); + }, + onHorizontalDragEnd: (details) { + if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) { + widget.onSlideComplete(); + } else { + setState(() => _dragPosition = 0); + } + }, + child: Container( + key: ValueKey('standard_slide_button_widget_slider_container_key'), + width: sliderWidth, + height: widget.height - 8, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Theme.of(context).extension()!.titleColor, + ), + alignment: Alignment.center, + child: Icon( + key: ValueKey('standard_slide_button_widget_slider_icon_key'), + Icons.arrow_forward, + color: widget.currentTheme.type == ThemeType.bright + ? Theme.of(context).extension()!.backgroundColor + : Theme.of(context).extension()!.buttonColor, + ), + ), + ), + ), + ], + ), + ); + }, + ); } }