diff --git a/lib/ozzie.dart b/lib/ozzie.dart index 244162f..b446375 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(':', '.'); String _fileName(String screenshotName) => '$_timestamp-$screenshotName.png'; 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 {