Innopolis University DevOps Playground
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wrdl
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
wordle
wrdl
Commits
f143fe70
Commit
f143fe70
authored
1 year ago
by
Azizullo Sadriddinzoda
Browse files
Options
Downloads
Patches
Plain Diff
unit test
parent
9e402bb9
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2317
failed
1 year ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/widget_test.dart
+0
-56
0 additions, 56 deletions
test/widget_test.dart
with
0 additions
and
56 deletions
test/widget_test.dart
+
0
−
56
View file @
f143fe70
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// 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.
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:material_design_icons_flutter/material_design_icons_flutter.dart'
;
import
'package:proj3/main.dart'
;
import
'package:proj3/pages/achievements_page.dart'
;
import
'package:proj3/pages/categories_page.dart'
;
import
'package:proj3/pages/difficulty_page.dart'
;
import
'package:proj3/pages/story_mode_page.dart'
;
import
'package:proj3/widgets/achievement_box.dart'
;
void
main
()
{
testWidgets
(
'Main Page Test'
,
(
tester
)
async
{
...
...
@@ -29,47 +16,4 @@ void main() {
});
testWidgets
(
"Select Difficulty Page Test"
,
(
tester
)
async
{
// Go to Difficulty page and check if Next button and difficulty buttons are there
await
tester
.
pumpWidget
(
Difficulty
());
expect
(
find
.
text
(
"Easy"
),
findsOneWidget
);
expect
(
find
.
text
(
"Random"
),
findsOneWidget
);
expect
(
find
.
text
(
"Next"
),
findsOneWidget
);
});
testWidgets
(
"Select Category Page Test"
,
(
tester
)
async
{
// Go to Categories page and check if categories are there
await
tester
.
pumpWidget
(
MaterialApp
(
home:
CategoriesPage
()));
expect
(
find
.
byKey
(
Key
(
"categories"
)),
findsOneWidget
);
});
testWidgets
(
'Story Mode Page Test'
,
(
tester
)
async
{
// Go to StoryMode page
await
tester
.
pumpWidget
(
StoryMode
());
// Verify if there is a Start button, Add category button and Increment/Decrement buttons
expect
(
find
.
text
(
"Start"
),
findsOneWidget
);
expect
(
find
.
byIcon
(
Icons
.
add
),
findsWidgets
);
expect
(
find
.
byIcon
(
Icons
.
remove
),
findsWidgets
);
// Verify if the initial number of words is 1
expect
(
find
.
text
(
"1"
),
findsOneWidget
);
expect
(
find
.
text
(
"2"
),
findsNothing
);
// Press plus button, and change the frame
await
tester
.
tap
(
find
.
byKey
(
Key
(
"increment"
)));
await
tester
.
pump
();
// Verify if the number incremented
expect
(
find
.
text
(
"1"
),
findsNothing
);
expect
(
find
.
text
(
"2"
),
findsOneWidget
);
});
testWidgets
(
"Achievements Page Test"
,
(
tester
)
async
{
// Go Achievements page and verify if you can see the achievements
await
tester
.
pumpWidget
(
Achievements
());
expect
(
find
.
byType
(
AchievementBox
),
findsWidgets
);
});
}
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