Skip to content

Commit

Permalink
test(cat-voices): smoke integration test (#898)
Browse files Browse the repository at this point in the history
* feat: restore earthfile

* feat: adds simple test

* feat: remove old tests

* fix: format

* feat: adds bluprint.cue

* test: run only chrome

* test: run only firefox

* wip

* fix: earthly deps

* test

* test

* test

* test

* test

* fix: flutter drive params

* fix

---------

Co-authored-by: Steven Johnson <[email protected]>
  • Loading branch information
kukkok3 and stevenj authored Oct 30, 2024
1 parent 29b40c7 commit 6fd3020
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 135 deletions.
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.

46 changes: 0 additions & 46 deletions catalyst_voices/integration_test/scenarios/robots/login_robot.dart

This file was deleted.

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

This file was deleted.

0 comments on commit 6fd3020

Please sign in to comment.