forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue24779 integration changing sdk from 24370 (#387)
* Integration test for changing SDK and running code (apache#24779) * Rename an integration test (apache#24779) * Use enum to switch SDK in integration test (apache#24779) * Find SDK in a dropdown by key (apache#24779) * Add a TODO (apache#24779) * Fix exports (apache#24779) * Integration tests miscellaneous UI (#383) * miscellaneous ui integration tests * reverted pubspec.lock * gradle tasks ordered alhpabetically * integration tests refactoring * clean code * integration tests miscellaneous ui fix pr * rename method * added layout adaptivity * A minor cleanup (apache#24779) Co-authored-by: Dmitry Repin <[email protected]>
- Loading branch information
1 parent
cc8a998
commit 9c16c66
Showing
24 changed files
with
634 additions
and
32 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
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
47 changes: 47 additions & 0 deletions
47
playground/frontend/integration_test/miscellaneous_ui/description_test.dart
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,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:playground_components_dev/playground_components_dev.dart'; | ||
|
||
import '../common/common.dart'; | ||
import '../common/common_finders.dart'; | ||
|
||
Future<void> checkDescription(WidgetTester wt) async { | ||
await wt.tap(find.descriptionPopoverButton()); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.descriptionPopover(), findsOneWidget); | ||
|
||
final example = wt.findPlaygroundController().selectedExample!; | ||
|
||
expectHasDescendant(find.descriptionPopover(), find.text(example.name)); | ||
expectHasDescendant( | ||
find.descriptionPopover(), | ||
find.text(example.description), | ||
); | ||
|
||
// //TODO Check contains github and colab links, | ||
// //when https://github.com/apache/beam/pull/24820 will be merged | ||
|
||
await wt.sendKeyEvent(LogicalKeyboardKey.escape); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.descriptionPopover(), findsNothing); | ||
} |
102 changes: 102 additions & 0 deletions
102
playground/frontend/integration_test/miscellaneous_ui/enjoy_playground_test.dart
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,102 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:playground/modules/analytics/analytics_event.dart'; | ||
import 'package:playground/modules/analytics/analytics_events.dart'; | ||
import 'package:playground/modules/analytics/analytics_service.dart'; | ||
|
||
import '../common/common_finders.dart'; | ||
|
||
Future<void> checkEnjoyPlayground(WidgetTester wt) async { | ||
await _checkEnjoyingAndSendFeedback(wt); | ||
await _checkNotEnjoyingAndSendFeedback(wt); | ||
await _checkNotEnjoyingAndClose(wt); | ||
} | ||
|
||
Future<void> _checkNotEnjoyingAndClose(WidgetTester wt) async { | ||
await wt.tap(find.feedbackThumbDown()); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.feedbackDropdownContent(), findsOneWidget); | ||
|
||
await wt.tap(find.feedbackDropdownCancelButton()); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.feedbackDropdownContent(), findsNothing); | ||
} | ||
|
||
Future<void> _checkEnjoyingAndSendFeedback(WidgetTester wt) async { | ||
expect(find.feedbackDropdownContent(), findsNothing); | ||
|
||
await wt.tap(find.feedbackThumbUp()); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.feedbackDropdownContent(), findsOneWidget); | ||
|
||
const text = 'This is enjoying text'; | ||
await wt.enterText(find.feedbackDropdownTextField(), text); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.text(text), findsOneWidget); | ||
|
||
await wt.tap(find.feedbackDropdownSendButton()); | ||
await wt.pumpAndSettle(); | ||
|
||
final context = wt.element(find.feedbackThumbUp()); | ||
final lastSentEvent = AnalyticsService.get(context).lastSentEvent; | ||
expect( | ||
lastSentEvent, | ||
AnalyticsEvent( | ||
category: kFeedbackCategory, | ||
action: kClickSendFeedbackEvent, | ||
label: text, | ||
), | ||
); | ||
|
||
expect(find.feedbackDropdownContent(), findsNothing); | ||
} | ||
|
||
Future<void> _checkNotEnjoyingAndSendFeedback(WidgetTester wt) async { | ||
await wt.tap(find.feedbackThumbDown()); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.feedbackDropdownContent(), findsOneWidget); | ||
|
||
const text = 'This is not enjoying text'; | ||
await wt.enterText(find.feedbackDropdownTextField(), text); | ||
await wt.pumpAndSettle(); | ||
|
||
expect(find.text(text), findsOneWidget); | ||
|
||
await wt.tap(find.feedbackDropdownSendButton()); | ||
await wt.pumpAndSettle(); | ||
|
||
final context = wt.element(find.feedbackThumbDown()); | ||
final lastSentEvent = AnalyticsService.get(context).lastSentEvent; | ||
expect( | ||
lastSentEvent, | ||
AnalyticsEvent( | ||
category: kFeedbackCategory, | ||
action: kClickSendFeedbackEvent, | ||
label: text, | ||
), | ||
); | ||
|
||
expect(find.feedbackDropdownContent(), findsNothing); | ||
} |
45 changes: 45 additions & 0 deletions
45
playground/frontend/integration_test/miscellaneous_ui/output_placement_test.dart
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,45 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:playground/modules/output/models/output_placement.dart'; | ||
import 'package:playground_components_dev/playground_components_dev.dart'; | ||
|
||
import '../common/common.dart'; | ||
import '../common/common_finders.dart'; | ||
|
||
Future<void> checkOutputPlacement(WidgetTester wt) async { | ||
Offset getCodeAreaCenter() => wt.getCenter(find.codeTextAreaWrapper()); | ||
Offset getOutputCenter() => wt.getCenter(find.outputWidget()); | ||
|
||
await wt.tap(find.byKey(const ValueKey(OutputPlacement.left))); | ||
await wt.pumpAndSettle(); | ||
expect(getCodeAreaCenter().dx > getOutputCenter().dx, true); | ||
expectSimilar(getCodeAreaCenter().dy, getOutputCenter().dy); | ||
|
||
await wt.tap(find.byKey(const ValueKey(OutputPlacement.right))); | ||
await wt.pumpAndSettle(); | ||
expect(getCodeAreaCenter().dx < getOutputCenter().dx, true); | ||
expectSimilar(getCodeAreaCenter().dy, getOutputCenter().dy); | ||
|
||
await wt.tap(find.byKey(const ValueKey(OutputPlacement.bottom))); | ||
await wt.pumpAndSettle(); | ||
expect(getCodeAreaCenter().dy < getOutputCenter().dy, true); | ||
expectSimilar(getCodeAreaCenter().dx, getOutputCenter().dx); | ||
} |
Oops, something went wrong.