Fakultas Ilmu Komputer UI

Commit 1bb85a51 authored by wibias fuad's avatar wibias fuad
Browse files

test: adding missing tests for akun and all_agreement after using image...

test: adding missing tests for akun and all_agreement after using image network, tabbarview testing still not resolved
parents 61ff2e5d ec2c522a
Pipeline #78520 passed with stages
in 7 minutes and 37 seconds
......@@ -668,7 +668,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-17T18:31:02.745689Z",
"generated": "2021-05-23T20:57:01.676757Z",
"generator": "pub",
"generatorVersion": "2.12.2"
}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-18 01:35:56.403202","version":"2.0.3"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-24 04:16:34.088508","version":"2.0.3"}
\ No newline at end of file
image: cirrusci/flutter:stable
image: cirrusci/flutter:2.0.6
stages:
- linter
......@@ -6,11 +6,6 @@ stages:
- sonar
- build_android
before_script:
- flutter pub get
- flutter clean
- flutter --version
lint:flutter:
stage: linter
script:
......
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-18 01:31:02.706695.
# Generated by pub on 2021-05-24 03:57:01.611759.
_fe_analyzer_shared:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
......@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:fundex_app/my_flutter_app_icons.dart';
import 'package:fundex_app/pages/business/homekyc.dart';
import 'package:fundex_app/pages/profile/profile_base_page.dart';
import 'package:fundex_app/pages/transaction/DetailTransactionPembelian.dart';
import 'package:fundex_app/pages/transaction/Transaction.dart';
import 'package:google_fonts/google_fonts.dart';
class MainScreen extends StatefulWidget {
......@@ -16,7 +16,7 @@ class _MainScreenState extends State<MainScreen> {
List<Widget> _widgetOptions = <Widget>[
HomeKYC(),
HomeKYC(),
DetailTransactionPembelian(),
Transaction(),
HomeKYC(),
ProfilBasePage(),
];
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,7 +21,7 @@ class _AkunState extends State<Akun> {
//
String userName;
String userRole;
String userProfilePic;
String userProfilePic = 'https://picsum.photos/250?image=9';
@override
void initState() {
......@@ -109,6 +109,7 @@ class _AkunState extends State<Akun> {
Container(
margin: EdgeInsets.fromLTRB(16, 0, 0, 0),
child: ClipRRect(
key: Key('userPhoto'),
borderRadius: BorderRadius.circular(90),
child: buildImage(),
),
......
......@@ -38,7 +38,9 @@ class _DetailTransactionDepositState extends State<DetailTransactionDeposit> {
Icons.arrow_back,
color: primary,
),
onPressed: null),
onPressed: () {
Navigator.pop(context);
}),
Text('Detail Transaksi',
key: Key('pageTitle'),
style: TextStyle(
......
import 'package:flutter/material.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/pages/transaction/DetailTransactionDeposit.dart';
import 'package:google_fonts/google_fonts.dart';
class DetailTransactionPembelian extends StatefulWidget {
......@@ -17,15 +16,6 @@ class _DetailTransactionPembelianState
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(
key: Key('floatingActionButton'),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (BuildContext context) =>
MaterialApp(home: DetailTransactionDeposit())));
}),
appBar: AppBar(
backgroundColor: white,
title: Container(
......@@ -39,10 +29,7 @@ class _DetailTransactionPembelianState
color: primary,
),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return MaterialApp(home: DetailTransactionDeposit());
}));
Navigator.pop(context);
}),
Text('Detail Transaksi',
key: Key('pageTitle'),
......
This diff is collapsed.
......@@ -25,13 +25,13 @@ dependencies:
sdk: flutter
test: '^1.15.7'
flutter_secure_storage: '^3.3.5'
http: '0.13.0'
http: 0.13.0
cupertino_icons: ^1.0.0
flutter_typeahead: '^3.1.0'
flutter_typeahead: ^3.1.0
intl: any
google_fonts: ^2.0.0
carousel_slider: ^3.0.0
percent_indicator: "^2.1.7+2"
percent_indicator: ^2.1.7+2
flutter_svg: ^0.19.3
dotted_border: ^1.0.7
image_picker: any
......@@ -45,9 +45,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mockito: '^4.1.4'
build_runner: '^1.0.0'
build_test: '^1.3.7'
mockito: ^4.1.4
build_runner: ^1.0.0
build_test: ^1.3.7
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
......
This diff is collapsed.
// import 'package:flutter/material.dart';
// import 'package:flutter_test/flutter_test.dart';
// import 'package:fundex_app/pages/profile/all_agreement.dart';
// void main() {
// Widget createWidgetForTesting({Widget child}) {
// return MaterialApp(
// home: child,
// );
// }
// testWidgets('Testing Scaffold', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('scaffold')), findsOneWidget);
// });
// testWidgets('Testing appbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('appbar')), findsOneWidget);
// });
// testWidgets('Testing icon back', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('icon-back')), findsOneWidget);
// });
// testWidgets('Testing text perjanjian', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
// });
// testWidgets('Testing body', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('body')), findsOneWidget);
// });
// testWidgets('Testing margin container 0', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
// });
// testWidgets('Testing tabbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar')), findsOneWidget);
// });
// testWidgets('Testing tab semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-semua')), findsOneWidget);
// });
// testWidgets('Testing tab perlu tanda tangan', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-perluTandaTangan')), findsOneWidget);
// });
// testWidgets('Testing tabbar view', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar-view')), findsOneWidget);
// });
// testWidgets('Testing content tabbar semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('content-tabbar-semua')), findsOneWidget);
// });
// testWidgets('Testing Card Semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('card-semua')), findsWidgets);
// });
// }
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/profile/all_agreement.dart';
void main() {
Widget createWidgetForTesting({Widget child}) {
......@@ -81,39 +9,53 @@ void main() {
);
}
testWidgets('Testing bottom navigation bar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('bottomNavigationBar')), findsOneWidget);
testWidgets('Testing Scaffold', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('scaffold')), findsOneWidget);
});
testWidgets('Testing home icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('homeIcon')), findsOneWidget);
testWidgets('Testing appbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('appbar')), findsOneWidget);
});
testWidgets('Testing portfolio icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('portfolioIcon')), findsOneWidget);
testWidgets('Testing icon back', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('icon-back')), findsOneWidget);
});
testWidgets('Testing transaction icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('transactionIcon')), findsOneWidget);
testWidgets('Testing text perjanjian', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
});
testWidgets('Testing help icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('helpIcon')), findsOneWidget);
testWidgets('Testing body', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('body')), findsOneWidget);
});
testWidgets('Testing account icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('accountIcon')), findsOneWidget);
testWidgets('Testing margin container 0', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
});
}
testWidgets('Testing tabbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tabbar')), findsOneWidget);
});
testWidgets('Testing tab semua', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tab-semua')), findsOneWidget);
});
testWidgets('Testing tab perlu tanda tangan', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tab-perluTandaTangan')), findsOneWidget);
});
testWidgets('Testing tabbar view', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tabbar-view')), findsOneWidget);
});
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment