From 1f770dc66c290bea8df25d44d892e030042d21f4 Mon Sep 17 00:00:00 2001 From: Maximilian Mitchell Date: Sat, 11 Dec 2021 20:01:00 +0000 Subject: [PATCH] add xserver - Fix ubuntu integration tests - resolves #202 --- .github/workflows/it.yml | 42 +++++++++++++++++++-------------------- test_driver/app_test.dart | 9 +++------ 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml index b62bbf3d..4f4dec70 100644 --- a/.github/workflows/it.yml +++ b/.github/workflows/it.yml @@ -49,24 +49,24 @@ jobs: profile: Nexus 6P script: ./test_driver/test.sh "${{ matrix.device }}" "${{ matrix.branch }}" "${{ secrets.B64_ENV }}" "${{ secrets.B64_DEV_ENV }}" -# test-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' -# - name: Test -# run: | -# sudo apt-get update -y -# sudo apt-get install -y ninja-build libgtk-3-dev -# sudo snap install -y flutter -# flutter channel stable -# flutter upgrade -# ./test_driver/test.sh "${{ matrix.device }}" "${{ matrix.branch }}" "${{ secrets.B64_ENV }}" "${{ secrets.B64_DEV_ENV }}" + test-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' + - name: Test + run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev xserver + sudo snap install -y flutter + flutter channel stable + flutter upgrade + ./test_driver/test.sh "${{ matrix.device }}" "${{ matrix.branch }}" "${{ secrets.B64_ENV }}" "${{ secrets.B64_DEV_ENV }}" diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart index 3cb47e04..d0891926 100644 --- a/test_driver/app_test.dart +++ b/test_driver/app_test.dart @@ -6,7 +6,7 @@ import 'package:http/http.dart' as http; void main() { - group('Screen Shot', () { + group('Integration Tests', () { FlutterDriver driver; // Connect to the Flutter driver before running any tests. @@ -32,6 +32,7 @@ void main() { test('Screenshot no notifications', () async { SerializableFinder deleteAll = find.byValueKey('delete-all'); SerializableFinder ok = find.byValueKey('ok'); + // ss no notifications await driver.tap(deleteAll); await driver.waitFor(ok); @@ -81,9 +82,6 @@ void main() { SerializableFinder credentials = find.byValueKey('credentials'); String creds = await driver.getText(credentials); - // ignore: avoid_print - print(creds); - // get host from .env String host; String file = await File('.env').readAsString(); @@ -99,8 +97,7 @@ void main() { 'https://$host/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(seconds: 1)); - await driver.waitFor(find.text('$i')); + await driver.waitFor(find.text('$i'), timeout: Duration(seconds: 2)); } }); });