Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0fc4a3ef
Unverified
Commit
0fc4a3ef
authored
Nov 19, 2022
by
Christopher Fujino
Committed by
GitHub
Nov 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Remove package:image dependency (#115674)" (#115680)
This reverts commit
cf2c9f6e
.
parent
46d868c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
pubspec.yaml
dev/integration_tests/ui/pubspec.yaml
+4
-1
screenshot_test.dart
dev/integration_tests/ui/test_driver/screenshot_test.dart
+53
-0
No files found.
dev/integration_tests/ui/pubspec.yaml
View file @
0fc4a3ef
...
...
@@ -8,6 +8,7 @@ environment:
# It can probably be removed, see the comment in that file.
dependencies
:
image
:
3.2.2
flutter
:
sdk
:
flutter
flutter_driver
:
...
...
@@ -42,6 +43,7 @@ dependencies:
node_preamble
:
2.0.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
package_config
:
2.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path
:
1.8.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
petitparser
:
5.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pool
:
1.5.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pub_semver
:
2.1.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf
:
1.4.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -64,6 +66,7 @@ dependencies:
web_socket_channel
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
webdriver
:
3.0.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
webkit_inspection_protocol
:
1.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
xml
:
6.2.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml
:
3.1.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
...
...
@@ -79,4 +82,4 @@ flutter:
assets
:
-
assets/foo.png
# PUBSPEC CHECKSUM:
691e
# PUBSPEC CHECKSUM:
321a
dev/integration_tests/ui/test_driver/screenshot_test.dart
0 → 100644
View file @
0fc4a3ef
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This test is used by devicelab, test "integration_ui_ios_screenshot".
// Its use of package:image is, at the time of writing, the only use of that
// package in this repository. If package:image is a problem, it is probably
// fine to just remove this test since the value of the test is probably not
// as much as the cost of the dependency.
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:image/image.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
void
main
(
)
{
group
(
'FlutterDriver'
,
()
{
late
FlutterDriver
driver
;
setUpAll
(()
async
{
driver
=
await
FlutterDriver
.
connect
();
});
tearDownAll
(()
async
{
await
driver
.
close
();
});
test
(
'should take screenshot'
,
()
async
{
final
SerializableFinder
toggleBtn
=
find
.
byValueKey
(
'toggle'
);
// Cards use a magic background color that we look for in the screenshots.
final
Matcher
cardsAreVisible
=
contains
(
getColor
(
0xff
,
0x01
,
0x02
));
await
driver
.
waitFor
(
toggleBtn
);
bool
cardsShouldBeVisible
=
false
;
Image
?
imageBefore
=
decodePng
(
await
driver
.
screenshot
());
for
(
int
i
=
0
;
i
<
10
;
i
+=
1
)
{
await
driver
.
tap
(
toggleBtn
);
cardsShouldBeVisible
=
!
cardsShouldBeVisible
;
final
Image
?
imageAfter
=
decodePng
(
await
driver
.
screenshot
());
if
(
cardsShouldBeVisible
)
{
expect
(
imageBefore
?.
data
,
isNot
(
cardsAreVisible
));
expect
(
imageAfter
?.
data
,
cardsAreVisible
);
}
else
{
expect
(
imageBefore
?.
data
,
cardsAreVisible
);
expect
(
imageAfter
?.
data
,
isNot
(
cardsAreVisible
));
}
imageBefore
=
imageAfter
;
}
},
timeout:
Timeout
.
none
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment