forked from cwtch.im/cwtch-ui
Add Tests for 02_global_settings to pipeline. Update bindings
This commit is contained in:
parent
c78cff1e92
commit
47f3cd8ee1
|
@ -67,7 +67,8 @@ steps:
|
||||||
path: /root/.pub-cache
|
path: /root/.pub-cache
|
||||||
commands:
|
commands:
|
||||||
- ./fetch-tor.sh
|
- ./fetch-tor.sh
|
||||||
- ./run-tests-headless.sh 01_general
|
# Run 01_general and 02_global_settings features...
|
||||||
|
- ./run-tests-headless.sh "01_general|02_global_settings"
|
||||||
|
|
||||||
- name: test-build-android
|
- name: test-build-android
|
||||||
image: openpriv/flutter-desktop:linux-fstable-3.7.1
|
image: openpriv/flutter-desktop:linux-fstable-3.7.1
|
||||||
|
|
|
@ -62,6 +62,7 @@ integration_test/gherkin/
|
||||||
integration_test/CustomSteps.md
|
integration_test/CustomSteps.md
|
||||||
analysis_options.yaml
|
analysis_options.yaml
|
||||||
integration_test/env/default/tor
|
integration_test/env/default/tor
|
||||||
|
integration_test/env/temp*
|
||||||
linux/Tor
|
linux/Tor
|
||||||
linux/tor.tar.gz
|
linux/tor.tar.gz
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2022-12-12-17-58-v1.10.1-3-g3d0a3a5
|
2023-02-08-16-57-v1.10.5
|
|
@ -1 +1 @@
|
||||||
2022-12-12-22-59-v1.10.1-3-g3d0a3a5
|
2023-02-08-21-57-v1.10.5
|
|
@ -3,12 +3,11 @@ Feature: Tor initializes correctly
|
||||||
Given I wait until the widget with type 'ProfileMgrView' is present
|
Given I wait until the widget with type 'ProfileMgrView' is present
|
||||||
And I tap the icon with type "TorIcon"
|
And I tap the icon with type "TorIcon"
|
||||||
Then I expect the Tor version to be present
|
Then I expect the Tor version to be present
|
||||||
And I expect the string 'Online' to be present within 60 seconds
|
And I expect the string 'Online' to be present within 120 seconds
|
||||||
|
|
||||||
Scenario: Reset Tor
|
Scenario: Reset Tor
|
||||||
Given I wait until the widget with type 'ProfileMgrView' is present
|
Given I wait until the widget with type 'ProfileMgrView' is present
|
||||||
And I tap the icon with type "TorIcon"
|
And I tap the icon with type "TorIcon"
|
||||||
Then I expect the string 'Online' to be present within 60 seconds
|
Then I expect the string 'Online' to be present within 120 seconds
|
||||||
Then I tap the button that contains the text "Reset"
|
Then I tap the button that contains the text "Reset"
|
||||||
And I wait for 1 second
|
Then I expect the text "Online" to be absent within 5 seconds
|
||||||
Then I expect the text "Online" to be absent
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ Feature: Global 'language' setting
|
||||||
And I wait until the text 'Language' is present
|
And I wait until the text 'Language' is present
|
||||||
Then I expect the text 'Language' to be present
|
Then I expect the text 'Language' to be present
|
||||||
And I expect the text 'Langue' to be absent
|
And I expect the text 'Langue' to be absent
|
||||||
When I tap the widget that contains the text "English"
|
When I tap the dropdown button that contains the text "English"
|
||||||
And I wait until the text 'French' is present
|
And I wait until the text 'French' is present
|
||||||
And I tap the widget that contains the text "French"
|
And I tap the dropdown button that contains the text "French"
|
||||||
And I wait until the text 'Langue' is present
|
And I wait until the text 'Langue' is present
|
||||||
And I expect the text 'Language' to be absent
|
And I expect the text 'Language' to be absent
|
||||||
When I tap the widget that contains the text "Français"
|
And I scroll the dropdown list "languagelist" by -10
|
||||||
And I tap the widget that contains the text "Anglais"
|
And I tap the dropdown button that contains the text "Anglais"
|
||||||
And I wait until the text 'Language' is present
|
And I wait until the text 'Language' is present
|
||||||
And I expect the text 'Langue' to be absent
|
And I expect the text 'Langue' to be absent
|
|
@ -2,11 +2,12 @@ Feature: Global 'Theme' setting
|
||||||
Scenario: Change the theme to Mermaid
|
Scenario: Change the theme to Mermaid
|
||||||
Given I wait until the widget with type 'ProfileMgrView' is present
|
Given I wait until the widget with type 'ProfileMgrView' is present
|
||||||
Given I tap the 'OpenSettingsView' button
|
Given I tap the 'OpenSettingsView' button
|
||||||
And I wait for 1 second
|
And I wait until the text 'Use Light Themes' is present
|
||||||
When I tap the "DropdownTheme" button
|
When I tap the "DropdownTheme" button
|
||||||
And I tap the element that contains the text "Mermaid"
|
And I wait until the text 'Mermaid' is present
|
||||||
|
And I tap the dropdown button that contains the text "Mermaid"
|
||||||
Scenario: Change the theme to Light Mode
|
Scenario: Change the theme to Light Mode
|
||||||
Given I wait until the widget with type 'ProfileMgrView' is present
|
Given I wait until the widget with type 'ProfileMgrView' is present
|
||||||
Given I tap the 'OpenSettingsView' button
|
Given I tap the 'OpenSettingsView' button
|
||||||
And I wait for 1 second
|
And I wait until the text 'Use Light Themes' is present
|
||||||
And I tap the widget that contains the text "Theme"
|
And I tap the widget that contains the text "Use Light Themes"
|
|
@ -3,18 +3,21 @@ Feature: Block unknown contacts setting
|
||||||
Scenario: Carol adds Alice but Alice doesn't see it because Block Unknowns is enabled
|
Scenario: Carol adds Alice but Alice doesn't see it because Block Unknowns is enabled
|
||||||
Given I wait until the widget with type 'ProfileMgrView' is present
|
Given I wait until the widget with type 'ProfileMgrView' is present
|
||||||
Given I tap the 'OpenSettingsView' button
|
Given I tap the 'OpenSettingsView' button
|
||||||
|
And I wait until the text "Block Unknown Contacts" is present
|
||||||
When I tap the widget that contains the text "Block Unknown Contacts"
|
When I tap the widget that contains the text "Block Unknown Contacts"
|
||||||
Then I expect the switch that contains the text "Block Unknown Contacts" to be checked
|
Then I expect the switch that contains the text "Block Unknown Contacts" to be checked
|
||||||
Given I tap the back button
|
Then I tap the back button
|
||||||
|
And I wait until the tooltip "Online" is present
|
||||||
And I wait until the text "Carol" is present
|
And I wait until the text "Carol" is present
|
||||||
And I tap the button that contains the text "Carol"
|
And I tap the button that contains the text "Carol"
|
||||||
|
And I wait until the text "Conversations" is present
|
||||||
And I tap the button with tooltip "Add a new contact or conversation"
|
And I tap the button with tooltip "Add a new contact or conversation"
|
||||||
|
And I tap the button that contains the text "Add contact"
|
||||||
|
And I wait until the text "Paste a cwtch address" is present
|
||||||
When I fill the "txtAddP2P" field with "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd"
|
When I fill the "txtAddP2P" field with "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd"
|
||||||
And I wait for 1 second
|
And I wait for 3 seconds
|
||||||
And I take a screenshot
|
|
||||||
And I tap the back button
|
And I tap the back button
|
||||||
And I wait until the text "Alice" is present
|
And I wait until the text "Alice" is present
|
||||||
And I wait until the tooltip "Online" is present
|
|
||||||
And I tap the button that contains the text "Alice"
|
And I tap the button that contains the text "Alice"
|
||||||
And I wait for 20 seconds
|
And I wait for 20 seconds
|
||||||
Then I expect the text "yxj2pvhozedflp4g7yitpqkeho63maaffi2qgsj3e6s2fbmosuuas2qd" to be absent
|
Then I expect the text "yxj2pvhozedflp4g7yitpqkeho63maaffi2qgsj3e6s2fbmosuuas2qd" to be absent
|
|
@ -5,7 +5,7 @@ Feature: Streamer mode
|
||||||
And I wait until the text "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd" is present
|
And I wait until the text "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd" is present
|
||||||
And I wait until the text "pjurzypqui3dnpxj6aemk6cqz22yx6zfr5lq4jzu7muwe2yyx2zrnzyd" is present
|
And I wait until the text "pjurzypqui3dnpxj6aemk6cqz22yx6zfr5lq4jzu7muwe2yyx2zrnzyd" is present
|
||||||
Given I tap the 'OpenSettingsView' button
|
Given I tap the 'OpenSettingsView' button
|
||||||
And I wait for 1 second
|
And I wait until the text "Streamer/Presentation Mode" is present
|
||||||
And I tap the widget that contains the text "Streamer/Presentation Mode"
|
And I tap the widget that contains the text "Streamer/Presentation Mode"
|
||||||
Then I expect the switch that contains the text "Streamer/Presentation Mode" to be checked
|
Then I expect the switch that contains the text "Streamer/Presentation Mode" to be checked
|
||||||
When I tap the back button
|
When I tap the back button
|
||||||
|
|
|
@ -28,15 +28,37 @@ class ResetCwtchEnvironment extends Hook {
|
||||||
@override
|
@override
|
||||||
Future<void> onBeforeScenario(TestConfiguration config, String scenario, Iterable<Tag> tags) async {
|
Future<void> onBeforeScenario(TestConfiguration config, String scenario, Iterable<Tag> tags) async {
|
||||||
if (tags.any((t) => t.name == "@env:persist")) {
|
if (tags.any((t) => t.name == "@env:persist")) {
|
||||||
await Process.run("mv", ["integration_test/env/temp-persist", "integration_test/env/temp"]);
|
return Process.run("rm", ["-rf", "integration_test/env/temp"]).then((value) {
|
||||||
|
return Process.run("mv",
|
||||||
|
["integration_test/env/temp-persist", "integration_test/env/temp"])
|
||||||
|
.then((value) {
|
||||||
|
print("copied persist!");
|
||||||
|
return super.onBeforeScenario(config, scenario, tags);
|
||||||
|
});
|
||||||
|
});
|
||||||
} else if (tags.any((t) => t.name == "@env:aliceandbob1")) {
|
} else if (tags.any((t) => t.name == "@env:aliceandbob1")) {
|
||||||
await Process.run("cp", ["-R", "integration_test/env/aliceandbob1", "integration_test/env/temp"]);
|
return Process.run("rm", ["-rf", "integration_test/env/temp"]).then((value) {
|
||||||
|
return Process.run("cp", [
|
||||||
|
"-R",
|
||||||
|
"integration_test/env/aliceandbob1",
|
||||||
|
"integration_test/env/temp"
|
||||||
|
]).then((value) {
|
||||||
|
print("copied aliceandbob!");
|
||||||
|
return super.onBeforeScenario(config, scenario, tags);
|
||||||
|
});
|
||||||
|
});
|
||||||
} else if (!(tags.any((t) => t.name == "@env:clean"))) {
|
} else if (!(tags.any((t) => t.name == "@env:clean"))) {
|
||||||
// use the default environment if no @env: tag specified
|
// use the default environment if no @env: tag specified
|
||||||
await Process.run("cp", ["-R", "integration_test/env/default", "integration_test/env/temp"]);
|
return Process.run("rm", ["-rf", "integration_test/env/temp"]).then((value) {
|
||||||
} else {
|
return Process.run("cp",
|
||||||
print("clean environment initialized");
|
["-R", "integration_test/env/default", "integration_test/env/temp"])
|
||||||
|
.then((value) {
|
||||||
|
print("copied clean!");
|
||||||
|
return super.onBeforeScenario(config, scenario, tags);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
print("potentially dirty environment initialized - clean not specified");
|
||||||
return super.onBeforeScenario(config, scenario, tags);
|
return super.onBeforeScenario(config, scenario, tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,8 +152,14 @@ class CwtchFfi implements Cwtch {
|
||||||
Map<String, String> envVars = Platform.environment;
|
Map<String, String> envVars = Platform.environment;
|
||||||
String cwtchDir = "";
|
String cwtchDir = "";
|
||||||
if (Platform.isLinux) {
|
if (Platform.isLinux) {
|
||||||
cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, ".cwtch");
|
|
||||||
home = envVars['HOME'] ?? "";
|
home = envVars['HOME'] ?? "";
|
||||||
|
if (EnvironmentConfig.TEST_MODE) {
|
||||||
|
cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, ".cwtch");
|
||||||
|
} else {
|
||||||
|
cwtchDir = envVars['CWTCH_HOME']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (await File("linux/Tor/tor").exists()) {
|
if (await File("linux/Tor/tor").exists()) {
|
||||||
bundledTor = "linux/Tor/tor";
|
bundledTor = "linux/Tor/tor";
|
||||||
} else if (await File("lib/Tor/tor").exists()) {
|
} else if (await File("lib/Tor/tor").exists()) {
|
||||||
|
|
|
@ -149,7 +149,6 @@ class _AddContactViewState extends State<AddContactView> {
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
CwtchTextField(
|
CwtchTextField(
|
||||||
testKey: Key("txtAddP2P"),
|
|
||||||
key: Key("txtAddP2P"),
|
key: Key("txtAddP2P"),
|
||||||
controller: ctrlrContact,
|
controller: ctrlrContact,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
|
|
|
@ -115,6 +115,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
trailing: Container(
|
trailing: Container(
|
||||||
width: MediaQuery.of(context).size.width / 4,
|
width: MediaQuery.of(context).size.width / 4,
|
||||||
child: DropdownButton(
|
child: DropdownButton(
|
||||||
|
key: Key("languagelist"),
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
value: Provider.of<Settings>(context).locale.toString(),
|
value: Provider.of<Settings>(context).locale.toString(),
|
||||||
onChanged: (String? newValue) {
|
onChanged: (String? newValue) {
|
||||||
|
@ -127,7 +128,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
items: AppLocalizations.supportedLocales.map<DropdownMenuItem<String>>((Locale value) {
|
items: AppLocalizations.supportedLocales.map<DropdownMenuItem<String>>((Locale value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value.toString(),
|
value: value.toString(),
|
||||||
child: Text(getLanguageFull(context, value.languageCode, value.countryCode)),
|
child: Text( key: Key("dropdownLanguage" + value.languageCode), getLanguageFull(context, value.languageCode, value.countryCode)),
|
||||||
);
|
);
|
||||||
}).toList()))),
|
}).toList()))),
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
|
|
|
@ -280,7 +280,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: "9b817676e4ad623a875accaa26097669a9bd2c7c"
|
resolved-ref: bc846ee4df720288a17b8455ec4cc1ccbe90ecdb
|
||||||
url: "https://git.openprivacy.ca/openprivacy/flutter_gherkin"
|
url: "https://git.openprivacy.ca/openprivacy/flutter_gherkin"
|
||||||
source: git
|
source: git
|
||||||
version: "3.0.0-rc.17"
|
version: "3.0.0-rc.17"
|
||||||
|
|
|
@ -52,6 +52,7 @@ dev_dependencies:
|
||||||
msix: ^3.6.2
|
msix: ^3.6.2
|
||||||
build_runner: any
|
build_runner: any
|
||||||
flutter_gherkin:
|
flutter_gherkin:
|
||||||
|
#path: ./flutter_gherkin
|
||||||
git:
|
git:
|
||||||
url: https://git.openprivacy.ca/openprivacy/flutter_gherkin
|
url: https://git.openprivacy.ca/openprivacy/flutter_gherkin
|
||||||
ref: main
|
ref: main
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
paths=$(find . -wholename "./integration_test/features/*$1*.feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
|
paths=$(find . -regextype posix-extended -regex "./integration_test/features/($1).*feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
|
||||||
sed "s|featurePaths: REPLACED_BY_SCRIPT|featurePaths: <String>[$paths]|" integration_test/gherkin_suite_test.editable.dart > integration_test/gherkin_suite_test.dart
|
sed "s|featurePaths: REPLACED_BY_SCRIPT|featurePaths: <String>[$paths]|" integration_test/gherkin_suite_test.editable.dart > integration_test/gherkin_suite_test.dart
|
||||||
flutter pub run build_runner clean
|
flutter pub run build_runner clean
|
||||||
flutter pub run build_runner build --delete-conflicting-outputs
|
flutter pub run build_runner build --delete-conflicting-outputs
|
||||||
|
|
||||||
PATH=$PATH:$PWD/linux/Tor
|
PATH=$PATH:$PWD/linux/Tor
|
||||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$PWD/linux/":"$PWD/linux/Tor/"
|
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$PWD/linux/":"$PWD/linux/Tor/"
|
||||||
PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH LOG_FILE=/home/sarah/PARA/projects/cwtch/cwtch.log CWTCH_HOME=$PWD/integration_test/env/temp/ flutter test -d linux --dart-define TEST_MODE=true integration_test/gherkin_suite_test.dart
|
LOG_LEVEL=debug PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH LOG_FILE=/home/sarah/PARA/projects/cwtch/cwtch.log CWTCH_HOME=$PWD/integration_test/env/temp/ flutter test -d linux --dart-define TEST_MODE=true integration_test/gherkin_suite_test.dart
|
||||||
#node index2.js
|
#node index2.js
|
||||||
#if [ "$HEADLESS" = "false" ]; then
|
#if [ "$HEADLESS" = "false" ]; then
|
||||||
# xdg-open integration_test/gherkin/reports/cucumber_report.html
|
# xdg-open integration_test/gherkin/reports/cucumber_report.html
|
||||||
|
|
Loading…
Reference in New Issue