From 88685857e966ea6743fac3134c50b071f740dd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Augusto=20Gon=C3=A7alves=20Fernandes=20Santos=20S?= =?UTF-8?q?ilva?= Date: Thu, 23 Apr 2020 20:57:39 -0300 Subject: [PATCH 1/3] Replace string ":" with "." on filename of screenshotName --- lib/ozzie.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ozzie.dart b/lib/ozzie.dart index 244162f..a6c3ebb 100644 --- a/lib/ozzie.dart +++ b/lib/ozzie.dart @@ -123,7 +123,8 @@ class Ozzie { String get _groupFolderName => '$rootFolderName/$groupName'; - String get _timestamp => DateTime.now().toIso8601String(); + String get _timestamp => + DateTime.now().toIso8601String().replaceAll(new RegExp(r':'), '.'); String _fileName(String screenshotName) => '$_timestamp-$screenshotName.png'; From 9854313e432fe70b21bf8bac767371b69ec2e677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Augusto=20Gon=C3=A7alves=20Fernandes=20Santos=20S?= =?UTF-8?q?ilva?= Date: Wed, 29 Apr 2020 19:08:05 -0300 Subject: [PATCH 2/3] Replace without 'new Reg' --- lib/ozzie.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ozzie.dart b/lib/ozzie.dart index a6c3ebb..b446375 100644 --- a/lib/ozzie.dart +++ b/lib/ozzie.dart @@ -124,7 +124,7 @@ class Ozzie { String get _groupFolderName => '$rootFolderName/$groupName'; String get _timestamp => - DateTime.now().toIso8601String().replaceAll(new RegExp(r':'), '.'); + DateTime.now().toIso8601String().replaceAll(':', '.'); String _fileName(String screenshotName) => '$_timestamp-$screenshotName.png'; From ddc49565b67e36094df0a038315d498eb8e64280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Augusto=20Gon=C3=A7alves=20Fernandes=20Santos=20S?= =?UTF-8?q?ilva?= Date: Wed, 29 Apr 2020 21:41:32 -0300 Subject: [PATCH 3/3] test case takeScreenshot don`t contains character ":" on name --- test/ozzie_test.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/ozzie_test.dart b/test/ozzie_test.dart index 7e471cc..08426d2 100644 --- a/test/ozzie_test.dart +++ b/test/ozzie_test.dart @@ -90,6 +90,16 @@ void main() { expect(true, resultFile.path.contains('rim.png')); }); + test('takeScreenshot generates PNGs don`t contains character ":" on name', + () async { + await ozzie.takeScreenshot('character'); + final files = + Directory('$rootFolderName/$testGroupName').listSync().toList(); + final resultFile = + files.where((f) => f is File).map((f) => f as File).first; + expect(false, resultFile.path.contains(':')); + }); + group('HTML report generation', () { test('not calling generateHtmlReport does not create index.html', () async {