-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b1526d
commit f100957
Showing
8 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:vernet/main.dart'; | ||
import 'package:vernet/ui/adaptive/adaptive_list.dart'; | ||
import 'package:vernet/values/keys.dart'; | ||
import 'package:vernet/values/strings.dart'; | ||
|
||
void main() { | ||
group('Dns lookup integration test', () { | ||
testWidgets('tap on the DNS lookup button, verify lookup ended', | ||
(tester) async { | ||
// Load app widget. | ||
await tester.pumpWidget(const MyApp(true)); | ||
await tester.pumpAndSettle(); | ||
|
||
// Verify that there are 4 widgets at homepage | ||
expect(find.bySubtype<AdaptiveListTile>(), findsAtLeastNWidgets(4)); | ||
|
||
// Finds the scan for devices button to tap on. | ||
final lookupButton = find.byKey(WidgetKey.dnsLookupButton.key); | ||
|
||
// Emulate a tap on the button. | ||
await tester.tap(lookupButton); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.text(StringValue.dnsLookupEmptyPlaceholder), findsOneWidget); | ||
|
||
await tester.enterText( | ||
find.byType(TextFormField), | ||
'google.com', | ||
); | ||
await tester.pumpAndSettle(); | ||
|
||
final submitButton = find.byKey(WidgetKey.basePageSubmitButton.key); | ||
await tester.tap(submitButton); | ||
|
||
await tester.pumpAndSettle(const Duration(seconds: 2)); | ||
|
||
expect(find.byType(AdaptiveListTile), findsExactly(3)); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:vernet/main.dart'; | ||
import 'package:vernet/ui/adaptive/adaptive_list.dart'; | ||
import 'package:vernet/values/keys.dart'; | ||
import 'package:vernet/values/strings.dart'; | ||
|
||
void main() { | ||
group('Reverse DNS lookup integration test', () { | ||
testWidgets('tap on the reverse DNS lookup button, verify lookup ended', | ||
(tester) async { | ||
// Load app widget. | ||
await tester.pumpWidget(const MyApp(true)); | ||
await tester.pumpAndSettle(); | ||
|
||
// Verify that there are 4 widgets at homepage | ||
expect(find.bySubtype<AdaptiveListTile>(), findsAtLeastNWidgets(4)); | ||
|
||
// Finds the scan for devices button to tap on. | ||
final reverseDnsLookupButton = | ||
find.byKey(WidgetKey.reverseDnsLookupButton.key); | ||
|
||
// Emulate a tap on the button. | ||
await tester.tap(reverseDnsLookupButton); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.text(StringValue.reverseDnsLookupEmptyPlaceholder), | ||
findsOneWidget); | ||
|
||
await tester.enterText( | ||
find.byType(TextFormField), | ||
'172.217.160.142', | ||
); | ||
await tester.pumpAndSettle(); | ||
|
||
final submitButton = find.byKey(WidgetKey.basePageSubmitButton.key); | ||
await tester.tap(submitButton); | ||
|
||
await tester.pumpAndSettle(const Duration(seconds: 2)); | ||
|
||
expect(find.text("maa03s29-in-f14.1e100.net"), findsOne); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters