Skip to content

Commit 4ea6639

Browse files
authored
Smoke testing #11
smoke testing
2 parents deea522 + 45c9102 commit 4ea6639

File tree

8 files changed

+271
-148
lines changed

8 files changed

+271
-148
lines changed

.idea/libraries/Flutter_Plugins.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 128 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
os:
2+
- linux
3+
sudo: false
4+
addons:
5+
apt:
6+
sources:
7+
- ubuntu-toolchain-r-test
8+
packages:
9+
- libstdc++6
10+
- fonts-droid
11+
git:
12+
depth: 3
13+
cache:
14+
directories:
15+
- $HOME/.pub-cache
16+
env:
17+
- FLUTTER_VERSION=beta
18+
- FLUTTER_VERSION=dev
19+
matrix:
20+
allow_failures:
21+
- env: FLUTTER_VERSION=dev
22+
before_script:
23+
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_VERSION
24+
- ./flutter/bin/flutter doctor
25+
script:
26+
- ./flutter/bin/flutter test

README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
IntroViews is inspired by [Paper Onboarding](https://github.com/Ramotion/paper-onboarding-android) and developed with `love` from scratch. I decided to rewrite almost all the features in order to make it available to the `flutter` developers and extensible as possible.
55

6+
[![pub package](https://img.shields.io/pub/v/intro_views_flutter.svg)](https://pub.dartlang.org/packages/intro_views_flutter)
67

78
<img src="https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/output.gif?raw=true" align = "right" height = "550px">
89

9-
# Features
10+
# Features
1011

1112
- Easy addition of pages.
1213

@@ -77,47 +78,48 @@ You should then run `flutter packages get` in your terminal so as to get the pac
7778
},
7879
showSkipButton: true,
7980
pageButtonTextStyles: new TextStyle(
80-
color: Colors.white,
81+
color: Colors.white,
8182
fontSize: 18.0,
8283
fontFamily: "Regular",
8384
),
8485
);
8586
```
87+
8688
For further usage refer the [`example`](https://github.com/aagarwal1012/IntroViews-Flutter/tree/master/example/lib) available.
8789

8890
For `Landscape` preview click the [link](https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/landscape2.png?raw=true).
8991

90-
***Note :*** If you added more than four pages in the list then there might be overlapping between `page icons` and `skip button`, so my suggestion is just make the `showSkipButton: false`.
92+
**_Note :_** If you added more than four pages in the list then there might be overlapping between `page icons` and `skip button`, so my suggestion is just make the `showSkipButton: false`.
9193

9294
# Documentation
9395

9496
### PageViewModel Class
9597

96-
| Dart attribute | Datatype | Description | Default Value |
97-
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
98-
| pageColor | Color | Set color of the page. | Null |
99-
| mainImage | Image | Set the main image of the page. | Null |
100-
| title | Text | Set the title text of the page. | Null |
101-
| body | Text | Set the body text of the page. | Null |
102-
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
103-
| iconColor | Color | Set the page bubble icon color. | Null |
104-
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
105-
| textStyle | TextStyle | Set TextStyle for both title and body | title: `color: Colors.white , fontSize: 50.0` <br> body: `color: Colors.white , fontSize: 24.0` |
98+
| Dart attribute | Datatype | Description | Default Value |
99+
| :-------------------- | :-------- | :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------: |
100+
| pageColor | Color | Set color of the page. | Null |
101+
| mainImage | Image | Set the main image of the page. | Null |
102+
| title | Text | Set the title text of the page. | Null |
103+
| body | Text | Set the body text of the page. | Null |
104+
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
105+
| iconColor | Color | Set the page bubble icon color. | Null |
106+
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
107+
| textStyle | TextStyle | Set TextStyle for both title and body | title: `color: Colors.white , fontSize: 50.0` <br> body: `color: Colors.white , fontSize: 24.0` |
106108

107109
### IntroViewFlutter Class
108110

109-
| Dart attribute | Datatype | Description | Default Value |
110-
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
111-
| pages | List<PageViewModel> | Set the pages of the intro screen. | Null |
112-
| onTapDoneButton | VoidCallback | Method executes on tapping done button. | Null |
113-
| showSkipButton | Bool | Show the skip button at the bottom of page. | true |
114-
| pageButtonTextSize | Double | Set the button text size. | 18.0 |
115-
| pageButtonFontFamily | String | Set the font of button text. | Default |
116-
| onTapSkipButton | VoidCallback | Method executes on tapping skip button. | null |
117-
| pageButtonTextStyles | TextStyle | Configure TextStyle for skip, done buttons, overrides pageButtonFontFamily, pageButtonsColor, pageButtonTextSize. | fontSize: `18.0`, color: `Colors.white` |
118-
| skipText | Text | Override Skip Button Text and styles. | Text('SKIP') |
119-
| doneText | Text | Override Done Button Text and styles. | Text('DONE') |
120-
| doneButtonPersist | Bool | Show done Button throughout pages | false |
111+
| Dart attribute | Datatype | Description | Default Value |
112+
| :------------------- | :------------------ | :---------------------------------------------------------------------------------------------------------------- | :-------------------------------------: |
113+
| pages | List<PageViewModel> | Set the pages of the intro screen. | Null |
114+
| onTapDoneButton | VoidCallback | Method executes on tapping done button. | Null |
115+
| showSkipButton | Bool | Show the skip button at the bottom of page. | true |
116+
| pageButtonTextSize | Double | Set the button text size. | 18.0 |
117+
| pageButtonFontFamily | String | Set the font of button text. | Default |
118+
| onTapSkipButton | VoidCallback | Method executes on tapping skip button. | null |
119+
| pageButtonTextStyles | TextStyle | Configure TextStyle for skip, done buttons, overrides pageButtonFontFamily, pageButtonsColor, pageButtonTextSize. | fontSize: `18.0`, color: `Colors.white` |
120+
| skipText | Text | Override Skip Button Text and styles. | Text('SKIP') |
121+
| doneText | Text | Override Done Button Text and styles. | Text('DONE') |
122+
| doneButtonPersist | Bool | Show done Button throughout pages | false |
121123

122124
For help on editing package code, view the [flutter documentation](https://flutter.io/developing-packages/).
123125

@@ -127,4 +129,5 @@ This is the well `documented` package. I have documented each and every method t
127129
Feel free to [open an issue](https://github.com/aagarwal1012/IntroViews-Flutter/issues).
128130

129131
# License
132+
130133
**IntroViews-Flutter** is licensed under `MIT license`.

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ packages:
129129
path: ".."
130130
relative: true
131131
source: path
132-
version: "2.1.1"
132+
version: "2.2.1"
133133
io:
134134
dependency: transitive
135135
description:
@@ -374,5 +374,5 @@ packages:
374374
source: hosted
375375
version: "2.1.13"
376376
sdks:
377-
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.54.0.flutter-46ab040e58"
377+
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760"
378378
flutter: ">=0.1.4 <2.0.0"

intro_views_flutter.iml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@
2121
<excludeFolder url="file://$MODULE_DIR$/example/.idea/packages" />
2222
<excludeFolder url="file://$MODULE_DIR$/example/.idea/runConfigurations/packages" />
2323
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
24-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/fileChanges/packages" />
25-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/fileContent/packages" />
26-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/fileHashes/packages" />
27-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/javaCompile/packages" />
28-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/packages" />
29-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/4.1/taskHistory/packages" />
30-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/buildOutputCleanup/packages" />
31-
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/packages" />
3224
<excludeFolder url="file://$MODULE_DIR$/example/android/app/packages" />
3325
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/com/example/example/packages" />
3426
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/com/example/packages" />
@@ -68,11 +60,12 @@
6860
<excludeFolder url="file://$MODULE_DIR$/example/lib/packages" />
6961
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
7062
<excludeFolder url="file://$MODULE_DIR$/packages" />
63+
<excludeFolder url="file://$MODULE_DIR$/test/packages" />
7164
</content>
7265
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
7366
<orderEntry type="sourceFolder" forTests="false" />
74-
<orderEntry type="library" name="Dart Packages" level="project" />
7567
<orderEntry type="library" name="Dart SDK" level="project" />
7668
<orderEntry type="library" name="Flutter Plugins" level="project" />
69+
<orderEntry type="library" name="Dart Packages" level="project" />
7770
</component>
7871
</module>

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,5 @@ packages:
360360
source: hosted
361361
version: "2.1.13"
362362
sdks:
363-
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.54.0.flutter-46ab040e58"
363+
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760"
364364
flutter: ">=0.1.4 <2.0.0"

test/widget_test.dart

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// This is a basic Flutter widget test.
2+
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3+
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4+
// find child widgets in the widget tree, read text, and verify that the values of widget properties
5+
// are correct.
6+
7+
import 'package:flutter/material.dart';
8+
import 'package:flutter_test/flutter_test.dart';
9+
10+
import '../example/lib/main.dart';
11+
12+
void main() {
13+
testWidgets('Skip Pressed smoke test', (WidgetTester tester) async {
14+
// Build our app and trigger a frame.
15+
await tester.pumpWidget(new App());
16+
17+
// Verify that our counter starts at 0.
18+
expect(find.text('SKIP'), findsOneWidget);
19+
expect(find.text('DONE'), findsNothing);
20+
21+
// Tap the '+' icon and trigger a frame.
22+
await tester.tap(find.text('SKIP'));
23+
await tester.pump();
24+
25+
// Verify that our counter has incremented.
26+
expect(find.text('SKIP'), findsNothing);
27+
expect(find.text('DONE'), findsOneWidget);
28+
});
29+
30+
testWidgets('Done Pressed smoke test', (WidgetTester tester) async {
31+
// Build our app and trigger a frame.
32+
await tester.pumpWidget(new App());
33+
34+
// Verify that our counter starts at 0.
35+
expect(find.text('SKIP'), findsOneWidget);
36+
expect(find.text('DONE'), findsNothing);
37+
38+
// Tap the 'SKIP' button and trigger a frame.
39+
await tester.tap(find.text('SKIP'));
40+
await tester.pump();
41+
42+
// Verify that our counter has incremented.
43+
expect(find.text('SKIP'), findsNothing);
44+
expect(find.text('DONE'), findsOneWidget);
45+
46+
// Tap the 'DONE' button and trigger a frame
47+
await tester.tap(find.text('DONE'));
48+
await tester.pumpAndSettle();
49+
50+
// Verify that the home page opens.
51+
expect(find.text('DONE'), findsNothing);
52+
expect(find.text('This is the home page of the app'), findsOneWidget);
53+
});
54+
55+
// Drag from first page to second and back to first
56+
testWidgets('drag Reveal smoke test', (WidgetTester tester) async {
57+
// Build our app and trigger a frame.
58+
await tester.pumpWidget(new App());
59+
60+
// should find First page by its title Text
61+
expect(find.text('Flights'), findsWidgets);
62+
// second page title Text should not be found
63+
expect(find.text('Hotels'), findsNothing);
64+
65+
// Drag Screen To Reveal next Page
66+
await tester.drag(find.byType(App), Offset(-400.0, 0.0));
67+
68+
await tester.pumpAndSettle();
69+
70+
// first page should have been removed by second page
71+
expect(find.text('Flights'), findsNothing);
72+
expect(find.text('Hotels'), findsWidgets);
73+
74+
// Drag Screen To Reveal next Prev page
75+
await tester.drag(find.byType(App), Offset(400.0, 0.0));
76+
77+
await tester.pumpAndSettle();
78+
// first page should have been removed by second page
79+
expect(find.text('Flights'), findsWidgets);
80+
// second page title Text should not be found
81+
expect(find.text('Hotels'), findsNothing);
82+
});
83+
}

0 commit comments

Comments
 (0)