Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tour of beam integration tests #25925

Merged
merged 124 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
933bb24
Integration test to load the default example of the default SDK and c…
alexeyinkin Dec 20, 2022
acd76ef
Fix formatting and README (#24730)
alexeyinkin Dec 20, 2022
07e78c6
Support collection v1.17.0 (#24730)
alexeyinkin Dec 21, 2022
5ffd808
LoadingIndicator on chaning examples, remove duplicating licenses (#2…
alexeyinkin Dec 21, 2022
9bb0268
Add a missing license header (#24730)
alexeyinkin Dec 21, 2022
27c870c
Merge branch 'master' into issue24730_integration_changing-example
alexeyinkin Dec 23, 2022
e888e27
Integration test for changing SDK and running code (#24779) (#382)
alexeyinkin Dec 28, 2022
cc8a998
Merge branch 'master' into issue24730_integration_changing-example
alexeyinkin Jan 4, 2023
9c16c66
Issue24779 integration changing sdk from 24370 (#387)
alexeyinkin Jan 4, 2023
8d4f85f
integration tests run and editing
Malarg Jan 12, 2023
d9c23a6
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 12, 2023
7dbd08b
example selector test
Malarg Jan 17, 2023
4fe215d
minor fixes
Malarg Jan 17, 2023
0e2a469
rat
Malarg Jan 17, 2023
a33d058
fix pr
Malarg Jan 24, 2023
b350351
minor
Malarg Jan 24, 2023
a9a5e88
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 24, 2023
01fe5a7
minor
Malarg Jan 24, 2023
4275eb6
rat
Malarg Jan 24, 2023
7316da0
integration test finder written
Malarg Jan 26, 2023
17b767a
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 26, 2023
c8deff8
integration test minor fixes
Malarg Jan 26, 2023
e3fcab5
minor fixes
Malarg Jan 26, 2023
77f372f
removed comment
Malarg Jan 26, 2023
52ad461
minor fixes
Malarg Jan 27, 2023
63f8faa
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 27, 2023
b047239
playground integration tests minor fixes
Malarg Jan 30, 2023
5514e59
integration test pumpAnSettleNoException
Malarg Jan 31, 2023
305e4cd
integration test shortcut refactor
Malarg Jan 31, 2023
01a0659
integration test another changing shortcuts running
Malarg Jan 31, 2023
014906f
upgrade to flutter 3.7.1
Malarg Feb 6, 2023
e527f59
workaround comment
Malarg Feb 6, 2023
7f9adc0
playground frontend updated major versions
Malarg Feb 7, 2023
d4fd93f
issues 25329 25331 25336
Malarg Feb 9, 2023
488f8d3
Merge branch 'master' into issue25329_fix-cors-issue-when-no-internet
Malarg Feb 9, 2023
8034768
25329 extract connectivity extension to separate file
Malarg Feb 9, 2023
53e09ca
Merge remote-tracking branch 'apache/master' into playground_integrat…
alexeyinkin Feb 14, 2023
e77ffaf
Upgrade Flutter to 3.7.3 in integration tests (#24730)
alexeyinkin Feb 14, 2023
a90fbbf
Fix integration test (#24730)
alexeyinkin Feb 14, 2023
72a0ed3
Merge remote-tracking branch 'origin/issue25337_flutter371' into play…
alexeyinkin Feb 14, 2023
916a966
fix cors issue and added mouse scroll to tags
Malarg Feb 14, 2023
cd83c1f
Upgrade Flutter in Dockerfile (#24720)
alexeyinkin Feb 14, 2023
ffa95e7
sorting moved to model
Malarg Feb 15, 2023
eb33795
sorting moved to model
Malarg Feb 15, 2023
399a80a
sorting moved to model
Malarg Feb 15, 2023
0fe9113
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Feb 16, 2023
6080a4b
bugs fix
Malarg Feb 16, 2023
b7b14b4
issue 25278
Malarg Feb 16, 2023
2ca302e
fix pr
Malarg Feb 17, 2023
781de4f
quites fix in en.yaml
Malarg Feb 17, 2023
694e22e
Fix not loading default example (#25528)
alexeyinkin Feb 17, 2023
284ed49
Merge branch 'master' into issue25329
Malarg Feb 17, 2023
ccf8c3b
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Feb 17, 2023
03f7a5f
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Feb 17, 2023
28449be
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Feb 17, 2023
6e4581b
fix compile error
Malarg Feb 17, 2023
3aa9fec
Refactor output tabs, test embedded playground (#25136) (#439)
alexeyinkin Feb 21, 2023
1e17d04
Change example paths to IDs in integration tests
alexeyinkin Feb 24, 2023
143f83e
issue25640 tob ci
Malarg Feb 27, 2023
aa09caf
fix tob ci
Malarg Feb 27, 2023
7359019
rename ci process
Malarg Feb 27, 2023
4b44db4
test add new line to main
Malarg Feb 27, 2023
52046a3
test add new line to main
Malarg Feb 27, 2023
75a1d9c
commented unit test run
Malarg Feb 27, 2023
7b06a06
issue25640 changed server path
Malarg Feb 28, 2023
87e1982
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Feb 28, 2023
9359e97
issue25640 tests on welcome page
Malarg Mar 1, 2023
dd1d275
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Mar 1, 2023
53a2ca3
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 1, 2023
f6ee5e6
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Mar 1, 2023
36c309a
deleted config.g.dart
Malarg Mar 1, 2023
4af6e0d
issue25640 pr fixes
Malarg Mar 2, 2023
933fa04
Update .github/workflows/tour_of_beam_frontend_test.yml
Malarg Mar 7, 2023
b4127e0
Update learning/tour-of-beam/frontend/integration_test/welcome_page_t…
Malarg Mar 7, 2023
dfa6368
Improve tests (#25640)
alexeyinkin Mar 9, 2023
2e39382
issue25640 tour page tests
Malarg Mar 20, 2023
1a86439
Merge branch 'issue25640_tob-ci' of https://github.com/akvelon/beam i…
Malarg Mar 20, 2023
047e794
pr fix
Malarg Mar 21, 2023
f1b108e
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 22, 2023
bf31f9e
removed import
Malarg Mar 22, 2023
7535dab
pr fix
Malarg Mar 23, 2023
ebd67eb
fix test
Malarg Mar 23, 2023
9309a37
25640 fixed pubspec.lock
Malarg Mar 27, 2023
ae2f89b
issue25640 fix readme
Malarg Mar 27, 2023
771c193
updated readme
Malarg Mar 27, 2023
35c2bea
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 28, 2023
02f9c43
issue25640 fixed after master merge
Malarg Mar 28, 2023
3e251dc
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 29, 2023
fc5c86b
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 29, 2023
4a67a9a
issue25483 ToB pipeline options
Malarg Mar 29, 2023
be52314
removed unnecesary variable
Malarg Mar 29, 2023
14b5b78
Merge branch 'issue25640_tob-ci' of https://github.com/akvelon/beam i…
Malarg Mar 29, 2023
218e67b
Merge branch 'master' into issue25640_tob-ci
Malarg Mar 29, 2023
438c164
Merge branch 'issue25640_tob-ci' into issue25483_tob_pipeline_options
Malarg Mar 29, 2023
e870d96
pr fix
Malarg Mar 31, 2023
c36f258
Update learning/tour-of-beam/frontend/assets/translations/en.yaml
Malarg Apr 4, 2023
2538b90
playground hides when snippet does not exists
Malarg Apr 4, 2023
d72b1e5
Merge pull request #447 from akvelon/issue25483_tob_pipeline_options
Malarg Apr 4, 2023
6d176b0
Merge branch 'master' into issue25640_tob-ci
Malarg Apr 10, 2023
e452e96
pipeline options extracted to playground components
Malarg Apr 10, 2023
406f21b
issue25483 pipeline options
Malarg Apr 12, 2023
182c34a
Merge branch 'master' into issue25640_tob-ci
Malarg Apr 12, 2023
fcba299
Merge branch 'master' into issue25483_pipeline_options_refactoring
Malarg Apr 12, 2023
fb12ffa
Merge branch 'issue25640_tob-ci' into issue25483_pipeline_options_ref…
Malarg Apr 12, 2023
a919d42
added errors handling, fix pr
Malarg Apr 13, 2023
1540961
refactoring
Malarg Apr 18, 2023
08e3c1c
Revert "refactoring"
Malarg Apr 18, 2023
f12bee4
removed unnecessary constants
Malarg Apr 18, 2023
970e389
playground controller in tour notifier becomes nullable
Malarg Apr 18, 2023
201d9c3
playground controller returned to non nullable in tour notifier
Malarg Apr 20, 2023
6638410
playground controller actions
Malarg Apr 20, 2023
cc85b95
removed unnecessary code
Malarg Apr 20, 2023
7197217
tob scaffold wrapped with animated builder
Malarg Apr 20, 2023
8f67265
minor fixes
Malarg Apr 21, 2023
30875f9
Merge pull request #455 from akvelon/issue25483_pipeline_options_refa…
Malarg Apr 21, 2023
f7b3017
Merge branch 'master' into issue25640_tob-ci
Malarg Apr 26, 2023
19f6dda
partially fixed tests
Malarg Apr 26, 2023
07d8023
Upgrade flutter_code_editor to v0.2.19 (#25640)
alexeyinkin Apr 27, 2023
c0867d6
Replace output SelectableText with a CodeField instance (#25640)
alexeyinkin Apr 27, 2023
ad9b031
Trigger ToB integration tests (#25640)
alexeyinkin Apr 27, 2023
6ac4fd6
Clean up (#25640)
alexeyinkin Apr 27, 2023
25b04b9
Merge remote-tracking branch 'origin/master' into issue25640_tob-ci
alexeyinkin Apr 28, 2023
686655c
Merge remote-tracking branch 'apache/master' into issue25640_tob-ci
alexeyinkin Apr 28, 2023
bdcb5b0
Enable manual workflow runs for Playground and ToB integration tests …
alexeyinkin May 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/playground_frontend_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
pull_request:
paths: ['playground/frontend/**']
branches: ['**']
workflow_dispatch:
damccorm marked this conversation as resolved.
Show resolved Hide resolved

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/tour_of_beam_frontend_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 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.

name: Tour Of Beam Fronend Test
damccorm marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
paths: ['learning/tour-of-beam/frontend/**', 'playground/frontend/playground_components']
branches: ['**']
pull_request:
paths: ['learning/tour-of-beam/frontend/**', 'playground/frontend/playground_components']
branches: ['**']

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
tour_of_beam_test:
name: Tour of Beam Test
runs-on: ubuntu-latest

env:
FLUTTER_VERSION: '3.7.3'

steps:
- uses: actions/checkout@v3

- name: 'Cache Flutter Dependencies'
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
restore-keys: ${{ runner.OS }}-flutter-install-cache

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'

- name: 'Install Dependencies'
run: |
cd playground/frontend/playground_components && flutter pub get && cd -
cd playground/frontend/playground_components_dev && flutter pub get && cd -
cd learning/tour-of-beam/frontend && flutter pub get && cd -
Comment on lines +61 to +63
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be in the learning/tour-of-beam/frontend README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


# - name: 'Formatting'
# run: dart format --output=none --set-exit-if-changed .

# - name: 'Analyze playground_components'
# working-directory: playground/frontend/playground_components
# run: dart analyze --fatal-infos

# - name: 'Analyze playground_components_dev'
# working-directory: playground/frontend/playground_components_dev
# run: dart analyze --fatal-infos

# - name: 'Analyze playground'
# working-directory: playground/frontend
# run: dart analyze --fatal-infos lib test

# - name: 'Test tour of beam'
# working-directory: learning/tour-of-beam/frontend
# run: flutter test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete instead of commenting out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


- uses: nanasess/setup-chromedriver@v1

- name: 'Integration tests'
run: |
chromedriver --port=4444 &
./gradlew :learning:tour-of-beam:frontend:integrationTest -PdeviceId=web-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to go into the tob frontend README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

33 changes: 33 additions & 0 deletions learning/tour-of-beam/frontend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,36 @@ val deleteFilesByRegExp: (String) -> Unit = { re ->
args("assets", "lib", "test", "-regex", re, "-delete")
}
}

tasks.register("integrationTest") {
dependsOn("integrationTest_tour_page")
dependsOn("integrationTest_welcome_page")
}

tasks.register("integrationTest_tour_page") {
doLast {
runIntegrationTest("tour_page", "/")
}
}

tasks.register("integrationTest_welcome_page") {
doLast {
runIntegrationTest("welcome_page", "/")
}
}

fun runIntegrationTest(path: String, url: String) {
// Run with -PdeviceId=web-server for headless tests.
val deviceId: String = if (project.hasProperty("deviceId")) project.property("deviceId") as String else "chrome"

exec {
executable = "flutter"
args(
"drive",
"--driver=test_driver/integration_test.dart",
"--target=integration_test/${path}_test.dart",
"--web-launch-url='$url'",
"--device-id=$deviceId",
)
}
}
32 changes: 32 additions & 0 deletions learning/tour-of-beam/frontend/integration_test/common/common.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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:tour_of_beam/main.dart' as app;
import 'package:tour_of_beam/pages/tour/controllers/content_tree.dart';
import 'package:tour_of_beam/pages/tour/widgets/content_tree.dart';

Future<void> init(WidgetTester wt) async {
await app.main();
await wt.pumpAndSettle();
}

ContentTreeController getContentTreeController(WidgetTester wt) {
return (wt.widget(find.byType(ContentTreeWidget)) as ContentTreeWidget)
.controller;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,19 @@
*/

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:playground_components/playground_components.dart';
import 'package:tour_of_beam/main.dart' as app;
import 'package:tour_of_beam/components/sdk_dropdown.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
extension CommonFindersExtension on CommonFinders {
Finder sdkDropdown() {
return byType(SdkDropdown);
}

group('theme', () {
testWidgets('mode toggle', (tester) async {
app.main();
await tester.pumpAndSettle();
final Finder switchToDarkModeButton =
find.widgetWithText(ToggleThemeButton, 'ui.darkMode'.tr());
expect(switchToDarkModeButton, findsOneWidget);
await tester.tap(switchToDarkModeButton);
await tester.pumpAndSettle();
expect(
find.widgetWithText(ToggleThemeButton, 'ui.lightMode'.tr()),
findsOneWidget,
);
});
});
Finder startTourButton() {
return find.ancestor(
of: find.text('pages.welcome.startTour'.tr()),
matching: find.byType(ElevatedButton),
);
}
}
Loading