diff --git a/.drone.yml b/.drone.yml index 32448aec..e35cb8eb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -67,8 +67,8 @@ steps: path: /root/.pub-cache commands: - ./fetch-tor.sh - # Run 01_general and 02_global_settings features... - - ./run-tests-headless.sh "01_general|02_global_settings" + # Run 01_general, 02_global_settings, and 04_profile_mgmt features... + - ./run-tests-headless.sh "01_general|02_global_settings|04_profile_mgmt" - name: test-build-android image: openpriv/flutter-desktop:linux-fstable-3.7.1 diff --git a/integration_test/features/04_profile_mgmt/01_create_delete.feature b/integration_test/features/04_profile_mgmt/01_create_delete.feature index b085848f..ac27352b 100644 --- a/integration_test/features/04_profile_mgmt/01_create_delete.feature +++ b/integration_test/features/04_profile_mgmt/01_create_delete.feature @@ -2,8 +2,9 @@ Feature: Basic Profile Management Scenario: Error on Creating a Profile without a Display Name Given I wait until the widget with type 'ProfileMgrView' is present - And I tap the button with tooltip "Add new profile" - Then I expect the text 'Display Name' to be present + And I tap a button with tooltip "Add new profile" + And I tap the "addNewProfileActual" button + And I wait until the text 'Display Name' is present And I expect the text 'New Password' to be present And I expect the text 'Please enter a display name' to be absent Then I tap the "button" widget with label "Add new profile" @@ -12,12 +13,13 @@ Feature: Basic Profile Management Scenario: Create Unencrypted Profile Given I wait until the widget with type 'ProfileMgrView' is present - And I tap the button with tooltip "Add new profile" - Then I expect the text 'Display Name' to be present + And I tap a button with tooltip "Add new profile" + And I tap the "addNewProfileActual" button + And I wait until the text 'Display Name' is present And I expect the text 'New Password' to be present And I take a screenshot Then I tap the "passwordCheckBox" widget - And I expect the text 'New Password' to be absent + And I expect the text 'New Password' to be absent within 2 seconds And I take a screenshot Then I fill the "displayNameFormElement" field with "Alice (Unencrypted)" Then I tap the "button" widget with label "Add new profile" @@ -33,8 +35,9 @@ Feature: Basic Profile Management Scenario: Create Encrypted Profile Given I wait until the widget with type 'ProfileMgrView' is present - And I tap the button with tooltip "Add new profile" - Then I expect the text 'Display Name' to be present + And I tap a button with tooltip "Add new profile" + And I tap the "addNewProfileActual" button + And I wait until the text 'Display Name' is present And I expect the text 'New Password' to be present And I take a screenshot Then I fill the "displayNameFormElement" field with "Alice (Encrypted)" @@ -51,7 +54,7 @@ Feature: Basic Profile Management Scenario: Load an Encrypted Profile by Unlocking it with a Password Given I wait until the widget with type 'ProfileMgrView' is present Then I expect the text 'Enter a password to view your profiles' to be absent - And I tap the button with tooltip "Unlock encrypted profiles by entering their password." + And I tap a button with tooltip "Unlock encrypted profiles by entering their password." Then I expect the text 'Enter a password to view your profiles' to be present When I fill the "unlockPasswordProfileElement" field with "password1" And I tap the "button" widget with label "Unlock" @@ -60,7 +63,7 @@ Feature: Basic Profile Management Scenario: Load an Encrypted Profile by Unlocking it with a Password and Change the Name Given I wait until the widget with type 'ProfileMgrView' is present Then I expect the text 'Enter a password to view your profiles' to be absent - And I tap the button with tooltip "Unlock encrypted profiles by entering their password." + And I tap a button with tooltip "Unlock encrypted profiles by entering their password." Then I expect the text 'Enter a password to view your profiles' to be present When I fill the "unlockPasswordProfileElement" field with "password1" And I tap the "button" widget with label "Unlock" @@ -75,7 +78,7 @@ Feature: Basic Profile Management Scenario: Delete an Encrypted Profile Given I wait until the widget with type 'ProfileMgrView' is present Then I expect the text 'Enter a password to view your profiles' to be absent - And I tap the button with tooltip "Unlock encrypted profiles by entering their password." + And I tap a button with tooltip "Unlock encrypted profiles by entering their password." Then I expect the text 'Enter a password to view your profiles' to be present When I fill the "unlockPasswordProfileElement" field with "password1" And I tap the "button" widget with label "Unlock" @@ -83,8 +86,9 @@ Feature: Basic Profile Management And I take a screenshot When I tap the "IconButton" widget with tooltip "Edit Profile Carol (Encrypted)" Then I expect the text 'Display Name' to be present + Then I fill the "currentPasswordFormElement" field with "password1" When I tap the button that contains the text "Delete" - Then I expect the text "Really Delete Profile" to be present + Then I wait for 2 seconds When I tap the "button" widget with label "Really Delete Profile" And I wait until the widget with type 'ProfileMgrView' is present Then I expect a "ProfileRow" widget with text "Carol (Encrypted)" to be absent diff --git a/integration_test/gherkin_suite_test.editable.dart b/integration_test/gherkin_suite_test.editable.dart index 98c9198e..5f350a77 100644 --- a/integration_test/gherkin_suite_test.editable.dart +++ b/integration_test/gherkin_suite_test.editable.dart @@ -52,6 +52,7 @@ void main() async { // text TorVersionPresent(), TooltipTap(), + TooltipTapAny(), // files FolderExists(), FileExists(), diff --git a/integration_test/steps/text.dart b/integration_test/steps/text.dart index 4474c5bc..2aea8569 100644 --- a/integration_test/steps/text.dart +++ b/integration_test/steps/text.dart @@ -11,6 +11,14 @@ StepDefinitionGeneric TooltipTap() { }); } +StepDefinitionGeneric TooltipTapAny() { + return given1(RegExp(r'I tap a button with tooltip {string}'), (input1, context) async { + final finder = context.world.appDriver.findBy(input1, FindType.tooltip).first; + await context.world.appDriver.tap(finder); + await context.world.appDriver.waitForAppToSettle(); + }); +} + StepDefinitionGeneric TorVersionPresent() { return given( RegExp(r'I expect the Tor version to be present$'), diff --git a/lib/views/profilemgrview.dart b/lib/views/profilemgrview.dart index 92ab20b7..3b33cecd 100644 --- a/lib/views/profilemgrview.dart +++ b/lib/views/profilemgrview.dart @@ -226,6 +226,7 @@ class _ProfileMgrViewState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))), ), child: Text( + key:Key("addNewProfileActual"), AppLocalizations.of(context)!.addProfileTitle, semanticsLabel: AppLocalizations.of(context)!.addProfileTitle, style: TextStyle(fontWeight: FontWeight.bold),