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

test(cat-voices): smoke integration test #898

Merged
merged 23 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions catalyst_voices/integration_test/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
VERSION 0.8

IMPORT ../ AS catalyst-voices

integration-test-web:
FROM catalyst-voices+build-web
ARG TARGETARCH
ARG browser
LET driver_port = 4444

IF [ $browser = "chrome" ]
LET driver = "chromedriver"
END

IF [ $browser = "firefox" ]
LET driver = "geckodriver"
END
# Commenting out Edge tests as they are failing due to:
# https://github.com/flutter/flutter/issues/76213
# https://github.com/flutter/flutter/issues/142021
# IF [ $browser = "edge" && $TARGETARCH = "amd64" ]]
# LET driver = "msedgedriver"
# END
RUN ($driver --port=$driver_port > $driver.log &) && \
sleep 5 && \
flutter drive --driver=test_driver/integration_tests.dart \
--target=integration_test/app_test.dart \
-d web-server --browser-name=$browser --driver-port=$driver_port \
# https://github.com/flutter/flutter/issues/154727
--web-browser-flag=--disable-web-security \
--web-browser-flag=--disable-gpu \
--web-browser-flag=--headless=old \
--web-browser-flag=--disable-search-engine-choice-screen \
--profile || echo fail > fail
WAIT
SAVE ARTIFACT $driver.log AS LOCAL $driver.log
END
IF [ -f fail ]
RUN --no-cache echo ""$browser" integration test failed" && \
echo "Printing "$driver" logs..." && \
cat $driver.log && \
exit 1
END

test-web-all:
BUILD +integration-test-web \
--browser=chrome \
--browser=firefox
7 changes: 2 additions & 5 deletions catalyst_voices/integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('end-to-end test', () {
group('End to end tests', () {
testWidgets('run app', (tester) async {
final args = await bootstrap();
await tester.pumpWidget(App(routerConfig: args.routerConfig));
// let the application load
await tester.pump(const Duration(seconds: 5));

// pump and settle every 100ms to simulate almost production-like FPS
await tester.pumpAndSettle(const Duration(milliseconds: 100));

// wait 10s until the test is finished
await Future<void>.delayed(const Duration(seconds: 10));
expect(find.text('Coming'), findsOneWidget);
});
});
}
2 changes: 2 additions & 0 deletions catalyst_voices/integration_test/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "voices-integration-tests"
5 changes: 0 additions & 5 deletions catalyst_voices/integration_test/main.dart

This file was deleted.

36 changes: 0 additions & 36 deletions catalyst_voices/integration_test/scenarios/login_scenario.dart

This file was deleted.

This file was deleted.

43 changes: 0 additions & 43 deletions catalyst_voices/test_driver/Earthfile

This file was deleted.

Loading