Skip to content

Commit 717bb0c

Browse files
committed
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
1 parent 55d32ab commit 717bb0c

File tree

4 files changed

+86
-68
lines changed

4 files changed

+86
-68
lines changed

.github/workflows/automated_integration_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ jobs:
150150
echo "const tronTestWalletSeeds = '${{ secrets.TRON_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
151151
echo "const nanoTestWalletSeeds = '${{ secrets.NANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
152152
echo "const wowneroTestWalletSeeds = '${{ secrets.WOWNERO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
153+
echo "const zanoTestWalletSeeds = '${{ secrets.ZANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
154+
echo "const decredTestWalletSeeds = '${{ secrets.DECRED_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
153155
echo "const moneroTestWalletReceiveAddress = '${{ secrets.MONERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
154156
echo "const bitcoinTestWalletReceiveAddress = '${{ secrets.BITCOIN_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
155157
echo "const ethereumTestWalletReceiveAddress = '${{ secrets.ETHEREUM_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
@@ -160,6 +162,8 @@ jobs:
160162
echo "const tronTestWalletReceiveAddress = '${{ secrets.TRON_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
161163
echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
162164
echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
165+
echo "const zanoTestWalletReceiveAddress = '${{ secrets.ZANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
166+
echo "const decredTestWalletReceiveAddress = '${{ secrets.DECRED_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
163167
echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart
164168
# end of test secrets
165169
echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart

.github/workflows/pr_test_build_linux.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ jobs:
153153
echo "const nanoTestWalletSeeds = '${{ secrets.NANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
154154
echo "const wowneroTestWalletSeeds = '${{ secrets.WOWNERO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
155155
echo "const zanoTestWalletSeeds = '${{ secrets.ZANO_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
156+
echo "const decredTestWalletSeeds = '${{ secrets.DECRED_TEST_WALLET_SEEDS }}';" >> lib/.secrets.g.dart
156157
echo "const moneroTestWalletReceiveAddress = '${{ secrets.MONERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
157158
echo "const bitcoinTestWalletReceiveAddress = '${{ secrets.BITCOIN_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
158159
echo "const ethereumTestWalletReceiveAddress = '${{ secrets.ETHEREUM_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
@@ -163,6 +164,8 @@ jobs:
163164
echo "const tronTestWalletReceiveAddress = '${{ secrets.TRON_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
164165
echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
165166
echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
167+
echo "const zanoTestWalletReceiveAddress = '${{ secrets.ZANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
168+
echo "const decredTestWalletReceiveAddress = '${{ secrets.DECRED_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
166169
echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart
167170
# end of test secrets
168171
echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart

integration_test/robots/send_page_robot.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class SendPageRobot {
231231
} catch (e) {
232232
tester.printToConsole('Auth failed, retrying');
233233
await tester.pump();
234-
_handleAuthPage();
234+
await _handleAuthPage();
235235
}
236236
}
237237
await tester.pump();
@@ -309,8 +309,7 @@ class SendPageRobot {
309309
final double sliderWidth = state.sliderWidth;
310310
final double threshold = effectiveMaxWidth - sliderWidth - 10;
311311

312-
final sliderFinder =
313-
find.byKey(const ValueKey('standard_slide_button_widget_slider_container_key'));
312+
final sliderFinder = find.byKey(const ValueKey('standard_slide_button_widget_slider_key'));
314313
expect(sliderFinder, findsOneWidget);
315314

316315
// Using the center of the container as the drag start.

lib/src/widgets/standard_slide_button_widget.dart

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -44,73 +44,85 @@ class StandardSlideButtonState extends State<StandardSlideButton> {
4444
? Colors.black.withOpacity(0.5)
4545
: Theme.of(context).extension<FilterTheme>()!.buttonColor;
4646

47-
return accessible
48-
? PrimaryButton(
49-
text: widget.accessibleNavigationModeButtonText,
50-
color: Theme.of(context).primaryColor,
51-
textColor: Colors.white,
52-
onPressed: () => widget.onSlideComplete())
53-
: LayoutBuilder(builder: (context, constraints) {
54-
final double maxWidth = constraints.maxWidth;
55-
const double sideMargin = 4.0;
56-
final double effectiveMaxWidth = maxWidth - 2 * sideMargin;
57-
const double sliderWidth = 42.0;
47+
if (accessible) {
48+
return PrimaryButton(
49+
text: widget.accessibleNavigationModeButtonText,
50+
color: Theme.of(context).primaryColor,
51+
textColor: Colors.white,
52+
onPressed: widget.onSlideComplete,
53+
);
54+
}
5855

59-
return Container(
60-
height: widget.height,
61-
decoration: BoxDecoration(
62-
borderRadius: BorderRadius.circular(10), color: tileBackgroundColor),
63-
child: Stack(
64-
alignment: Alignment.centerLeft,
65-
children: [
66-
Center(
67-
child: Text(widget.buttonText,
68-
style: TextStyle(
69-
fontSize: 16,
70-
fontFamily: 'Lato',
71-
fontWeight: FontWeight.w600,
72-
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor))),
73-
Positioned(
74-
left: sideMargin + _dragPosition,
75-
child: GestureDetector(
76-
key: ValueKey('standard_slide_button_widget_slider_key'),
77-
onHorizontalDragUpdate: (details) {
78-
setState(() {
79-
_dragPosition += details.delta.dx;
80-
if (_dragPosition < 0) _dragPosition = 0;
81-
if (_dragPosition > effectiveMaxWidth - sliderWidth) {
82-
_dragPosition = effectiveMaxWidth - sliderWidth;
83-
}
84-
});
85-
},
86-
onHorizontalDragEnd: (details) {
87-
if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) {
88-
widget.onSlideComplete();
89-
} else {
90-
setState(() => _dragPosition = 0);
91-
}
92-
},
93-
child: Container(
94-
key: ValueKey('standard_slide_button_widget_slider_container_key'),
95-
width: sliderWidth,
96-
height: widget.height - 8,
97-
decoration: BoxDecoration(
98-
borderRadius: BorderRadius.circular(10),
99-
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
100-
),
101-
alignment: Alignment.center,
102-
child: Icon(
103-
key: ValueKey('standard_slide_button_widget_slider_icon_key'),
104-
Icons.arrow_forward,
105-
color: widget.currentTheme.type == ThemeType.bright
106-
? Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor
107-
: Theme.of(context).extension<FilterTheme>()!.buttonColor),
108-
),
56+
return LayoutBuilder(
57+
builder: (context, constraints) {
58+
final maxWidth = constraints.maxWidth;
59+
sideMargin = 4.0;
60+
effectiveMaxWidth = maxWidth - 2 * sideMargin;
61+
sliderWidth = 42.0;
62+
63+
return Container(
64+
height: widget.height,
65+
decoration: BoxDecoration(
66+
borderRadius: BorderRadius.circular(10),
67+
color: tileBackgroundColor,
68+
),
69+
child: Stack(
70+
alignment: Alignment.centerLeft,
71+
children: [
72+
Center(
73+
child: Text(
74+
widget.buttonText,
75+
style: TextStyle(
76+
fontSize: 16,
77+
fontFamily: 'Lato',
78+
fontWeight: FontWeight.w600,
79+
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
80+
),
81+
),
82+
),
83+
Positioned(
84+
left: sideMargin + _dragPosition,
85+
child: GestureDetector(
86+
key: ValueKey('standard_slide_button_widget_slider_key'),
87+
onHorizontalDragUpdate: (details) {
88+
setState(() {
89+
_dragPosition += details.delta.dx;
90+
if (_dragPosition < 0) _dragPosition = 0;
91+
if (_dragPosition > effectiveMaxWidth - sliderWidth) {
92+
_dragPosition = effectiveMaxWidth - sliderWidth;
93+
}
94+
});
95+
},
96+
onHorizontalDragEnd: (details) {
97+
if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) {
98+
widget.onSlideComplete();
99+
} else {
100+
setState(() => _dragPosition = 0);
101+
}
102+
},
103+
child: Container(
104+
key: ValueKey('standard_slide_button_widget_slider_container_key'),
105+
width: sliderWidth,
106+
height: widget.height - 8,
107+
decoration: BoxDecoration(
108+
borderRadius: BorderRadius.circular(10),
109+
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
110+
),
111+
alignment: Alignment.center,
112+
child: Icon(
113+
key: ValueKey('standard_slide_button_widget_slider_icon_key'),
114+
Icons.arrow_forward,
115+
color: widget.currentTheme.type == ThemeType.bright
116+
? Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor
117+
: Theme.of(context).extension<FilterTheme>()!.buttonColor,
109118
),
110-
)
111-
],
119+
),
120+
),
112121
),
113-
);
114-
});
122+
],
123+
),
124+
);
125+
},
126+
);
115127
}
116128
}

0 commit comments

Comments
 (0)