Compare commits

...

5 Commits

10 changed files with 65 additions and 22 deletions

View File

@ -60,6 +60,25 @@ steps:
- tar -czf cwtch-`cat ../VERSION`.tar.gz cwtch
- rm -r cwtch
- name: widget-tests
image: cirrusci/flutter:2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
# - flutter config --enable-linux-desktop
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
- name: ui-tests
image: openpriv/flutter-desktop:linux-fstable-2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
- ./run-tests.sh
- cp integration_test/gherkin/reports/cucumber_report.html deploy/linux_cucumber_report.html
- name: test-build-android
image: cirrusci/flutter:2.8.0
when:
@ -94,15 +113,6 @@ steps:
- cp build/app/outputs/apk/release/app-release.apk deploy/
#- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android
- name: widget-tests
image: cirrusci/flutter:2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
# - flutter config --enable-linux-desktop
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
- name: deploy-buildfiles
image: kroniak/ssh-client
@ -336,6 +346,14 @@ steps:
- mkdir -p deploy
- mv Cwtch.dmg deploy
- name: ui-tests
commands:
- export PATH=$PATH:/Users/Dan/development/flutter/bin:/usr/local/bin
- export GEM_HOME=$HOME/.gem
- export PATH=$GEM_HOME/ruby/2.6.0/bin:$PATH
- ./run-tests.sh
- cp integration_test/gherkin/reports/cucumber_report.html deploy/macos_cucumber_report.html
- name: deploy-buildfiles
environment:
BUILDFILES_KEY:

6
.gitignore vendored
View File

@ -40,6 +40,12 @@ app.*.symbols
# Obfuscation related
app.*.map.json
# Gherkin
run-tests.env
test1
test2
testHome
linux/tor
linux/libCwtch.so
android/cwtch/cwtch.aar

View File

@ -7,7 +7,7 @@ Feature: Settings pane opens and can save settings persistently
Scenario: Change every setting (except Language)
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 4 second
When I tap the widget that contains the text "Use Light Themes"
#And I choose option 3 from the "DropdownTheme" dropdown
#When I tap the "DropdownTheme" button
@ -36,7 +36,7 @@ Feature: Settings pane opens and can save settings persistently
Scenario: When the app is reloaded, settings from the previous scenario have persisted
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 2 second
Then I expect the switch that contains the text "Use Light Themes" to be checked
And I expect the switch that contains the text "Block Unknown Contacts" to be checked
And I expect the switch that contains the text "Streamer/Presentation Mode" to be checked

View File

@ -1,7 +1,7 @@
Feature: Global 'language' setting
Scenario: Change the language to French and back
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 2 second
Then I expect the text 'Language' to be present
And I expect the text 'Langue' to be absent
When I tap the widget that contains the text "English"

View File

@ -1,10 +1,10 @@
Feature: Global 'Theme' setting
Scenario: Change the theme to Mermaid
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 2 second
When I tap the "DropdownTheme" button
And I tap the element that contains the text "Mermaid"
Scenario: Change the theme to Light Mode
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 2 second
And I tap the widget that contains the text "Theme"

View File

@ -3,6 +3,7 @@ Feature: Block unknown contacts setting
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 tap the 'OpenSettingsView' button
And I wait for 2 second
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
Given I tap the back button
@ -10,7 +11,7 @@ Feature: Block unknown contacts setting
And I tap the button that contains the text "Carol"
And I tap the button with tooltip "Add a new contact or conversation"
When I fill the "txtAddP2P" field with "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd"
And I wait for 1 second
And I wait for 2 second
And I take a screenshot
And I tap the back button
And I wait until the text "Alice" is present

View File

@ -5,7 +5,7 @@ Feature: Streamer mode
And I wait until the text "vbmmsbx3rhndpfz6t3jkrd7m3yu62xzrldxkdgsw4rsehiwuw3tmo7yd" is present
And I wait until the text "pjurzypqui3dnpxj6aemk6cqz22yx6zfr5lq4jzu7muwe2yyx2zrnzyd" is present
Given I tap the 'OpenSettingsView' button
And I wait for 1 second
And I wait for 2 second
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
When I tap the back button

View File

@ -23,6 +23,7 @@ Feature: Basic Profile Management
Then I tap the "button" widget with label "Add new profile"
And I expect a "ProfileRow" widget with text "Alice (Unencrypted)"
And I take a screenshot
And I wait for 2 second
Then I tap the "ProfileRow" widget with label "Alice (Unencrypted)"
And I expect the text "Alice (Unencrypted) » Conversations" to be present
And I take a screenshot
@ -43,6 +44,7 @@ Feature: Basic Profile Management
And I take a screenshot
Then I tap the "button" widget with label "Add new profile"
And I expect a "ProfileRow" widget with text "Alice (Encrypted)"
And I wait for 2 second
And I take a screenshot
Then I tap the "ProfileRow" widget with label "Alice (Encrypted)"
And I expect the text 'Alice (Encrypted) » Conversations' to be present

View File

@ -95,6 +95,6 @@ void main() {
ResetCwtchEnvironment(),
AttachScreenshotOnFailedStepHook(),
],
(World world) => app.main(),
(World world) { var killRes = Process.run("pkill", ["-9", "tor"]); var res = app.main(); sleep(Duration(seconds:2)); return res;},
);
}

View File

@ -1,18 +1,34 @@
#!/bin/bash
OS=$(uname)
DEVICE=linux
if [ "$OS" == "Darwin" ]; then
DEVICE=macos
fi
if [ ! -e run-tests.env ]; then
echo "#!/bin/bash" > run-tests.env
echo "LDPATH=./linux/" >> run-tests.env
echo "HEADLESS=false" >> run-tests.env
if [ "$OS" == "Linux" ]; then
echo "LDPATH=./linux/" >> run-tests.env
else
echo "LDPATH=./" >> run-tests.env
fi
if [ -z $DRONE ]; then
echo "HEADLESS=false" >> run-tests.env
else
echo "HEADLESS=true" >> run-tests.env
fi
fi
source run-tests.env
paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
#paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
# macos sed doesn't have -z
paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | awk '!/0$/{printf $0}/0$/' | sed "s/\.\//','\.\//g;s/^','/'/g;s/$/'/g")
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 build --delete-conflicting-outputs
pkill tor
LD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --headless --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart
LD_LIBRARY_PATH=$LDPATH DYLD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --headless --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart -d $DEVICE
node index2.js
if [ "$HEADLESS" = "false" ]; then
xdg-open integration_test/gherkin/reports/cucumber_report.html