@@ -158,6 +158,35 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('BySemanticsLabel', () {
|
||||
test('finds by Semantic label using String', () async {
|
||||
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
|
||||
expect(i.positionalArguments[1], <String, String>{
|
||||
'command': 'tap',
|
||||
'timeout': _kSerializedTestTimeout,
|
||||
'finderType': 'BySemanticsLabel',
|
||||
'label': 'foo',
|
||||
});
|
||||
return makeMockResponse(<String, dynamic>{});
|
||||
});
|
||||
await driver.tap(find.bySemanticsLabel('foo'), timeout: _kTestTimeout);
|
||||
});
|
||||
|
||||
test('finds by Semantic label using RegExp', () async {
|
||||
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
|
||||
expect(i.positionalArguments[1], <String, String>{
|
||||
'command': 'tap',
|
||||
'timeout': _kSerializedTestTimeout,
|
||||
'finderType': 'BySemanticsLabel',
|
||||
'label': '^foo',
|
||||
'isRegExp': 'true',
|
||||
});
|
||||
return makeMockResponse(<String, dynamic>{});
|
||||
});
|
||||
await driver.tap(find.bySemanticsLabel(RegExp('^foo')), timeout: _kTestTimeout);
|
||||
});
|
||||
});
|
||||
|
||||
group('tap', () {
|
||||
test('requires a target reference', () async {
|
||||
expect(driver.tap(null), throwsA(isInstanceOf<DriverError>()));
|
||||
|
||||
Reference in New Issue
Block a user