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 - tar -czf cwtch-`cat ../VERSION`.tar.gz cwtch
- rm -r 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 - name: test-build-android
image: cirrusci/flutter:2.8.0 image: cirrusci/flutter:2.8.0
when: when:
@ -94,15 +113,6 @@ steps:
- cp build/app/outputs/apk/release/app-release.apk deploy/ - cp build/app/outputs/apk/release/app-release.apk deploy/
#- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android #- 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 - name: deploy-buildfiles
image: kroniak/ssh-client image: kroniak/ssh-client
@ -336,6 +346,14 @@ steps:
- mkdir -p deploy - mkdir -p deploy
- mv Cwtch.dmg 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 - name: deploy-buildfiles
environment: environment:
BUILDFILES_KEY: BUILDFILES_KEY:

6
.gitignore vendored
View File

@ -40,6 +40,12 @@ app.*.symbols
# Obfuscation related # Obfuscation related
app.*.map.json app.*.map.json
# Gherkin
run-tests.env
test1
test2
testHome
linux/tor linux/tor
linux/libCwtch.so linux/libCwtch.so
android/cwtch/cwtch.aar 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) Scenario: Change every setting (except Language)
Given I tap the 'OpenSettingsView' button 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" When I tap the widget that contains the text "Use Light Themes"
#And I choose option 3 from the "DropdownTheme" dropdown #And I choose option 3 from the "DropdownTheme" dropdown
#When I tap the "DropdownTheme" button #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 Scenario: When the app is reloaded, settings from the previous scenario have persisted
Given I tap the 'OpenSettingsView' button 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 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 "Block Unknown Contacts" to be checked
And I expect the switch that contains the text "Streamer/Presentation Mode" 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 Feature: Global 'language' setting
Scenario: Change the language to French and back Scenario: Change the language to French and back
Given I tap the 'OpenSettingsView' button 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 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 widget that contains the text "English"

View File

@ -1,10 +1,10 @@
Feature: Global 'Theme' setting Feature: Global 'Theme' setting
Scenario: Change the theme to Mermaid Scenario: Change the theme to Mermaid
Given I tap the 'OpenSettingsView' button Given I tap the 'OpenSettingsView' button
And I wait for 1 second And I wait for 2 second
When I tap the "DropdownTheme" button When I tap the "DropdownTheme" button
And I tap the element that contains the text "Mermaid" And I tap the element that contains the text "Mermaid"
Scenario: Change the theme to Light Mode Scenario: Change the theme to Light Mode
Given I tap the 'OpenSettingsView' button 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" 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 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 for 2 second
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 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 that contains the text "Carol"
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"
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 2 second
And I take a screenshot 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

View File

@ -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 for 2 second
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

View File

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

View File

@ -95,6 +95,6 @@ void main() {
ResetCwtchEnvironment(), ResetCwtchEnvironment(),
AttachScreenshotOnFailedStepHook(), 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 #!/bin/bash
OS=$(uname)
DEVICE=linux
if [ "$OS" == "Darwin" ]; then
DEVICE=macos
fi
if [ ! -e run-tests.env ]; then if [ ! -e run-tests.env ]; then
echo "#!/bin/bash" > run-tests.env echo "#!/bin/bash" > run-tests.env
echo "LDPATH=./linux/" >> run-tests.env if [ "$OS" == "Linux" ]; then
echo "HEADLESS=false" >> run-tests.env 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 fi
source run-tests.env 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 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
pkill tor 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
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
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