From 2c6e5b2e9c75d68b28294fb0bb4c21e8c92a2323 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sat, 16 Feb 2019 00:54:58 +0100 Subject: [PATCH] Screenshots: Add more screenshots * Add another note and then take a screenshot of the list view * Take a screenshot of the Git Host Setup --- lib/screens/note_editor.dart | 1 + test_driver/main_test.dart | 51 ++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/lib/screens/note_editor.dart b/lib/screens/note_editor.dart index c138fcf3..f09e4025 100644 --- a/lib/screens/note_editor.dart +++ b/lib/screens/note_editor.dart @@ -53,6 +53,7 @@ class NoteEditorState extends State { appBar: AppBar( title: Text(title), leading: IconButton( + key: ValueKey("NewEntry"), icon: Icon(Icons.check), onPressed: () { final stateContainer = StateContainer.of(context); diff --git a/test_driver/main_test.dart b/test_driver/main_test.dart index 856ef28f..36e300be 100644 --- a/test_driver/main_test.dart +++ b/test_driver/main_test.dart @@ -35,25 +35,6 @@ void main() { await driver.waitFor(loadedFinder, timeout: Duration(seconds: 5)); await _takeScreenshot(); - // Open the Drawer - final drawerButtonFinder = find.byValueKey("DrawerButton"); - await driver.tap(drawerButtonFinder); - await Future.delayed(Duration(milliseconds: 500)); - await _takeScreenshot(); - - // The Git Host setup screen - /* - await driver.tap(find.text("Setup Git Host")); - await driver.waitFor(find.text("GitHub"), timeout: Duration(seconds: 2)); - await _takeScreenshot(); - // FIXME: This doesn't seem to work! - await driver.tap(find.pageBack()); - */ - - // Close the drawer - var app = find.byValueKey("App"); - await driver.scroll(app, -300.0, 0.0, const Duration(milliseconds: 300)); - // Create a new note var fab = find.byValueKey("FAB"); await driver.waitFor(fab, timeout: Duration(seconds: 2)); @@ -65,6 +46,38 @@ void main() { await driver.enterText( "Your notes will be saved in Markdown with a YAML header for the metadata.\n\nThe writing experience is clean and distraction free"); await _takeScreenshot(); + await driver.tap(find.byValueKey("NewEntry")); + + // Create another note + await driver.waitFor(fab, timeout: Duration(seconds: 2)); + await driver.tap(fab); + await driver.waitFor(find.text('Write here'), + timeout: Duration(seconds: 2)); + + await driver.enterText( + "Journaling is a great way to clear your mind and get all your throughts down into paper. Well, not literal paper, as this is an app, but I think you get the point."); + await _takeScreenshot(); + await driver.tap(find.byValueKey("NewEntry")); + + await Future.delayed(Duration(milliseconds: 500)); + await _takeScreenshot(); + + // Open the Drawer + final drawerButtonFinder = find.byValueKey("DrawerButton"); + await driver.tap(drawerButtonFinder); + await Future.delayed(Duration(milliseconds: 500)); + await _takeScreenshot(); + + // The Git Host setup screen + await driver.tap(find.text("Setup Git Host")); + await driver.waitFor(find.text("GitHub"), timeout: Duration(seconds: 2)); + await _takeScreenshot(); + // FIXME: This doesn't seem to work! + // await driver.tap(find.pageBack()); + + // Close the drawer + // var app = find.byValueKey("App"); + // await driver.scroll(app, -300.0, 0.0, const Duration(milliseconds: 300)); }); }); }