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
5d37df13
Unverified
Commit
5d37df13
authored
Apr 21, 2021
by
Abhishek Ghaskata
Committed by
GitHub
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate web_e2e_tests to null safety (#80628)
parent
fe57037a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
14 deletions
+12
-14
text_editing_main.dart
...ntegration_tests/web_e2e_tests/lib/text_editing_main.dart
+4
-4
pubspec.yaml
dev/integration_tests/web_e2e_tests/pubspec.yaml
+1
-1
text_editing_integration.dart
...s/web_e2e_tests/test_driver/text_editing_integration.dart
+7
-8
text_editing_integration_test.dart
..._e2e_tests/test_driver/text_editing_integration_test.dart
+0
-1
No files found.
dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart
View file @
5d37df13
...
...
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
void
main
(
)
=>
runApp
(
const
MyApp
());
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
Key
key
})
:
super
(
key:
key
);
const
MyApp
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -20,9 +20,9 @@ class MyApp extends StatelessWidget {
}
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
const
MyHomePage
({
Key
?
key
,
this
.
title
})
:
super
(
key:
key
);
final
String
title
;
final
String
?
title
;
@override
_MyHomePageState
createState
()
=>
_MyHomePageState
();
...
...
@@ -44,7 +44,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
widget
.
title
),
title:
Text
(
widget
.
title
??
''
),
),
body:
Center
(
child:
Column
(
...
...
dev/integration_tests/web_e2e_tests/pubspec.yaml
View file @
5d37df13
...
...
@@ -2,7 +2,7 @@ name: web_e2e_tests
publish_to
:
none
environment
:
sdk
:
"
>=2.
2.2
<3.0.0"
sdk
:
"
>=2.
12.0
<3.0.0"
dependencies
:
flutter
:
...
...
dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart
View file @
5d37df13
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.9
import
'dart:html'
;
import
'dart:js_util'
as
js_util
;
...
...
@@ -39,7 +38,7 @@ void main() {
// Change the value of the TextFormField.
final
TextFormField
textFormField
=
tester
.
widget
(
finder
);
textFormField
.
controller
.
text
=
'New Value'
;
textFormField
.
controller
?
.
text
=
'New Value'
;
// DOM element's value also changes.
expect
(
input
.
value
,
'New Value'
);
});
...
...
@@ -67,7 +66,7 @@ void main() {
// Change the value of the TextFormField.
final
TextFormField
textFormField
=
tester
.
widget
(
finder
);
textFormField
.
controller
.
text
=
'New Value'
;
textFormField
.
controller
?
.
text
=
'New Value'
;
// DOM element's value also changes.
expect
(
input
.
value
,
'New Value'
);
});
...
...
@@ -225,8 +224,8 @@ void main() {
expect
(
input
.
hasAttribute
(
'readonly'
),
isTrue
);
// Make sure the entire text is selected.
TextRange
range
=
TextRange
(
start:
input
.
selectionStart
,
end:
input
.
selectionEnd
);
TextRange
?
range
=
TextRange
(
start:
input
.
selectionStart
!,
end:
input
.
selectionEnd
!
);
expect
(
range
.
textInside
(
text
),
text
);
// Double tap to select the first word.
...
...
@@ -239,7 +238,7 @@ void main() {
await
gesture
.
up
();
await
gesture
.
down
(
firstWordOffset
);
await
gesture
.
up
();
range
=
TextRange
(
start:
input
.
selectionStart
,
end:
input
.
selectionEnd
);
range
=
TextRange
(
start:
input
.
selectionStart
!,
end:
input
.
selectionEnd
!
);
expect
(
range
.
textInside
(
text
),
'Lorem'
);
// Double tap to select the last word.
...
...
@@ -252,14 +251,14 @@ void main() {
await
gesture
.
up
();
await
gesture
.
down
(
lastWordOffset
);
await
gesture
.
up
();
range
=
TextRange
(
start:
input
.
selectionStart
,
end:
input
.
selectionEnd
);
range
=
TextRange
(
start:
input
.
selectionStart
!,
end:
input
.
selectionEnd
!
);
expect
(
range
.
textInside
(
text
),
'amet'
);
});
}
KeyboardEvent
dispatchKeyboardEvent
(
EventTarget
target
,
String
type
,
Map
<
String
,
dynamic
>
args
)
{
final
dynamic
jsKeyboardEvent
=
js_util
.
getProperty
(
window
,
'KeyboardEvent'
)
;
final
Object
jsKeyboardEvent
=
js_util
.
getProperty
(
window
,
'KeyboardEvent'
)
as
Object
;
final
List
<
dynamic
>
eventArgs
=
<
dynamic
>[
type
,
args
,
...
...
dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart
View file @
5d37df13
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.9
import
'package:integration_test/integration_test_driver.dart'
as
test
;
Future
<
void
>
main
()
async
=>
test
.
integrationDriver
();
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