cake_wallet/integration_test/funds_related_tests.dart
cyan 3e10023e18
CW-827 CI/CD update (#1948)
* CI update
- use existing build outputs in build_monero_all.sh
- update $HOME, fix gh actions
- add secrets earlier in the runtime (potentially speed up 'Build generated code' step)
- add windows dockerfile
- add linux/android dockerfile
- update android/linux ci script

* [skip slack] [run tests] Run tests on CI, fix tests

* [skip slack] [run tests] force enable kvm in android

* [skip slack] [run tests] remove inexisting flag

* [run tests] [skip slack] update tests

* add extra dependencies [skip ci]

* [skip slack] [run tests] Add secrets

* [skip slack] [run tests] Timeout test cases, continue on error

* [skip slack] [run tests] Xvfb fix, timeout fix

* [skip slack] [run tests] Start dbus to clean up the logs, use SIGKILL

* [skip slack] [run tests] Enable network manager

* [skip slack] [run tests] Screen record test, resize screen

* [skip slack] [run tests] Improve status report for tests

* [skip slack] [run tests] Increase framerate

* [skip slack] [run tests] Remove test that I am unable to fix locally easily from CI

* [skip slack] [run tests] Simplify ffmpeg command

* [skip slack] [run tests] Increase timeout, add comment

* [skip slack] Update dockerfile, migrate from mrcyjanek to cake-tech for the ghcr org

* Update lib/entities/default_settings_migration.dart

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2025-01-15 13:09:59 +02:00

94 lines
3.8 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'components/common_test_constants.dart';
import 'components/common_test_flows.dart';
import 'robots/auth_page_robot.dart';
import 'robots/dashboard_page_robot.dart';
import 'robots/exchange_confirm_page_robot.dart';
import 'robots/exchange_page_robot.dart';
import 'robots/exchange_trade_page_robot.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
DashboardPageRobot dashboardPageRobot;
ExchangePageRobot exchangePageRobot;
ExchangeConfirmPageRobot exchangeConfirmPageRobot;
AuthPageRobot authPageRobot;
ExchangeTradePageRobot exchangeTradePageRobot;
CommonTestFlows commonTestFlows;
group('Startup Test', () {
testWidgets('Test for Exchange flow using Restore Wallet - Exchanging USDT(Sol) to SOL',
(tester) async {
authPageRobot = AuthPageRobot(tester);
exchangePageRobot = ExchangePageRobot(tester);
dashboardPageRobot = DashboardPageRobot(tester);
exchangeTradePageRobot = ExchangeTradePageRobot(tester);
exchangeConfirmPageRobot = ExchangeConfirmPageRobot(tester);
commonTestFlows = CommonTestFlows(tester);
await commonTestFlows.startAppFlow(ValueKey('funds_exchange_test_app_key'));
await commonTestFlows.welcomePageToRestoreWalletThroughSeedsFlow(
CommonTestConstants.testWalletType,
secrets.solanaTestWalletSeeds,
CommonTestConstants.pin,
);
// ----------- RestoreFromSeedOrKeys Page -------------
await dashboardPageRobot.navigateToExchangePage();
// ----------- Exchange Page -------------
await exchangePageRobot.isExchangePage();
exchangePageRobot.hasResetButton();
await exchangePageRobot.displayBothExchangeCards();
exchangePageRobot.confirmRightComponentsDisplayOnDepositExchangeCards();
exchangePageRobot.confirmRightComponentsDisplayOnReceiveExchangeCards();
await exchangePageRobot.selectDepositCurrency(CommonTestConstants.testDepositCurrency);
await exchangePageRobot.selectReceiveCurrency(CommonTestConstants.testReceiveCurrency);
await exchangePageRobot.enterDepositAmount(CommonTestConstants.exchangeTestAmount);
await exchangePageRobot.enterDepositRefundAddress(
depositAddress: CommonTestConstants.testWalletAddress);
await exchangePageRobot.enterReceiveAddress(CommonTestConstants.testWalletAddress);
await exchangePageRobot.onExchangeButtonPressed();
await exchangePageRobot.handleErrors(CommonTestConstants.exchangeTestAmount);
final onAuthPage = authPageRobot.onAuthPage();
if (onAuthPage) {
await authPageRobot.enterPinCode(CommonTestConstants.pin);
}
final onAuthPageDesktop = authPageRobot.onAuthPageDesktop();
if (onAuthPageDesktop) {
await authPageRobot.enterPassword(CommonTestConstants.pin.join(""));
}
// ----------- Exchange Confirm Page -------------
await exchangeConfirmPageRobot.isExchangeConfirmPage();
exchangeConfirmPageRobot.confirmComponentsOfTradeDisplayProperly();
await exchangeConfirmPageRobot.confirmCopyTradeIdToClipBoardWorksProperly();
await exchangeConfirmPageRobot.onSavedTradeIdButtonPressed();
// ----------- Exchange Trade Page -------------
await exchangeTradePageRobot.isExchangeTradePage();
exchangeTradePageRobot.hasInformationDialog();
await exchangeTradePageRobot.onGotItButtonPressed();
await exchangeTradePageRobot.onConfirmSendingButtonPressed();
await exchangeTradePageRobot.handleConfirmSendResult();
await exchangeTradePageRobot.onSendButtonOnConfirmSendingDialogPressed();
});
});
}