Skip to content

Commit

Permalink
Use enum to switch SDK in integration test (apache#24779)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyinkin committed Dec 27, 2022
1 parent 069e3ca commit e6cde04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:playground/modules/examples/example_selector.dart';
import 'package:playground/modules/sdk/components/sdk_selector.dart';
import 'package:playground/modules/sdk/components/sdk_selector_row.dart';
import 'package:playground_components/playground_components.dart';

extension CommonFindersExtension on CommonFinders {
Finder exampleItemInDropdown(String name) {
Expand All @@ -31,8 +32,8 @@ extension CommonFindersExtension on CommonFinders {
return byType(ExampleSelector);
}

Finder sdkItemInDropdown(String name) {
return widgetWithText(SdkSelectorRow, name);
Finder sdkItemInDropdown(Sdk sdk) {
return widgetWithText(SdkSelectorRow, sdk.title);
}

Finder sdkSelector() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:highlight/languages/java.dart';
import 'package:highlight/languages/python.dart';
import 'package:integration_test/integration_test.dart';
import 'package:playground_components/playground_components.dart';
import 'package:playground_components_dev/playground_components_dev.dart';

import 'common/common.dart';
Expand Down Expand Up @@ -105,7 +106,7 @@ public class MyClass {
await wt.tap(find.sdkSelector());
await wt.pumpAndSettle();

await wt.tap(find.sdkItemInDropdown('Python'));
await wt.tap(find.sdkItemInDropdown(Sdk.python));
await wt.pumpAndSettle();

expect(
Expand Down

0 comments on commit e6cde04

Please sign in to comment.