Added tests for the new Android heading semantic flag to android_semantics_testing (#44031)
Added tests for the new Android heading semantic flag to android_semantics_testing.
This commit is contained in:
@@ -61,6 +61,8 @@ void main() {
|
||||
group('TextField', () {
|
||||
setUpAll(() async {
|
||||
await driver.tap(find.text(textFieldRoute));
|
||||
// Delay for TalkBack to update focus as of November 2019 with Pixel 3 and Android API 28
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
});
|
||||
|
||||
test('TextField has correct Android semantics', () async {
|
||||
@@ -85,6 +87,7 @@ void main() {
|
||||
);
|
||||
|
||||
await driver.tap(normalTextField);
|
||||
// Delay for TalkBack to update focus as of November 2019 with Pixel 3 and Android API 28
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
expect(
|
||||
@@ -105,6 +108,7 @@ void main() {
|
||||
);
|
||||
|
||||
await driver.enterText('hello world');
|
||||
// Delay for TalkBack to update focus as of November 2019 with Pixel 3 and Android API 28
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
expect(
|
||||
@@ -148,6 +152,8 @@ void main() {
|
||||
);
|
||||
|
||||
await driver.tap(passwordTextField);
|
||||
// Delay for TalkBack to update focus as of November 2019 with Pixel 3 and Android API 28
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
expect(
|
||||
await getSemantics(passwordTextField),
|
||||
@@ -167,6 +173,8 @@ void main() {
|
||||
);
|
||||
|
||||
await driver.enterText('hello world');
|
||||
// Delay for TalkBack to update focus as of November 2019 with Pixel 3 and Android API 28
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
expect(
|
||||
await getSemantics(passwordTextField),
|
||||
@@ -630,5 +638,30 @@ void main() {
|
||||
await driver.tap(find.byValueKey('back'));
|
||||
});
|
||||
});
|
||||
|
||||
group('Headings', () {
|
||||
setUpAll(() async {
|
||||
await driver.tap(find.text(headingsRoute));
|
||||
});
|
||||
|
||||
test('AppBar title has correct Android heading semantics', () async {
|
||||
expect(
|
||||
await getSemantics(find.byValueKey(appBarTitleKeyValue)),
|
||||
hasAndroidSemantics(isHeading: true),
|
||||
);
|
||||
});
|
||||
|
||||
test('body text does not have Android heading semantics', () async {
|
||||
expect(
|
||||
await getSemantics(find.byValueKey(bodyTextKeyValue)),
|
||||
hasAndroidSemantics(isHeading: false),
|
||||
);
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
await driver.tap(find.byValueKey('back'));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user