From 679a6a345261a8f995d733fc23b4bbac38739193 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 15:58:19 +0100 Subject: [PATCH 01/43] try enabling integration tests --- catalyst_voices/apps/voices/integration_test/Earthfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 84470172b61..54a6aff5c2e 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -27,7 +27,7 @@ integration-test-web: RUN ($driver --port=$driver_port > $driver.log &) && \ sleep 5 && \ flutter drive --driver=test_driver/integration_tests.dart \ - --target=integration_test/app_test.dart \ + --target=integration_test/all_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 \ @@ -49,7 +49,6 @@ integration-test-web: # TODO(dtscalac): disabled integration tests due to them being flaky, # reenable when enable-threads.js workaround is removed # and https://github.com/fzyzcjy/flutter_rust_bridge/issues/2407 closed -disabled-test-web-all: +test-web-all: BUILD +integration-test-web \ - --browser=chrome \ - --browser=firefox + --browser=chrome From a6a97677d72ae8170157ef0d58c0bbd7e48287c7 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 17:26:12 +0100 Subject: [PATCH 02/43] try with minimal tests --- .../apps/voices/integration_test/all_test.dart | 4 ++-- .../integration_test/suites/onboarding_test.dart | 14 -------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index a87f2cfee63..2b0302961cc 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -13,7 +13,7 @@ void main() async { await bootstrap(router: buildAppRouter()); }); - app_test.main(); - onboarding_test.main(); + // app_test.main(); + // onboarding_test.main(); account_test.main(); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 62d832c33cc..27e71391065 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -764,19 +764,5 @@ void main() async { }, ); }, - skip: true, - ); - - patrolWidgetTest( - 'visitor - restore - keychain choice screen looks OK', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(AppBarPage.getStartedBtn).tap(settleTimeout: Time.long.duration); - await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); - await OnboardingPage.onboardingScreenLooksAsExpected( - $, - RegistrationState.keychainRestoreChoice, - ); - }, ); } From c8d852ab227239b08c019e31067fa632098f3d52 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 17:32:54 +0100 Subject: [PATCH 03/43] try with minimal tests --- catalyst_voices/apps/voices/integration_test/all_test.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index 2b0302961cc..ed0ebf6c42c 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -3,8 +3,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'suites/account_test.dart' as account_test; -import 'suites/app_test.dart' as app_test; -import 'suites/onboarding_test.dart' as onboarding_test; void main() async { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); From 217a600074321b254c95b12e495e1f7a921a68b8 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 17 Jan 2025 10:12:07 +0100 Subject: [PATCH 04/43] try with headless=new --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 54a6aff5c2e..b891e8990c2 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -32,7 +32,7 @@ integration-test-web: # 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=--headless=new \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile || echo fail > fail WAIT From 8d31e5e4f148d09ea0a6a70202b14ca21b0782ab Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 17 Jan 2025 12:02:06 +0100 Subject: [PATCH 05/43] try with headless --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index b891e8990c2..29732f3c60f 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -32,7 +32,7 @@ integration-test-web: # https://github.com/flutter/flutter/issues/154727 --web-browser-flag=--disable-web-security \ --web-browser-flag=--disable-gpu \ - --web-browser-flag=--headless=new \ + --web-browser-flag=--headless \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile || echo fail > fail WAIT From b0cace81960d7a7d515b00f791a4f8494431689c Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 20 Jan 2025 13:39:07 +0100 Subject: [PATCH 06/43] try with updated browsers --- catalyst_voices/Earthfile | 16 ++++++++-------- .../apps/voices/integration_test/Earthfile | 16 +++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 4b666623342..0b45ccdafc9 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.31 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:flutter-using-updated-browsers AS flutter-ci # repo-catalyst-voices - Creates artifacts of all configuration files, # packages and folders related to catalyst_voices frontend. @@ -32,17 +32,17 @@ filter-openapi: RUN rm openapi/cat-gateway-api.json - SAVE ARTIFACT openapi/filtered-openapi.json + SAVE ARTIFACT openapi/filtered-openapi.json # Generates flutter code. # Generates codes for Catalyst Gateway OpenAPI, Voices Localization and # VoicesAssets and other packages that depend on code-generator. # It accepts [save_locally] ARG that when true place the artifacts in the -# proper folders +# proper folders # It accepts [filter_openapi] ARG that when true filter the openapi spec # using filters from /packages/internal/catalyst_voices_repositories/openapi-filters.json code-generator: - ARG save_locally=false + ARG save_locally=false ARG filter_openapi=true FROM +builder LET gen_code_path = lib/generated/api @@ -57,7 +57,7 @@ code-generator: FOR generated_file IN $(find . \( -name "*.g.dart" -o -name "*.freezed.dart" -o -name "*.chopper.dart" -o -name "*.swagger.dart" -o -name "*.openapi.dart" -o -name "*.gen.dart" -o -name "catalyst_voices_localizations*.dart" -o -name "cat_gateway_api.*.swagger.*" \)) SAVE ARTIFACT $generated_file AS LOCAL $generated_file END - ELSE + ELSE SAVE ARTIFACT . END WORKDIR packages/internal/catalyst_voices_repositories @@ -75,12 +75,12 @@ code-generator: # restore current working directory to the root of the project WORKDIR /frontend - + # Runs static analysis on the code. check-static-analysis: FROM +code-generator - DO flutter-ci+ANALYZE + DO flutter-ci+ANALYZE # Runs code formatting checks. check-code-formatting: @@ -132,4 +132,4 @@ docker: ARG container="voices" ARG tag="latest" - SAVE IMAGE ${container}:${tag} \ No newline at end of file + SAVE IMAGE ${container}:${tag} diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 29732f3c60f..29f353bd25a 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -34,17 +34,19 @@ integration-test-web: --web-browser-flag=--disable-gpu \ --web-browser-flag=--headless \ --web-browser-flag=--disable-search-engine-choice-screen \ - --profile || echo fail > fail + --profile +# TODO(oldgreg): make tests run without failing workflow until issue #2407 is released +# --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 +# IF [ -f fail ] +# RUN --no-cache echo ""$browser" integration test failed" && \ +# echo "Printing "$driver" logs..." && \ +# cat $driver.log && \ +# exit 1 +# END # TODO(dtscalac): disabled integration tests due to them being flaky, # reenable when enable-threads.js workaround is removed From 25a883cef0901f13ca6cf12520a184edfc457925 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 20 Jan 2025 15:13:15 +0100 Subject: [PATCH 07/43] cleanup --- .config/dictionaries/project.dic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 64a3b5ec5d4..0c0efac1bbb 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -205,6 +205,7 @@ Nodetool NuFi oapi OCSP +oldgreg Oleksandr onboarded oneshot @@ -354,4 +355,4 @@ xpublic xvfb yoroi stake1u94ullc9nj9gawc08990nx8hwgw80l9zpmr8re44kydqy9cdjq6rq -invalid1u9nlq5nmuzthw3vhgakfpxyq4r0zl2c0p8uqy24gpyjsa6c3df4h6 \ No newline at end of file +invalid1u9nlq5nmuzthw3vhgakfpxyq4r0zl2c0p8uqy24gpyjsa6c3df4h6 From 63d99df8d1f7327a7233cd5fb69d086aca078f6b Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 20 Jan 2025 22:16:20 +0100 Subject: [PATCH 08/43] revert --- catalyst_voices/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 0b45ccdafc9..926af8118bf 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:flutter-using-updated-browsers AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.31 AS flutter-ci # repo-catalyst-voices - Creates artifacts of all configuration files, # packages and folders related to catalyst_voices frontend. From acbd83e2d37da9f509df04de541ca4564fb912fa Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 20 Jan 2025 22:20:38 +0100 Subject: [PATCH 09/43] use branch --- catalyst_voices/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 926af8118bf..0b45ccdafc9 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.31 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:flutter-using-updated-browsers AS flutter-ci # repo-catalyst-voices - Creates artifacts of all configuration files, # packages and folders related to catalyst_voices frontend. From 5e584e9995d55fcb5035bc69419ee546163bc970 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 21 Jan 2025 12:34:01 +0100 Subject: [PATCH 10/43] try 1 --- .../apps/voices/integration_test/suites/onboarding_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 2223d1ff66f..7181741512b 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -767,5 +767,6 @@ void main() async { }, ); }, + skip: true, ); } From 1c58cd843fb756c3bfa8a815395c35cae08ee84e Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 21 Jan 2025 13:19:44 +0100 Subject: [PATCH 11/43] try 2 --- .../apps/voices/integration_test/suites/onboarding_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 7181741512b..2223d1ff66f 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -767,6 +767,5 @@ void main() async { }, ); }, - skip: true, ); } From d1bd473651589b77cdf1edb37f1fe40a138f9f4b Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 21 Jan 2025 13:59:52 +0100 Subject: [PATCH 12/43] try 3 --- .../apps/voices/integration_test/suites/onboarding_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 2223d1ff66f..7181741512b 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -767,5 +767,6 @@ void main() async { }, ); }, + skip: true, ); } From 52709739447610588c1a7c050a41a094033ad6b3 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Wed, 22 Jan 2025 12:07:59 +0100 Subject: [PATCH 13/43] try 4 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 29f353bd25a..8f40663870c 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,7 +24,7 @@ integration-test-web: WORKDIR /frontend/apps/voices - RUN ($driver --port=$driver_port > $driver.log &) && \ + RUN ($driver --port=4444 > $driver.log &) && \ sleep 5 && \ flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ From 5fd2febf7802f7e86b5b405489b41a9d149b57df Mon Sep 17 00:00:00 2001 From: januszjanus Date: Wed, 22 Jan 2025 12:28:44 +0100 Subject: [PATCH 14/43] try 5 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 8f40663870c..29f353bd25a 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,7 +24,7 @@ integration-test-web: WORKDIR /frontend/apps/voices - RUN ($driver --port=4444 > $driver.log &) && \ + RUN ($driver --port=$driver_port > $driver.log &) && \ sleep 5 && \ flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ From 5f000914b2f31f6dd6d7bc1e9698111047929a91 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Wed, 22 Jan 2025 12:49:20 +0100 Subject: [PATCH 15/43] debug driver logs --- catalyst_voices/apps/voices/integration_test/Earthfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 29f353bd25a..c6f6f515d35 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -42,9 +42,9 @@ integration-test-web: END # IF [ -f fail ] -# RUN --no-cache echo ""$browser" integration test failed" && \ -# echo "Printing "$driver" logs..." && \ -# cat $driver.log && \ + RUN --no-cache echo ""$browser" integration test failed" && \ + echo "Printing "$driver" logs..." && \ + cat $driver.log && \ # exit 1 # END From 1f0bcdd4a6b72ceff7210634cc81e0f465ec2691 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Wed, 22 Jan 2025 13:14:02 +0100 Subject: [PATCH 16/43] try 2 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index c6f6f515d35..400e03eccf1 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -46,7 +46,7 @@ integration-test-web: echo "Printing "$driver" logs..." && \ cat $driver.log && \ # exit 1 -# END + END # TODO(dtscalac): disabled integration tests due to them being flaky, # reenable when enable-threads.js workaround is removed From 02beec5050cb5c59b7026679552b2d68d6b442a1 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 10:46:40 +0100 Subject: [PATCH 17/43] try 3 --- .../apps/voices/integration_test/Earthfile | 12 +- .../voices/integration_test/all_test.dart | 6 +- .../integration_test/suites/app_test.dart | 280 +++++++++--------- 3 files changed, 155 insertions(+), 143 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 400e03eccf1..064ace8ce83 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -34,19 +34,17 @@ integration-test-web: --web-browser-flag=--disable-gpu \ --web-browser-flag=--headless \ --web-browser-flag=--disable-search-engine-choice-screen \ - --profile -# TODO(oldgreg): make tests run without failing workflow until issue #2407 is released -# --profile || echo fail > fail + --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 && \ +# RUN --no-cache echo ""$browser" integration test failed" && \ +# echo "Printing "$driver" logs..." && \ +# cat $driver.log && \ # exit 1 - END +# END # TODO(dtscalac): disabled integration tests due to them being flaky, # reenable when enable-threads.js workaround is removed diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index afeb3d85150..cc3fe0ccde0 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -2,7 +2,7 @@ import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'suites/account_test.dart' as account_test; +import 'suites/app_test.dart' as app_test; void main() async { final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -12,7 +12,7 @@ void main() async { await bootstrap(router: buildAppRouter()); }); - // app_test.main(); + app_test.main(); // onboarding_test.main(); - account_test.main(); + // account_test.main(); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index b52e4d56bf3..297e64fa574 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -29,137 +29,151 @@ void main() async { await restartDependencies(); }); - group('Spaces drawer -', () { - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: Time.long.duration); - expect($(AppBarPage.spacesDrawerButton).exists, false); - }, - ); - - patrolWidgetTest( - 'guest - chooser - clicking on icons works correctly', - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - - // iterate thru spaces by clicking on spaces icons directly - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.guestLooksAsExpected($, space); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - }, - ); - - patrolWidgetTest( - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - 'guest - chooser - next,previous buttons work correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - - // iterate thru spaces by clicking next - for (final space in Space.values) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserNextBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - - // iterate thru spaces by clicking previous - for (final space in Space.values.reversed) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserPrevBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); - }, - ); - - patrolWidgetTest( - 'user - chooser - clicking on icons works correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.userLooksAsExpected($, space); - } - }, - ); - - patrolWidgetTest( - 'guest - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'user - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'check tooltip text', - (PatrolTester $) async { - final spaceToTooltipText = { - Space.discovery: 'Discovery space', - Space.workspace: 'Workspace', - Space.voting: 'Voting space', - Space.fundedProjects: 'Funded project space', - Space.treasury: 'Treasury space', - }; - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await $(SpacesDrawerPage.chooserIcon(space)).longPress(); - await Future.delayed(const Duration(seconds: 1)); - final expectedText = spaceToTooltipText[space]; - final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); - final tooltipElement = find.descendant( - of: chooserItem, - matching: find.byKey(SpacesDrawerPage.tooltipElement), - ); - final tooltipTextElement = find.descendant( - of: tooltipElement, - matching: find.byType(Text), - ); - - final tooltipText = $(tooltipTextElement).text; - expect(tooltipText, expectedText); - } - }, - ); - }); + group( + 'Spaces drawer -', + () { + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: Time.long.duration); + expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); + + patrolWidgetTest( + 'guest - chooser - clicking on icons works correctly', + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + + // iterate thru spaces by clicking on spaces icons directly + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.guestLooksAsExpected($, space); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + }, + ); + + patrolWidgetTest( + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + 'guest - chooser - next,previous buttons work correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + + // iterate thru spaces by clicking next + for (final space in Space.values) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserNextBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + + // iterate thru spaces by clicking previous + for (final space in Space.values.reversed) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserPrevBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); + }, + ); + + patrolWidgetTest( + 'user - chooser - clicking on icons works correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.userLooksAsExpected($, space); + } + }, + ); + + patrolWidgetTest( + 'guest - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'user - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'check tooltip text', + (PatrolTester $) async { + final spaceToTooltipText = { + Space.discovery: 'Discovery space', + Space.workspace: 'Workspace', + Space.voting: 'Voting space', + Space.fundedProjects: 'Funded project space', + Space.treasury: 'Treasury space', + }; + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await $(SpacesDrawerPage.chooserIcon(space)).longPress(); + await Future.delayed(const Duration(seconds: 1)); + final expectedText = spaceToTooltipText[space]; + final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + final tooltipElement = find.descendant( + of: chooserItem, + matching: find.byKey(SpacesDrawerPage.tooltipElement), + ); + final tooltipTextElement = find.descendant( + of: tooltipElement, + matching: find.byType(Text), + ); + + final tooltipText = $(tooltipTextElement).text; + expect(tooltipText, expectedText); + } + }, + ); + }, + skip: true, + ); + + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.visitorShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); } From de6409f21f305274627ce30d347cec8ab9b44222 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 11:29:04 +0100 Subject: [PATCH 18/43] try 4 --- .../apps/voices/integration_test/Earthfile | 14 +- .../voices/integration_test/all_test.dart | 6 +- .../integration_test/suites/app_test.dart | 280 +++++++++--------- .../suites/onboarding_test.dart | 1 - 4 files changed, 145 insertions(+), 156 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 064ace8ce83..ae270a3574e 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -39,16 +39,18 @@ integration-test-web: 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 && \ + IF [ -f fail ] + RUN --no-cache echo ""$browser" integration test failed" && \ + echo "Printing "$driver" logs..." && \ + cat $driver.log # exit 1 -# END + END # TODO(dtscalac): disabled integration tests due to them being flaky, # reenable when enable-threads.js workaround is removed # and https://github.com/fzyzcjy/flutter_rust_bridge/issues/2407 closed +# Enable but do not fail the build for now test-web-all: BUILD +integration-test-web \ - --browser=chrome + --browser=chrome \ + --browser=firefox diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index cc3fe0ccde0..ce5f6ff0771 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -2,7 +2,9 @@ import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; +import 'suites/account_test.dart' as account_test; import 'suites/app_test.dart' as app_test; +import 'suites/onboarding_test.dart' as onboarding_test; void main() async { final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -13,6 +15,6 @@ void main() async { }); app_test.main(); - // onboarding_test.main(); - // account_test.main(); + onboarding_test.main(); + account_test.main(); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 297e64fa574..b52e4d56bf3 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -29,151 +29,137 @@ void main() async { await restartDependencies(); }); - group( - 'Spaces drawer -', - () { - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: Time.long.duration); - expect($(AppBarPage.spacesDrawerButton).exists, false); - }, - ); - - patrolWidgetTest( - 'guest - chooser - clicking on icons works correctly', - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - - // iterate thru spaces by clicking on spaces icons directly - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.guestLooksAsExpected($, space); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - }, - ); - - patrolWidgetTest( - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - 'guest - chooser - next,previous buttons work correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - - // iterate thru spaces by clicking next - for (final space in Space.values) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserNextBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - - // iterate thru spaces by clicking previous - for (final space in Space.values.reversed) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserPrevBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); - }, - ); - - patrolWidgetTest( - 'user - chooser - clicking on icons works correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.userLooksAsExpected($, space); - } - }, - ); - - patrolWidgetTest( - 'guest - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'user - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'check tooltip text', - (PatrolTester $) async { - final spaceToTooltipText = { - Space.discovery: 'Discovery space', - Space.workspace: 'Workspace', - Space.voting: 'Voting space', - Space.fundedProjects: 'Funded project space', - Space.treasury: 'Treasury space', - }; - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await $(SpacesDrawerPage.chooserIcon(space)).longPress(); - await Future.delayed(const Duration(seconds: 1)); - final expectedText = spaceToTooltipText[space]; - final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); - final tooltipElement = find.descendant( - of: chooserItem, - matching: find.byKey(SpacesDrawerPage.tooltipElement), - ); - final tooltipTextElement = find.descendant( - of: tooltipElement, - matching: find.byType(Text), - ); - - final tooltipText = $(tooltipTextElement).text; - expect(tooltipText, expectedText); - } - }, - ); - }, - skip: true, - ); - - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.visitorShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // expect($(AppBarPage.spacesDrawerButton).exists, false); - }, - ); + group('Spaces drawer -', () { + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: Time.long.duration); + expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); + + patrolWidgetTest( + 'guest - chooser - clicking on icons works correctly', + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + + // iterate thru spaces by clicking on spaces icons directly + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.guestLooksAsExpected($, space); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + }, + ); + + patrolWidgetTest( + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + 'guest - chooser - next,previous buttons work correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + + // iterate thru spaces by clicking next + for (final space in Space.values) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserNextBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + + // iterate thru spaces by clicking previous + for (final space in Space.values.reversed) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserPrevBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); + }, + ); + + patrolWidgetTest( + 'user - chooser - clicking on icons works correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.userLooksAsExpected($, space); + } + }, + ); + + patrolWidgetTest( + 'guest - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'user - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'check tooltip text', + (PatrolTester $) async { + final spaceToTooltipText = { + Space.discovery: 'Discovery space', + Space.workspace: 'Workspace', + Space.voting: 'Voting space', + Space.fundedProjects: 'Funded project space', + Space.treasury: 'Treasury space', + }; + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await $(SpacesDrawerPage.chooserIcon(space)).longPress(); + await Future.delayed(const Duration(seconds: 1)); + final expectedText = spaceToTooltipText[space]; + final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + final tooltipElement = find.descendant( + of: chooserItem, + matching: find.byKey(SpacesDrawerPage.tooltipElement), + ); + final tooltipTextElement = find.descendant( + of: tooltipElement, + matching: find.byType(Text), + ); + + final tooltipText = $(tooltipTextElement).text; + expect(tooltipText, expectedText); + } + }, + ); + }); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 7181741512b..2223d1ff66f 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -767,6 +767,5 @@ void main() async { }, ); }, - skip: true, ); } From b19554b5450e9e881a1abbbf82e905b3921e1b1d Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 11:56:47 +0100 Subject: [PATCH 19/43] use ci 3.2.33 --- catalyst_voices/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 0b45ccdafc9..0e62799f9ab 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:flutter-using-updated-browsers AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.33 AS flutter-ci # repo-catalyst-voices - Creates artifacts of all configuration files, # packages and folders related to catalyst_voices frontend. From 6e3eb153d25c0a0c40e2de23f3fe06f692aef2e1 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 12:23:57 +0100 Subject: [PATCH 20/43] run tests on chrome only --- catalyst_voices/apps/voices/integration_test/Earthfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index ae270a3574e..dd8a1511794 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -52,5 +52,4 @@ integration-test-web: # Enable but do not fail the build for now test-web-all: BUILD +integration-test-web \ - --browser=chrome \ - --browser=firefox + --browser=chrome From d7e3c5c1df5584cbfb0c989dc4486346919a0514 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 13:20:54 +0100 Subject: [PATCH 21/43] move integration tests to be run nightly --- .github/workflows/nightly-ci.yml | 8 ++++++++ catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index b1e10fb0045..93f3701e5d6 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -65,6 +65,14 @@ jobs: command: run args: ./catalyst-gateway/tests/schemathesis_tests+nightly-test-fuzzer-api + - name: Get integration tests report + uses: input-output-hk/catalyst-forge/actions/run@ci/v1.7.0 + if: always() + continue-on-error: true + with: + command: run + args: ./catalyst-voices/apps/voices/integration_test+nightly-test-web-all + - name: Collect and upload test reports uses: actions/upload-artifact@v4 if: always() diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index dd8a1511794..b06765e5875 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -50,6 +50,6 @@ integration-test-web: # reenable when enable-threads.js workaround is removed # and https://github.com/fzyzcjy/flutter_rust_bridge/issues/2407 closed # Enable but do not fail the build for now -test-web-all: +nightly-test-web-all: BUILD +integration-test-web \ --browser=chrome From 47576f963c18270650252262f7ef086b245df92b Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 14:06:59 +0100 Subject: [PATCH 22/43] typo fix --- .github/workflows/nightly-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 93f3701e5d6..316b2ee9e5e 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -71,7 +71,7 @@ jobs: continue-on-error: true with: command: run - args: ./catalyst-voices/apps/voices/integration_test+nightly-test-web-all + args: ./catalyst_voices/apps/voices/integration_test+nightly-test-web-all - name: Collect and upload test reports uses: actions/upload-artifact@v4 From 2edb20ab6396584e986593c091e443cf3d504aee Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 14:57:43 +0100 Subject: [PATCH 23/43] running minimal scope --- .../voices/integration_test/all_test.dart | 6 +- .../integration_test/suites/app_test.dart | 276 +++++++++--------- 2 files changed, 145 insertions(+), 137 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index ce5f6ff0771..cc3fe0ccde0 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -2,9 +2,7 @@ import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'suites/account_test.dart' as account_test; import 'suites/app_test.dart' as app_test; -import 'suites/onboarding_test.dart' as onboarding_test; void main() async { final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -15,6 +13,6 @@ void main() async { }); app_test.main(); - onboarding_test.main(); - account_test.main(); + // onboarding_test.main(); + // account_test.main(); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index b52e4d56bf3..76fc447f0f4 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -29,137 +29,147 @@ void main() async { await restartDependencies(); }); - group('Spaces drawer -', () { - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: Time.long.duration); - expect($(AppBarPage.spacesDrawerButton).exists, false); - }, - ); - - patrolWidgetTest( - 'guest - chooser - clicking on icons works correctly', - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - - // iterate thru spaces by clicking on spaces icons directly - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.guestLooksAsExpected($, space); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - }, - ); - - patrolWidgetTest( - tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - skip: true, - 'guest - chooser - next,previous buttons work correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - - // iterate thru spaces by clicking next - for (final space in Space.values) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserNextBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - - // iterate thru spaces by clicking previous - for (final space in Space.values.reversed) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserPrevBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); - }, - ); - - patrolWidgetTest( - 'user - chooser - clicking on icons works correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.userLooksAsExpected($, space); - } - }, - ); - - patrolWidgetTest( - 'guest - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'user - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'check tooltip text', - (PatrolTester $) async { - final spaceToTooltipText = { - Space.discovery: 'Discovery space', - Space.workspace: 'Workspace', - Space.voting: 'Voting space', - Space.fundedProjects: 'Funded project space', - Space.treasury: 'Treasury space', - }; - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: Time.long.duration); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await $(SpacesDrawerPage.chooserIcon(space)).longPress(); - await Future.delayed(const Duration(seconds: 1)); - final expectedText = spaceToTooltipText[space]; - final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); - final tooltipElement = find.descendant( - of: chooserItem, - matching: find.byKey(SpacesDrawerPage.tooltipElement), - ); - final tooltipTextElement = find.descendant( - of: tooltipElement, - matching: find.byType(Text), - ); - - final tooltipText = $(tooltipTextElement).text; - expect(tooltipText, expectedText); - } - }, - ); - }); + // group('Spaces drawer -', () { + // patrolWidgetTest( + // 'visitor - no drawer button', + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.visitorShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // expect($(AppBarPage.spacesDrawerButton).exists, false); + // }, + // ); + // + // patrolWidgetTest( + // 'guest - chooser - clicking on icons works correctly', + // tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + // skip: true, + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.guestShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // SpacesDrawerPage.commonElementsLookAsExpected($); + // + // // iterate thru spaces by clicking on spaces icons directly + // for (final space in Space.values) { + // await $(SpacesDrawerPage.chooserItem(space)).tap(); + // await SpacesDrawerPage.guestLooksAsExpected($, space); + // } + // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + // }, + // ); + // + // patrolWidgetTest( + // tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + // skip: true, + // 'guest - chooser - next,previous buttons work correctly', + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.guestShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // + // // iterate thru spaces by clicking next + // for (final space in Space.values) { + // await SpacesDrawerPage.guestLooksAsExpected($, space); + // await $(SpacesDrawerPage.chooserNextBtn).tap(); + // SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); + // } + // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + // + // // iterate thru spaces by clicking previous + // for (final space in Space.values.reversed) { + // await SpacesDrawerPage.guestLooksAsExpected($, space); + // await $(SpacesDrawerPage.chooserPrevBtn).tap(); + // SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); + // } + // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); + // }, + // ); + // + // patrolWidgetTest( + // 'user - chooser - clicking on icons works correctly', + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.userShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // SpacesDrawerPage.commonElementsLookAsExpected($); + // for (final space in Space.values) { + // await $(SpacesDrawerPage.chooserItem(space)).tap(); + // await SpacesDrawerPage.userLooksAsExpected($, space); + // } + // }, + // ); + // + // patrolWidgetTest( + // 'guest - chooser - all spaces button works', + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.guestShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // await $(SpacesDrawerPage.allSpacesBtn).tap(); + // expect($(OverallSpacesPage.spacesListView), findsOneWidget); + // }, + // ); + // + // patrolWidgetTest( + // 'user - chooser - all spaces button works', + // (PatrolTester $) async { + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.userShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // await $(SpacesDrawerPage.allSpacesBtn).tap(); + // expect($(OverallSpacesPage.spacesListView), findsOneWidget); + // }, + // ); + // + // patrolWidgetTest( + // 'check tooltip text', + // (PatrolTester $) async { + // final spaceToTooltipText = { + // Space.discovery: 'Discovery space', + // Space.workspace: 'Workspace', + // Space.voting: 'Voting space', + // Space.fundedProjects: 'Funded project space', + // Space.treasury: 'Treasury space', + // }; + // await $.pumpWidgetAndSettle(App(routerConfig: router)); + // await $(OverallSpacesPage.userShortcutBtn) + // .tap(settleTimeout: Time.long.duration); + // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + // for (final space in Space.values) { + // await $(SpacesDrawerPage.chooserItem(space)).tap(); + // await $(SpacesDrawerPage.chooserIcon(space)).longPress(); + // await Future.delayed(const Duration(seconds: 1)); + // final expectedText = spaceToTooltipText[space]; + // final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + // final tooltipElement = find.descendant( + // of: chooserItem, + // matching: find.byKey(SpacesDrawerPage.tooltipElement), + // ); + // final tooltipTextElement = find.descendant( + // of: tooltipElement, + // matching: find.byType(Text), + // ); + // + // final tooltipText = $(tooltipTextElement).text; + // expect(tooltipText, expectedText); + // } + // }, + // ); + // }); + + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: Time.long.duration); + expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); } From 044ef3129bebea451091d64c7f76868ebfd09579 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 15:28:54 +0100 Subject: [PATCH 24/43] formatting --- .../apps/voices/integration_test/suites/app_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 76fc447f0f4..5b13247d76c 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -165,7 +165,7 @@ void main() async { patrolWidgetTest( 'visitor - no drawer button', - (PatrolTester $) async { + (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.visitorShortcutBtn) .tap(settleTimeout: Time.long.duration); From a839936c2959e801f447706102927f1c754c927f Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 23 Jan 2025 16:01:14 +0100 Subject: [PATCH 25/43] formatting --- .../apps/voices/integration_test/suites/app_test.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 5b13247d76c..8f724618123 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -2,16 +2,13 @@ import 'package:catalyst_voices/app/view/app.dart'; import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:catalyst_voices/routes/routes.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:go_router/go_router.dart'; import 'package:patrol_finders/patrol_finders.dart'; import '../pageobject/app_bar_page.dart'; import '../pageobject/overall_spaces_page.dart'; -import '../pageobject/spaces_drawer_page.dart'; import '../utils/constants.dart'; -import '../utils/selector_utils.dart'; void main() async { late final GoRouter router; @@ -146,7 +143,7 @@ void main() async { // await $(SpacesDrawerPage.chooserIcon(space)).longPress(); // await Future.delayed(const Duration(seconds: 1)); // final expectedText = spaceToTooltipText[space]; - // final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + // final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); // final tooltipElement = find.descendant( // of: chooserItem, // matching: find.byKey(SpacesDrawerPage.tooltipElement), From 9c3b45af19e8d49f6f0d4939952739e732437d5b Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 08:51:03 +0100 Subject: [PATCH 26/43] try headless=old --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index b06765e5875..0a10f8a1fda 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -32,7 +32,7 @@ integration-test-web: # https://github.com/flutter/flutter/issues/154727 --web-browser-flag=--disable-web-security \ --web-browser-flag=--disable-gpu \ - --web-browser-flag=--headless \ + --web-browser-flag=--headless=old \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile || echo fail > fail WAIT From 69285688deae14d5544034eb2960a710ce350d02 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 13:27:24 +0100 Subject: [PATCH 27/43] try running as non root --- catalyst_voices/apps/voices/integration_test/Earthfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 0a10f8a1fda..f557766a520 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,6 +24,9 @@ integration-test-web: WORKDIR /frontend/apps/voices + RUN useradd -ms /bin/bash newuser + USER newuser + RUN ($driver --port=$driver_port > $driver.log &) && \ sleep 5 && \ flutter drive --driver=test_driver/integration_tests.dart \ From 42259fcff7f5862365e305fde18744525bd858ad Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 14:09:30 +0100 Subject: [PATCH 28/43] try 156 --- catalyst_voices/apps/voices/integration_test/Earthfile | 4 ++-- .../apps/voices/integration_test/suites/app_test.dart | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index f557766a520..3f9c010d23b 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -34,8 +34,8 @@ integration-test-web: -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-gpu \ +# --web-browser-flag=--headless=old \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile || echo fail > fail WAIT diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 8f724618123..5caa0f77c00 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -1,4 +1,3 @@ -import 'package:catalyst_voices/app/view/app.dart'; import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:catalyst_voices/routes/routes.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; @@ -6,10 +5,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:go_router/go_router.dart'; import 'package:patrol_finders/patrol_finders.dart'; -import '../pageobject/app_bar_page.dart'; -import '../pageobject/overall_spaces_page.dart'; -import '../utils/constants.dart'; - void main() async { late final GoRouter router; @@ -163,10 +158,6 @@ void main() async { patrolWidgetTest( 'visitor - no drawer button', (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: Time.long.duration); - expect($(AppBarPage.spacesDrawerButton).exists, false); }, ); } From d47995b26f40192a2615eed21b58da641bfbb4fa Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 15:38:34 +0100 Subject: [PATCH 29/43] try 157 --- catalyst_voices/apps/voices/integration_test/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 3f9c010d23b..677e3ca9dff 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,11 +24,11 @@ integration-test-web: WORKDIR /frontend/apps/voices + RUN ($driver --port=$driver_port > $driver.log &) RUN useradd -ms /bin/bash newuser USER newuser - RUN ($driver --port=$driver_port > $driver.log &) && \ - sleep 5 && \ + RUN sleep 5 && \ flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ -d web-server --browser-name=$browser --driver-port=$driver_port \ From d8ec4efe28dc3207eb567b0051f46445c79fc3c3 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 15:46:59 +0100 Subject: [PATCH 30/43] try 242 --- .../apps/voices/integration_test/suites/app_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 5caa0f77c00..efca00a78d0 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -157,7 +157,6 @@ void main() async { patrolWidgetTest( 'visitor - no drawer button', - (PatrolTester $) async { - }, + (PatrolTester $) async {}, ); } From b2c634f9ac56d54203e86d8d6ede7e0414ab97dc Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 16:01:53 +0100 Subject: [PATCH 31/43] try 243 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 677e3ca9dff..fa465366c86 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -37,7 +37,7 @@ integration-test-web: # --web-browser-flag=--disable-gpu \ # --web-browser-flag=--headless=old \ --web-browser-flag=--disable-search-engine-choice-screen \ - --profile || echo fail > fail + --profile WAIT SAVE ARTIFACT $driver.log AS LOCAL $driver.log END From 8878b13f540262e1a9e4b16f128cb915863fecb8 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 16:21:40 +0100 Subject: [PATCH 32/43] try 244 --- catalyst_voices/apps/voices/integration_test/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index fa465366c86..01b5f5888f1 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -25,11 +25,11 @@ integration-test-web: WORKDIR /frontend/apps/voices RUN ($driver --port=$driver_port > $driver.log &) + RUN sleep 5 RUN useradd -ms /bin/bash newuser USER newuser - RUN sleep 5 && \ - flutter drive --driver=test_driver/integration_tests.dart \ + RUN flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ -d web-server --browser-name=$browser --driver-port=$driver_port \ # https://github.com/flutter/flutter/issues/154727 From 3fb488f80cafb2541fafcddec2c9a4209ed83f60 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 16:26:07 +0100 Subject: [PATCH 33/43] try 244 --- catalyst_voices/apps/voices/integration_test/Earthfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index fa465366c86..a74da7415f6 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,18 +24,17 @@ integration-test-web: WORKDIR /frontend/apps/voices - RUN ($driver --port=$driver_port > $driver.log &) + RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 RUN useradd -ms /bin/bash newuser USER newuser - RUN sleep 5 && \ - flutter drive --driver=test_driver/integration_tests.dart \ + RUN flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_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=--headless \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile WAIT From 4db402e3163bd6ff7b2b464cee24b0b7fb4d3df4 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 18:07:36 +0100 Subject: [PATCH 34/43] try 245 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index a74da7415f6..8a9f8e1aca0 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -22,11 +22,11 @@ integration-test-web: # LET driver = "msedgedriver" # END - WORKDIR /frontend/apps/voices RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 RUN useradd -ms /bin/bash newuser USER newuser + WORKDIR /frontend/apps/voices RUN flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ From 6438f554a65d1114ad66e8939f055d3e54ea9788 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 24 Jan 2025 18:09:20 +0100 Subject: [PATCH 35/43] try 246 --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 8a9f8e1aca0..1e466e8017c 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -28,7 +28,7 @@ integration-test-web: USER newuser WORKDIR /frontend/apps/voices - RUN flutter drive --driver=test_driver/integration_tests.dart \ + RUN flutter drive --verbose --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ -d web-server --browser-name=$browser --driver-port=$driver_port \ # https://github.com/flutter/flutter/issues/154727 From 74669804ab6b93ffeb2e531d5988e000d3c60a14 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Sat, 25 Jan 2025 07:49:06 +0100 Subject: [PATCH 36/43] try 247 root run --- catalyst_voices/apps/voices/integration_test/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 1e466e8017c..e0640be1bcd 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -24,8 +24,8 @@ integration-test-web: RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 - RUN useradd -ms /bin/bash newuser - USER newuser +# RUN useradd -ms /bin/bash newuser +# USER newuser WORKDIR /frontend/apps/voices RUN flutter drive --verbose --driver=test_driver/integration_tests.dart \ From 4fe2c87c91946d0b31289730a39c32af2bcbcdf9 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 09:57:01 +0100 Subject: [PATCH 37/43] try 248 root run --- catalyst_voices/apps/voices/integration_test/Earthfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index e0640be1bcd..748f3296422 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -23,12 +23,14 @@ integration-test-web: # END - RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 +# RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 # RUN useradd -ms /bin/bash newuser # USER newuser WORKDIR /frontend/apps/voices - RUN flutter drive --verbose --driver=test_driver/integration_tests.dart \ + RUN ($driver --port=$driver_port > $driver.log &) && \ + sleep 5 && \ + flutter drive --verbose --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ -d web-server --browser-name=$browser --driver-port=$driver_port \ # https://github.com/flutter/flutter/issues/154727 From ba10dbbf9989f1d3e9d9c9a992b35efea1438f99 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 11:09:11 +0100 Subject: [PATCH 38/43] try 249 root run --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 748f3296422..9c84d5ce14a 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -30,7 +30,7 @@ integration-test-web: RUN ($driver --port=$driver_port > $driver.log &) && \ sleep 5 && \ - flutter drive --verbose --driver=test_driver/integration_tests.dart \ + flutter drive --driver=test_driver/integration_tests.dart \ --target=integration_test/all_test.dart \ -d web-server --browser-name=$browser --driver-port=$driver_port \ # https://github.com/flutter/flutter/issues/154727 From 69ec74638a506291adb5a22efa0a5c49ebf62808 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 11:34:39 +0100 Subject: [PATCH 39/43] try 250 root run --- catalyst_voices/apps/voices/integration_test/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 9c84d5ce14a..5a375a6cde5 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -35,7 +35,7 @@ integration-test-web: -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=--disable-gpu \ --web-browser-flag=--headless \ --web-browser-flag=--disable-search-engine-choice-screen \ --profile From e839dd6f48e70546f1bedce34143928f7cbe2153 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 12:36:20 +0100 Subject: [PATCH 40/43] try 251 --- .../apps/voices/integration_test/Earthfile | 12 +- .../integration_test/suites/app_test.dart | 284 +++++++++--------- 2 files changed, 150 insertions(+), 146 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/Earthfile b/catalyst_voices/apps/voices/integration_test/Earthfile index 5a375a6cde5..7e329fdd2ee 100644 --- a/catalyst_voices/apps/voices/integration_test/Earthfile +++ b/catalyst_voices/apps/voices/integration_test/Earthfile @@ -22,23 +22,19 @@ integration-test-web: # LET driver = "msedgedriver" # END - -# RUN ($driver --port=$driver_port > $driver.log &) && sleep 5 -# RUN useradd -ms /bin/bash newuser -# USER newuser WORKDIR /frontend/apps/voices RUN ($driver --port=$driver_port > $driver.log &) && \ - sleep 5 && \ - flutter drive --driver=test_driver/integration_tests.dart \ - --target=integration_test/all_test.dart \ + 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 \ --web-browser-flag=--disable-search-engine-choice-screen \ - --profile + --profile || echo fail > fail WAIT SAVE ARTIFACT $driver.log AS LOCAL $driver.log END diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index efca00a78d0..db930ce0d39 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -1,10 +1,18 @@ +import 'package:catalyst_voices/app/view/app.dart'; import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:catalyst_voices/routes/routes.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:go_router/go_router.dart'; import 'package:patrol_finders/patrol_finders.dart'; +import '../pageobject/app_bar_page.dart'; +import '../pageobject/overall_spaces_page.dart'; +import '../pageobject/spaces_drawer_page.dart'; +import '../utils/constants.dart'; +import '../utils/selector_utils.dart'; + void main() async { late final GoRouter router; @@ -21,142 +29,142 @@ void main() async { await restartDependencies(); }); - // group('Spaces drawer -', () { - // patrolWidgetTest( - // 'visitor - no drawer button', - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.visitorShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // expect($(AppBarPage.spacesDrawerButton).exists, false); - // }, - // ); - // - // patrolWidgetTest( - // 'guest - chooser - clicking on icons works correctly', - // tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - // skip: true, - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.guestShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // SpacesDrawerPage.commonElementsLookAsExpected($); - // - // // iterate thru spaces by clicking on spaces icons directly - // for (final space in Space.values) { - // await $(SpacesDrawerPage.chooserItem(space)).tap(); - // await SpacesDrawerPage.guestLooksAsExpected($, space); - // } - // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - // }, - // ); - // - // patrolWidgetTest( - // tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', - // skip: true, - // 'guest - chooser - next,previous buttons work correctly', - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.guestShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // - // // iterate thru spaces by clicking next - // for (final space in Space.values) { - // await SpacesDrawerPage.guestLooksAsExpected($, space); - // await $(SpacesDrawerPage.chooserNextBtn).tap(); - // SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); - // } - // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - // - // // iterate thru spaces by clicking previous - // for (final space in Space.values.reversed) { - // await SpacesDrawerPage.guestLooksAsExpected($, space); - // await $(SpacesDrawerPage.chooserPrevBtn).tap(); - // SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); - // } - // SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); - // }, - // ); - // - // patrolWidgetTest( - // 'user - chooser - clicking on icons works correctly', - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.userShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // SpacesDrawerPage.commonElementsLookAsExpected($); - // for (final space in Space.values) { - // await $(SpacesDrawerPage.chooserItem(space)).tap(); - // await SpacesDrawerPage.userLooksAsExpected($, space); - // } - // }, - // ); - // - // patrolWidgetTest( - // 'guest - chooser - all spaces button works', - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.guestShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // await $(SpacesDrawerPage.allSpacesBtn).tap(); - // expect($(OverallSpacesPage.spacesListView), findsOneWidget); - // }, - // ); - // - // patrolWidgetTest( - // 'user - chooser - all spaces button works', - // (PatrolTester $) async { - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.userShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // await $(SpacesDrawerPage.allSpacesBtn).tap(); - // expect($(OverallSpacesPage.spacesListView), findsOneWidget); - // }, - // ); - // - // patrolWidgetTest( - // 'check tooltip text', - // (PatrolTester $) async { - // final spaceToTooltipText = { - // Space.discovery: 'Discovery space', - // Space.workspace: 'Workspace', - // Space.voting: 'Voting space', - // Space.fundedProjects: 'Funded project space', - // Space.treasury: 'Treasury space', - // }; - // await $.pumpWidgetAndSettle(App(routerConfig: router)); - // await $(OverallSpacesPage.userShortcutBtn) - // .tap(settleTimeout: Time.long.duration); - // await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - // for (final space in Space.values) { - // await $(SpacesDrawerPage.chooserItem(space)).tap(); - // await $(SpacesDrawerPage.chooserIcon(space)).longPress(); - // await Future.delayed(const Duration(seconds: 1)); - // final expectedText = spaceToTooltipText[space]; - // final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); - // final tooltipElement = find.descendant( - // of: chooserItem, - // matching: find.byKey(SpacesDrawerPage.tooltipElement), - // ); - // final tooltipTextElement = find.descendant( - // of: tooltipElement, - // matching: find.byType(Text), - // ); - // - // final tooltipText = $(tooltipTextElement).text; - // expect(tooltipText, expectedText); - // } - // }, - // ); - // }); - - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async {}, - ); + group('Spaces drawer -', () { + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: Time.long.duration); + expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); + + patrolWidgetTest( + 'guest - chooser - clicking on icons works correctly', + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + + // iterate thru spaces by clicking on spaces icons directly + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.guestLooksAsExpected($, space); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + }, + ); + + patrolWidgetTest( + tags: 'https://github.com/input-output-hk/catalyst-voices/issues/1473', + skip: true, + 'guest - chooser - next,previous buttons work correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + + // iterate thru spaces by clicking next + for (final space in Space.values) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserNextBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + + // iterate thru spaces by clicking previous + for (final space in Space.values.reversed) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserPrevBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); + }, + ); + + patrolWidgetTest( + 'user - chooser - clicking on icons works correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.userLooksAsExpected($, space); + } + }, + ); + + patrolWidgetTest( + 'guest - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'user - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'check tooltip text', + (PatrolTester $) async { + final spaceToTooltipText = { + Space.discovery: 'Discovery space', + Space.workspace: 'Workspace', + Space.voting: 'Voting space', + Space.fundedProjects: 'Funded project space', + Space.treasury: 'Treasury space', + }; + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: Time.long.duration); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await $(SpacesDrawerPage.chooserIcon(space)).longPress(); + await Future.delayed(const Duration(seconds: 1)); + final expectedText = spaceToTooltipText[space]; + final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + final tooltipElement = find.descendant( + of: chooserItem, + matching: find.byKey(SpacesDrawerPage.tooltipElement), + ); + final tooltipTextElement = find.descendant( + of: tooltipElement, + matching: find.byType(Text), + ); + + final tooltipText = $(tooltipTextElement).text; + expect(tooltipText, expectedText); + } + }, + ); + }); + + // patrolWidgetTest( + // 'visitor - no drawer button', + // (PatrolTester $) async {}, + // ); } From 5156321c6058827e54d84153394d754c911159da Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 13:20:51 +0100 Subject: [PATCH 41/43] try 252 --- catalyst_voices/apps/voices/integration_test/all_test.dart | 6 ++++-- .../apps/voices/integration_test/suites/app_test.dart | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index cc3fe0ccde0..ce5f6ff0771 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -2,7 +2,9 @@ import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; +import 'suites/account_test.dart' as account_test; import 'suites/app_test.dart' as app_test; +import 'suites/onboarding_test.dart' as onboarding_test; void main() async { final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -13,6 +15,6 @@ void main() async { }); app_test.main(); - // onboarding_test.main(); - // account_test.main(); + onboarding_test.main(); + account_test.main(); } diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index db930ce0d39..24caf01dc57 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -162,9 +162,4 @@ void main() async { }, ); }); - - // patrolWidgetTest( - // 'visitor - no drawer button', - // (PatrolTester $) async {}, - // ); } From af37e8940397939ba6513b54ac415d91785168e7 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 15:26:11 +0100 Subject: [PATCH 42/43] cleanup --- .config/dictionaries/project.dic | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 0c0efac1bbb..3cd7cdd3e8b 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -205,7 +205,6 @@ Nodetool NuFi oapi OCSP -oldgreg Oleksandr onboarded oneshot From 6503e9a2c1c7f1fb0b8af9fee890554477027e24 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Tue, 28 Jan 2025 15:34:35 +0100 Subject: [PATCH 43/43] cleanup --- .../apps/voices/integration_test/suites/app_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 24caf01dc57..b52e4d56bf3 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -146,7 +146,7 @@ void main() async { await $(SpacesDrawerPage.chooserIcon(space)).longPress(); await Future.delayed(const Duration(seconds: 1)); final expectedText = spaceToTooltipText[space]; - final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); final tooltipElement = find.descendant( of: chooserItem, matching: find.byKey(SpacesDrawerPage.tooltipElement),