Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Ğecko
Commits
0210dfd5
Commit
0210dfd5
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Commented test
parent
a1f2b92d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/widget_test.dart
+24
-24
24 additions, 24 deletions
test/widget_test.dart
with
24 additions
and
24 deletions
test/widget_test.dart
+
24
−
24
View file @
0210dfd5
// This is a basic Flutter widget test.
//
// This is a basic Flutter widget test.
//
//
//
// To perform an interaction with a widget in your test, use the WidgetTester
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
//
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
//
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
//
// tree, read text, and verify that the values of widget properties are correct.
import
'package:flutter/material.dart'
;
//
import 'package:flutter/material.dart';
import
'package:flutter_test/flutter_test.dart'
;
//
import 'package:flutter_test/flutter_test.dart';
import
'package:gecko/main.dart'
;
//
import 'package:gecko/main.dart';
void
main
()
{
//
void main() {
testWidgets
(
'Counter increments smoke test'
,
(
WidgetTester
tester
)
async
{
//
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
//
// Build our app and trigger a frame.
await
tester
.
pumpWidget
(
Gecko
());
//
await tester.pumpWidget(Gecko());
// Verify that our counter starts at 0.
//
// Verify that our counter starts at 0.
expect
(
find
.
text
(
'0'
),
findsOneWidget
);
//
expect(find.text('0'), findsOneWidget);
expect
(
find
.
text
(
'1'
),
findsNothing
);
//
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
//
// Tap the '+' icon and trigger a frame.
await
tester
.
tap
(
find
.
byIcon
(
Icons
.
add
));
//
await tester.tap(find.byIcon(Icons.add));
await
tester
.
pump
();
//
await tester.pump();
// Verify that our counter has incremented.
//
// Verify that our counter has incremented.
expect
(
find
.
text
(
'0'
),
findsNothing
);
//
expect(find.text('0'), findsNothing);
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
//
expect(find.text('1'), findsOneWidget);
});
//
});
}
//
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment