diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml index 84cb1f61..4ffc200d 100644 --- a/.github/workflows/it.yml +++ b/.github/workflows/it.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: branch: ["master", "develop"] - device: ["emulator-5554", "iPhone 12 Pro Max"] + device: ["emulator-5554", "iPhone 12 Pro Max", "macos"] steps: - uses: actions/checkout@v2 with: @@ -27,3 +27,22 @@ jobs: arch: x86_64 profile: Nexus 6P script: ./test_driver/test.sh "${{ matrix.device }}" "${{ matrix.branch }}" "${{ secrets.B64_ENV }}" "${{ secrets.B64_DEV_ENV }}" + + tests-linux: + runs-on: ubuntu-latest + strategy: + matrix: + branch: ["master", "develop"] + device: ["linux"] + steps: + - uses: actions/checkout@v2 + with: + ref: "refs/heads/${{ matrix.branch }}" + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + channel: 'stable' + - name: Test + run: ./test_driver/test.sh "${{ matrix.device }}" "${{ matrix.branch }}" "${{ secrets.B64_ENV }}" "${{ secrets.B64_DEV_ENV }}" diff --git a/.github/workflows/ss.yml b/.github/workflows/ss.yml index 7ef8b606..00026726 100644 --- a/.github/workflows/ss.yml +++ b/.github/workflows/ss.yml @@ -51,19 +51,19 @@ jobs:

iPad

- +

55"

- +

65"

- +

MacOS

- - - + + +

Android

diff --git a/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png index e0912fec..636ad3bd 100644 Binary files a/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png and b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png differ diff --git a/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png index b9926132..da315c27 100644 Binary files a/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png and b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png differ diff --git a/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png new file mode 100644 index 00000000..b6810576 Binary files /dev/null and b/android/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png differ diff --git a/ios/fastlane/screenshots/en-GB/0_APP_IPAD_PRO_129_0.png b/ios/fastlane/screenshots/en-GB/0_APP_IPAD_PRO_129_0.png index 8d70ecfe..0ab48737 100644 Binary files a/ios/fastlane/screenshots/en-GB/0_APP_IPAD_PRO_129_0.png and b/ios/fastlane/screenshots/en-GB/0_APP_IPAD_PRO_129_0.png differ diff --git a/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_55_0.png b/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_55_0.png index ecbf801d..d9ad300b 100644 Binary files a/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_55_0.png and b/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_55_0.png differ diff --git a/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_65_0.png b/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_65_0.png index 1a969416..8a4c52a9 100644 Binary files a/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_65_0.png and b/ios/fastlane/screenshots/en-GB/0_APP_IPHONE_65_0.png differ diff --git a/ios/fastlane/screenshots/en-GB/0_APP_ipadPro129-3rd-gen_0.png b/ios/fastlane/screenshots/en-GB/0_APP_ipadPro129-3rd-gen_0.png index 07be173c..e9a13304 100644 Binary files a/ios/fastlane/screenshots/en-GB/0_APP_ipadPro129-3rd-gen_0.png and b/ios/fastlane/screenshots/en-GB/0_APP_ipadPro129-3rd-gen_0.png differ diff --git a/ios/fastlane/screenshots/en-GB/1_APP_IPAD_PRO_129_1.png b/ios/fastlane/screenshots/en-GB/1_APP_IPAD_PRO_129_1.png index 90a4f628..231d43f2 100644 Binary files a/ios/fastlane/screenshots/en-GB/1_APP_IPAD_PRO_129_1.png and b/ios/fastlane/screenshots/en-GB/1_APP_IPAD_PRO_129_1.png differ diff --git a/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_55_1.png b/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_55_1.png index 48d88d2f..678b55f5 100644 Binary files a/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_55_1.png and b/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_55_1.png differ diff --git a/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_65_1.png b/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_65_1.png index 320687e3..c6144e4c 100644 Binary files a/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_65_1.png and b/ios/fastlane/screenshots/en-GB/1_APP_IPHONE_65_1.png differ diff --git a/ios/fastlane/screenshots/en-GB/1_APP_ipadPro129-3rd-gen_1.png b/ios/fastlane/screenshots/en-GB/1_APP_ipadPro129-3rd-gen_1.png index 072f3a3f..f5dc1bfc 100644 Binary files a/ios/fastlane/screenshots/en-GB/1_APP_ipadPro129-3rd-gen_1.png and b/ios/fastlane/screenshots/en-GB/1_APP_ipadPro129-3rd-gen_1.png differ diff --git a/ios/fastlane/screenshots/en-GB/2_APP_IPAD_PRO_129_2.png b/ios/fastlane/screenshots/en-GB/2_APP_IPAD_PRO_129_2.png index 4818be97..970a196f 100644 Binary files a/ios/fastlane/screenshots/en-GB/2_APP_IPAD_PRO_129_2.png and b/ios/fastlane/screenshots/en-GB/2_APP_IPAD_PRO_129_2.png differ diff --git a/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_55_2.png b/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_55_2.png index c91a7966..47f0abc4 100644 Binary files a/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_55_2.png and b/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_55_2.png differ diff --git a/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_65_2.png b/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_65_2.png index 30f7dd20..a1829da4 100644 Binary files a/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_65_2.png and b/ios/fastlane/screenshots/en-GB/2_APP_IPHONE_65_2.png differ diff --git a/ios/fastlane/screenshots/en-GB/2_APP_ipadPro129-3rd-gen_2.png b/ios/fastlane/screenshots/en-GB/2_APP_ipadPro129-3rd-gen_2.png index 52051888..d835263f 100644 Binary files a/ios/fastlane/screenshots/en-GB/2_APP_ipadPro129-3rd-gen_2.png and b/ios/fastlane/screenshots/en-GB/2_APP_ipadPro129-3rd-gen_2.png differ diff --git a/lib/main.dart b/lib/main.dart index a6018176..f4d03c66 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -24,6 +24,7 @@ import 'package:sqflite/sqflite.dart'; Future main() => mainImpl(); Future mainImpl({bool integration: false}) async { + Globals.isIntegration = integration; WidgetsFlutterBinding.ensureInitialized(); // initialise db for linux & windows diff --git a/lib/notifications/notification.dart b/lib/notifications/notification.dart index 4a7d4f5b..19fc4b25 100644 --- a/lib/notifications/notification.dart +++ b/lib/notifications/notification.dart @@ -97,6 +97,13 @@ class NotificationUIState extends State Timer timer; SlideActionType mouseSliderAction; + @override + void setState(Function fn) { + if (mounted) { + super.setState(fn); + } + } + @override void initState() { super.initState(); @@ -416,7 +423,6 @@ class NotificationUIState extends State } widget.canExpand = canExpand; - if (!mounted) return; setState(() {}); } diff --git a/lib/user.dart b/lib/user.dart index 09e5a050..8dcff479 100644 --- a/lib/user.dart +++ b/lib/user.dart @@ -263,7 +263,7 @@ class User with ChangeNotifier { _tmpErr = hasErr; Future.delayed(const Duration(seconds: 1), () { if (_tmpErr == hasErr) { - if (_tmpErr) { + if (_tmpErr && !Globals.isIntegration) { MenuBarIcon.setErr(); showAlertSnackBar(_snackContext, 'Network Error!'); } else { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c59fb5b4..7265d4ea 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -18,6 +18,10 @@ const String refKey = 'ref'; const String messageKey = 'msg'; final EmojiParser eParser = EmojiParser(); +class Globals { + static bool isIntegration = false; +} + bool get isTest { return Platform.environment.containsKey('FLUTTER_TEST'); } @@ -109,7 +113,7 @@ void showToast(String msg, BuildContext context, {int duration, int gravity}) { } Future getDeviceUUID() async { - if (Platform.isLinux) { + if (Platform.isLinux || Globals.isIntegration) { Uuid uuid = Uuid(); return uuid.v4(); } diff --git a/screenshots/android/1_framed.png b/screenshots/android/framed/1.png similarity index 99% rename from screenshots/android/1_framed.png rename to screenshots/android/framed/1.png index c467c53f..1d576bf0 100644 Binary files a/screenshots/android/1_framed.png and b/screenshots/android/framed/1.png differ diff --git a/screenshots/android/2_framed.png b/screenshots/android/framed/2.png similarity index 99% rename from screenshots/android/2_framed.png rename to screenshots/android/framed/2.png index 37a3ff00..25a70050 100644 Binary files a/screenshots/android/2_framed.png and b/screenshots/android/framed/2.png differ diff --git a/screenshots/android/framed/3.png b/screenshots/android/framed/3.png new file mode 100644 index 00000000..980245ef Binary files /dev/null and b/screenshots/android/framed/3.png differ diff --git a/screenshots/android/generate.sh b/screenshots/android/generate.sh index 21dae4bb..faa62d22 100644 --- a/screenshots/android/generate.sh +++ b/screenshots/android/generate.sh @@ -5,9 +5,9 @@ font_size=120 for filename in *.png; do out=$(basename "$filename" | sed 's/.png//g') - framed="${out}_framed.png" + framed="framed/${out}.png" convert "utils/Nexus 6P.png" \ - "$filename" -geometry +59+330 -composite \ + "$filename" -geometry +59+330 -composite -strip \ "$framed" bash ../../test_driver/add-text.sh "../screenshots/android/$framed" "../android/fastlane/metadata/android/en-GB/images/phoneScreenshots/${out}_en-GB.png" $font_size $height $width diff --git a/screenshots/ios/1.png b/screenshots/ios/1.png index eb8e4747..9cda4d3c 100644 Binary files a/screenshots/ios/1.png and b/screenshots/ios/1.png differ diff --git a/screenshots/ios/2.png b/screenshots/ios/2.png index 667f5625..78ee5edf 100644 Binary files a/screenshots/ios/2.png and b/screenshots/ios/2.png differ diff --git a/screenshots/ios/3.png b/screenshots/ios/3.png index ee8637c4..35e9a128 100644 Binary files a/screenshots/ios/3.png and b/screenshots/ios/3.png differ diff --git a/screenshots/ios/framed/55/0.png b/screenshots/ios/framed/55/0.png new file mode 100644 index 00000000..54478ef3 Binary files /dev/null and b/screenshots/ios/framed/55/0.png differ diff --git a/screenshots/ios/framed/55/1.png b/screenshots/ios/framed/55/1.png new file mode 100644 index 00000000..4e48b81c Binary files /dev/null and b/screenshots/ios/framed/55/1.png differ diff --git a/screenshots/ios/framed/55/2.png b/screenshots/ios/framed/55/2.png new file mode 100644 index 00000000..1ee7b129 Binary files /dev/null and b/screenshots/ios/framed/55/2.png differ diff --git a/screenshots/ios/framed/65/0.png b/screenshots/ios/framed/65/0.png new file mode 100644 index 00000000..264eb9f5 Binary files /dev/null and b/screenshots/ios/framed/65/0.png differ diff --git a/screenshots/ios/framed/65/1.png b/screenshots/ios/framed/65/1.png new file mode 100644 index 00000000..60654d63 Binary files /dev/null and b/screenshots/ios/framed/65/1.png differ diff --git a/screenshots/ios/framed/65/2.png b/screenshots/ios/framed/65/2.png new file mode 100644 index 00000000..618ce0ad Binary files /dev/null and b/screenshots/ios/framed/65/2.png differ diff --git a/screenshots/ios/framed/ipad/0.png b/screenshots/ios/framed/ipad/0.png new file mode 100644 index 00000000..bd61587d Binary files /dev/null and b/screenshots/ios/framed/ipad/0.png differ diff --git a/screenshots/ios/framed/ipad/1.png b/screenshots/ios/framed/ipad/1.png new file mode 100644 index 00000000..be8fe1d6 Binary files /dev/null and b/screenshots/ios/framed/ipad/1.png differ diff --git a/screenshots/ios/framed/ipad/2.png b/screenshots/ios/framed/ipad/2.png new file mode 100644 index 00000000..778f1ada Binary files /dev/null and b/screenshots/ios/framed/ipad/2.png differ diff --git a/screenshots/macos/1.png b/screenshots/macos/1.png new file mode 100644 index 00000000..07548083 Binary files /dev/null and b/screenshots/macos/1.png differ diff --git a/screenshots/macos/2.png b/screenshots/macos/2.png new file mode 100644 index 00000000..4fe5d44c Binary files /dev/null and b/screenshots/macos/2.png differ diff --git a/screenshots/macos/3.png b/screenshots/macos/3.png new file mode 100644 index 00000000..8b7a7d02 Binary files /dev/null and b/screenshots/macos/3.png differ diff --git a/screenshots/macos/framed/1.png b/screenshots/macos/framed/1.png new file mode 100644 index 00000000..547590e1 Binary files /dev/null and b/screenshots/macos/framed/1.png differ diff --git a/screenshots/macos/framed/2.png b/screenshots/macos/framed/2.png new file mode 100644 index 00000000..b9566971 Binary files /dev/null and b/screenshots/macos/framed/2.png differ diff --git a/screenshots/macos/framed/3.png b/screenshots/macos/framed/3.png new file mode 100644 index 00000000..5ba0e884 Binary files /dev/null and b/screenshots/macos/framed/3.png differ diff --git a/screenshots/macos/generate.sh b/screenshots/macos/generate.sh index 976f0537..0ef3e82a 100644 --- a/screenshots/macos/generate.sh +++ b/screenshots/macos/generate.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" for filename in *.png; do out=$(basename "$filename" | sed 's/.png//g') - convert "template.png" \ - \( "$filename" -resize x1245 \) -geometry +1203+80 -composite \ - "${out}_framed.png" + convert "utils/template.png" \ + \( "$filename" -resize x1245 \) -geometry +1203+80 -composite -strip \ + "framed/${out}.png" done diff --git a/screenshots/macos/macos.png b/screenshots/macos/macos.png deleted file mode 100644 index ae48ee4c..00000000 Binary files a/screenshots/macos/macos.png and /dev/null differ diff --git a/screenshots/macos/template.png b/screenshots/macos/utils/template.png similarity index 100% rename from screenshots/macos/template.png rename to screenshots/macos/utils/template.png diff --git a/test_driver/add-text.sh b/test_driver/add-text.sh index ec3fb01a..663ae606 100644 --- a/test_driver/add-text.sh +++ b/test_driver/add-text.sh @@ -26,5 +26,5 @@ convert "$filename" \ -font "../fonts/Inconsolata-Bold.ttf" -pointsize $font_size -fill "#fff" -annotate "+0+$logo_h" 'notifi' \ -font "../fonts/Inconsolata.ttf" -pointsize "$font_size2" -fill "#fff" -annotate "+0+$desc_h" 'Receive push notifications' \ -font "../fonts/Inconsolata.ttf" -pointsize "$font_size2" -fill "#fff" -annotate "+0+$desc_h2" 'over HTTP.' \ - -bordercolor "#bc2122" -border "${padding}x${padding}" \ + -bordercolor "#bc2122" -border "${padding}x${padding}" -strip \ "$out" diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart index c0252e6f..1b275bfc 100644 --- a/test_driver/app_test.dart +++ b/test_driver/app_test.dart @@ -90,6 +90,7 @@ void main() { 'https://dev.notifi.it/api?credentials=$creds&title=${i}&message=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&link=https://notifi.it&image=https://notifi.it/images/logo.png')); // ignore: avoid_print print(req.statusCode); + await Future.delayed(Duration(milliseconds: 600)); } await driver.waitUntilNoTransientCallbacks(timeout: Duration(seconds: 5)); diff --git a/test_driver/screenshot.sh b/test_driver/screenshot.sh index f7ab5e28..282dbc61 100644 --- a/test_driver/screenshot.sh +++ b/test_driver/screenshot.sh @@ -21,8 +21,8 @@ mv ${SS_DIR}*.png "${SS_DIR}android/" ## iOS # ######## IOS_SS_DIR="../ios/fastlane/screenshots/en-GB/" -IOS_DEVICES=("iPhone 12 Pro Max" "iPad Pro (12.9-inch) (4th generation)" "iPhone 8 Plus") -IOS_DEVICE_PATHS=("IPHONE_65" "IPAD_PRO_129,ipadPro129-3rd-gen" "IPHONE_55") +IOS_DEVICES=("iPad Pro (12.9-inch) (4th generation)" "iPhone 12 Pro Max" "iPhone 8 Plus") +IOS_DEVICE_PATHS=("IPAD_PRO_129,ipadPro129-3rd-gen" "IPHONE_65" "IPHONE_55") # print simulator IOS_DEVICES xcrun simctl list @@ -59,25 +59,28 @@ done # wrap screenshot frames with text for filename in "${IOS_SS_DIR}"*_framed.png; do - out=$(basename "$filename" | sed 's/_framed//g') - out="${IOS_SS_DIR}${out}" + num=$(basename "$filename" | sed 's/_framed//g') + out="${IOS_SS_DIR}${num}" # calc positions height=2732 width=2048 font_size=120 + device="ipad" if [[ "$filename" == *"IPHONE_65"* ]]; then width=1284 height=2778 font_size=110 + device="65" elif [[ "$filename" == *"IPHONE_55"* ]]; then width=1242 height=2208 font_size=100 + device="55" fi bash add-text.sh "$filename" "$out" $font_size $height $width - mv "$filename" ../screenshots/ios/ + mv "$filename" "${SS_DIR}ios/framed/$device/${num}" done # run macos screenshot setup diff --git a/test_driver/test.sh b/test_driver/test.sh index ee922bbd..2bca56ed 100755 --- a/test_driver/test.sh +++ b/test_driver/test.sh @@ -13,6 +13,10 @@ if [[ $device == *"iPhone"* ]]; then if ! xcrun simctl boot "$device"; then exit 1 fi +elif [[ $device == *"macos"* ]]; then + flutter config --enable-macos-desktop +elif [[ $device == *"linux"* ]]; then + flutter config --enable-linux-desktop fi flutter drive --target=test_driver/app.dart -d "$device"