From 1fb3f46bcef57bfbe06c651f749819e5d63fd9c2 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 | 17 +++++++--------- 2 files changed, 28 insertions(+), 31 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..d9a6fc0a 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. @@ -19,7 +19,7 @@ void main() { await driver.close(); }); - test('SS screens', () async { + test('Initial view', () async { SerializableFinder toggleExpand = find.byValueKey('toggle-expand'); // ss notifications @@ -29,9 +29,10 @@ void main() { await screenshot(driver, 'screenshots/1.png'); }); - test('Screenshot no notifications', () async { + test('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); @@ -40,7 +41,7 @@ void main() { await screenshot(driver, 'screenshots/2.png'); }); - test('Test new credentials', () async { + test('Create new credentials', () async { SerializableFinder credentials = find.byValueKey('credentials'); SerializableFinder cog = find.byValueKey('cog'); SerializableFinder back = find.byValueKey('back-button'); @@ -74,16 +75,13 @@ void main() { expect(updatedCreds != initialCreds, true); }); - test('Test receiving notifications and scroll', () async { + test('Receive notifications', () async { // Send & Receive notifications // get credentials 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: 20)); } }); });