From 0a91ca755dfb57b6051ba1d216a81bb429441345 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 08:32:54 +0100 Subject: [PATCH 1/6] upgrade to newest version --- .fvmrc | 4 +- .../integration_test/browser_stack_api.dart | 61 +-- .../integration_test_android_option.dart | 21 +- ...tegration_test_android_option.freezed.dart | 417 ++++++------------ .../option/integration_test_ios_option.dart | 19 +- .../integration_test_ios_option.freezed.dart | 388 ++++++---------- .../option/integration_test_parameter.dart | 2 +- .../run_android_integration_test.dart | 4 +- .../run_ios_integration_test.dart | 4 +- lib/tapped_test_toolkit.dart | 2 +- pubspec.yaml | 16 +- 11 files changed, 338 insertions(+), 600 deletions(-) diff --git a/.fvmrc b/.fvmrc index 8f59eb5..c0edbf9 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.22.2" -} \ No newline at end of file + "flutter": "3.29.0" +} diff --git a/lib/src/integration_test/browser_stack_api.dart b/lib/src/integration_test/browser_stack_api.dart index 6499fa8..9b2558c 100644 --- a/lib/src/integration_test/browser_stack_api.dart +++ b/lib/src/integration_test/browser_stack_api.dart @@ -19,29 +19,30 @@ class BrowserStackApi { stdout.writeln('Upload: $filename:\n'); int? uploadPercent; - final request = ProgressUpdateMultipartRequest( - "POST", - Uri.parse(url), - onProgress: (bytes, totalBytes) { - final remainingMbs = (bytes / 1024 / 1024); - final totalMbs = (totalBytes / 1024 / 1024); - - final percent = ((100 * remainingMbs) / totalMbs).round(); - - if (percent != uploadPercent) { - // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart - // Append a \r to make sure we update the statement instead of adding a new one. - // Keep in mind to use write instead of writeln. - stdout.write( - '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', - ); - uploadPercent = percent; - } - }, - ) - ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader - ..files.add(await http.MultipartFile.fromPath("file", file.path)) - ..fields.addAll(fields); + final request = + ProgressUpdateMultipartRequest( + "POST", + Uri.parse(url), + onProgress: (bytes, totalBytes) { + final remainingMbs = (bytes / 1024 / 1024); + final totalMbs = (totalBytes / 1024 / 1024); + + final percent = ((100 * remainingMbs) / totalMbs).round(); + + if (percent != uploadPercent) { + // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart + // Append a \r to make sure we update the statement instead of adding a new one. + // Keep in mind to use write instead of writeln. + stdout.write( + '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', + ); + uploadPercent = percent; + } + }, + ) + ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader + ..files.add(await http.MultipartFile.fromPath("file", file.path)) + ..fields.addAll(fields); final response = await http.Response.fromStream(await request.send()); @@ -108,8 +109,9 @@ class BrowserStackApi { await Future.delayed(const Duration(seconds: 10)); - final currentFormattedTime = - DateFormat('hh:mm:ss').format(DateTime.now().toUtc()); + final currentFormattedTime = DateFormat( + 'hh:mm:ss', + ).format(DateTime.now().toUtc()); stdout.writeln( "[$currentFormattedTime GTM]: Waiting for the test to complete - this may take a few minutes - Go to BrowserStack to see more information.", @@ -123,10 +125,11 @@ class BrowserStackApi { extension on http.Response { Map handleResult() { if (statusCode != 200) { - final buffer = StringBuffer() - ..writeln("Request to ${request?.url} failed.") - ..writeln("Code: $statusCode") - ..writeln("Body: $body"); + final buffer = + StringBuffer() + ..writeln("Request to ${request?.url} failed.") + ..writeln("Code: $statusCode") + ..writeln("Body: $body"); stderr.write(buffer); exit(-1); } diff --git a/lib/src/integration_test/option/integration_test_android_option.dart b/lib/src/integration_test/option/integration_test_android_option.dart index 93615ee..5afae99 100644 --- a/lib/src/integration_test/option/integration_test_android_option.dart +++ b/lib/src/integration_test/option/integration_test_android_option.dart @@ -26,16 +26,17 @@ class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption { static Future fromArguments( List arguments, ) async { - final parser = ArgParser() - ..addOption(IntegrationTestParameter.apkPathParam) - ..addOption(IntegrationTestParameter.testSuitePathParam) - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) - ..addOption( - IntegrationTestParameter.devicesParam, - defaultsTo: "Samsung Galaxy S22-12.0", - ) - ..addOption(IntegrationTestParameter.customIdParam); + final parser = + ArgParser() + ..addOption(IntegrationTestParameter.apkPathParam) + ..addOption(IntegrationTestParameter.testSuitePathParam) + ..addOption(IntegrationTestParameter.browserstackUserParam) + ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) + ..addOption( + IntegrationTestParameter.devicesParam, + defaultsTo: "Samsung Galaxy S22-12.0", + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments); diff --git a/lib/src/integration_test/option/integration_test_android_option.freezed.dart b/lib/src/integration_test/option/integration_test_android_option.freezed.dart index a5313bd..66bae7b 100644 --- a/lib/src/integration_test/option/integration_test_android_option.freezed.dart +++ b/lib/src/integration_test/option/integration_test_android_option.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,304 +10,160 @@ part of 'integration_test_android_option.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - /// @nodoc mixin _$IntegrationTestAndroidOption { - String get browserstackUsername => throw _privateConstructorUsedError; - String get browserstackAccessKey => throw _privateConstructorUsedError; - File get apk => throw _privateConstructorUsedError; - File get testSuite => throw _privateConstructorUsedError; - String? get customId => throw _privateConstructorUsedError; - List get devices => throw _privateConstructorUsedError; - bool get networkLogs => throw _privateConstructorUsedError; - bool get deviceLogs => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $IntegrationTestAndroidOptionCopyWith - get copyWith => throw _privateConstructorUsedError; + + String get browserstackUsername; String get browserstackAccessKey; File get apk; File get testSuite; String? get customId; List get devices; bool get networkLogs; bool get deviceLogs; +/// Create a copy of IntegrationTestAndroidOption +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IntegrationTestAndroidOptionCopyWith get copyWith => _$IntegrationTestAndroidOptionCopyWithImpl(this as IntegrationTestAndroidOption, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IntegrationTestAndroidOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.apk, apk) || other.apk == apk)&&(identical(other.testSuite, testSuite) || other.testSuite == testSuite)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); } -/// @nodoc -abstract class $IntegrationTestAndroidOptionCopyWith<$Res> { - factory $IntegrationTestAndroidOptionCopyWith( - IntegrationTestAndroidOption value, - $Res Function(IntegrationTestAndroidOption) then) = - _$IntegrationTestAndroidOptionCopyWithImpl<$Res, - IntegrationTestAndroidOption>; - @useResult - $Res call( - {String browserstackUsername, - String browserstackAccessKey, - File apk, - File testSuite, - String? customId, - List devices, - bool networkLogs, - bool deviceLogs}); + +@override +int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,apk,testSuite,customId,const DeepCollectionEquality().hash(devices),networkLogs,deviceLogs); + +@override +String toString() { + return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; } -/// @nodoc -class _$IntegrationTestAndroidOptionCopyWithImpl<$Res, - $Val extends IntegrationTestAndroidOption> - implements $IntegrationTestAndroidOptionCopyWith<$Res> { - _$IntegrationTestAndroidOptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? browserstackUsername = null, - Object? browserstackAccessKey = null, - Object? apk = null, - Object? testSuite = null, - Object? customId = freezed, - Object? devices = null, - Object? networkLogs = null, - Object? deviceLogs = null, - }) { - return _then(_value.copyWith( - browserstackUsername: null == browserstackUsername - ? _value.browserstackUsername - : browserstackUsername // ignore: cast_nullable_to_non_nullable - as String, - browserstackAccessKey: null == browserstackAccessKey - ? _value.browserstackAccessKey - : browserstackAccessKey // ignore: cast_nullable_to_non_nullable - as String, - apk: null == apk - ? _value.apk - : apk // ignore: cast_nullable_to_non_nullable - as File, - testSuite: null == testSuite - ? _value.testSuite - : testSuite // ignore: cast_nullable_to_non_nullable - as File, - customId: freezed == customId - ? _value.customId - : customId // ignore: cast_nullable_to_non_nullable - as String?, - devices: null == devices - ? _value.devices - : devices // ignore: cast_nullable_to_non_nullable - as List, - networkLogs: null == networkLogs - ? _value.networkLogs - : networkLogs // ignore: cast_nullable_to_non_nullable - as bool, - deviceLogs: null == deviceLogs - ? _value.deviceLogs - : deviceLogs // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } + } /// @nodoc -abstract class _$$IntegrationTestAndroidOptionImplCopyWith<$Res> +abstract mixin class $IntegrationTestAndroidOptionCopyWith<$Res> { + factory $IntegrationTestAndroidOptionCopyWith(IntegrationTestAndroidOption value, $Res Function(IntegrationTestAndroidOption) _then) = _$IntegrationTestAndroidOptionCopyWithImpl; +@useResult +$Res call({ + String browserstackUsername, String browserstackAccessKey, File apk, File testSuite, String? customId, List devices, bool networkLogs, bool deviceLogs +}); + + + + +} +/// @nodoc +class _$IntegrationTestAndroidOptionCopyWithImpl<$Res> implements $IntegrationTestAndroidOptionCopyWith<$Res> { - factory _$$IntegrationTestAndroidOptionImplCopyWith( - _$IntegrationTestAndroidOptionImpl value, - $Res Function(_$IntegrationTestAndroidOptionImpl) then) = - __$$IntegrationTestAndroidOptionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String browserstackUsername, - String browserstackAccessKey, - File apk, - File testSuite, - String? customId, - List devices, - bool networkLogs, - bool deviceLogs}); + _$IntegrationTestAndroidOptionCopyWithImpl(this._self, this._then); + + final IntegrationTestAndroidOption _self; + final $Res Function(IntegrationTestAndroidOption) _then; + +/// Create a copy of IntegrationTestAndroidOption +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? apk = null,Object? testSuite = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { + return _then(_self.copyWith( +browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable +as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable +as String,apk: null == apk ? _self.apk : apk // ignore: cast_nullable_to_non_nullable +as File,testSuite: null == testSuite ? _self.testSuite : testSuite // ignore: cast_nullable_to_non_nullable +as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable +as String?,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable +as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable +as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + } + /// @nodoc -class __$$IntegrationTestAndroidOptionImplCopyWithImpl<$Res> - extends _$IntegrationTestAndroidOptionCopyWithImpl<$Res, - _$IntegrationTestAndroidOptionImpl> - implements _$$IntegrationTestAndroidOptionImplCopyWith<$Res> { - __$$IntegrationTestAndroidOptionImplCopyWithImpl( - _$IntegrationTestAndroidOptionImpl _value, - $Res Function(_$IntegrationTestAndroidOptionImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? browserstackUsername = null, - Object? browserstackAccessKey = null, - Object? apk = null, - Object? testSuite = null, - Object? customId = freezed, - Object? devices = null, - Object? networkLogs = null, - Object? deviceLogs = null, - }) { - return _then(_$IntegrationTestAndroidOptionImpl( - browserstackUsername: null == browserstackUsername - ? _value.browserstackUsername - : browserstackUsername // ignore: cast_nullable_to_non_nullable - as String, - browserstackAccessKey: null == browserstackAccessKey - ? _value.browserstackAccessKey - : browserstackAccessKey // ignore: cast_nullable_to_non_nullable - as String, - apk: null == apk - ? _value.apk - : apk // ignore: cast_nullable_to_non_nullable - as File, - testSuite: null == testSuite - ? _value.testSuite - : testSuite // ignore: cast_nullable_to_non_nullable - as File, - customId: freezed == customId - ? _value.customId - : customId // ignore: cast_nullable_to_non_nullable - as String?, - devices: null == devices - ? _value._devices - : devices // ignore: cast_nullable_to_non_nullable - as List, - networkLogs: null == networkLogs - ? _value.networkLogs - : networkLogs // ignore: cast_nullable_to_non_nullable - as bool, - deviceLogs: null == deviceLogs - ? _value.deviceLogs - : deviceLogs // ignore: cast_nullable_to_non_nullable - as bool, - )); - } + + +class _IntegrationTestAndroidOption extends IntegrationTestAndroidOption { + const _IntegrationTestAndroidOption({required this.browserstackUsername, required this.browserstackAccessKey, required this.apk, required this.testSuite, this.customId, required final List devices, this.networkLogs = true, this.deviceLogs = true}): _devices = devices,super._(); + + +@override final String browserstackUsername; +@override final String browserstackAccessKey; +@override final File apk; +@override final File testSuite; +@override final String? customId; + final List _devices; +@override List get devices { + if (_devices is EqualUnmodifiableListView) return _devices; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_devices); +} + +@override@JsonKey() final bool networkLogs; +@override@JsonKey() final bool deviceLogs; + +/// Create a copy of IntegrationTestAndroidOption +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IntegrationTestAndroidOptionCopyWith<_IntegrationTestAndroidOption> get copyWith => __$IntegrationTestAndroidOptionCopyWithImpl<_IntegrationTestAndroidOption>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntegrationTestAndroidOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.apk, apk) || other.apk == apk)&&(identical(other.testSuite, testSuite) || other.testSuite == testSuite)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); +} + + +@override +int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,apk,testSuite,customId,const DeepCollectionEquality().hash(_devices),networkLogs,deviceLogs); + +@override +String toString() { + return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; +} + + } /// @nodoc +abstract mixin class _$IntegrationTestAndroidOptionCopyWith<$Res> implements $IntegrationTestAndroidOptionCopyWith<$Res> { + factory _$IntegrationTestAndroidOptionCopyWith(_IntegrationTestAndroidOption value, $Res Function(_IntegrationTestAndroidOption) _then) = __$IntegrationTestAndroidOptionCopyWithImpl; +@override @useResult +$Res call({ + String browserstackUsername, String browserstackAccessKey, File apk, File testSuite, String? customId, List devices, bool networkLogs, bool deviceLogs +}); + + -class _$IntegrationTestAndroidOptionImpl extends _IntegrationTestAndroidOption { - const _$IntegrationTestAndroidOptionImpl( - {required this.browserstackUsername, - required this.browserstackAccessKey, - required this.apk, - required this.testSuite, - this.customId, - required final List devices, - this.networkLogs = true, - this.deviceLogs = true}) - : _devices = devices, - super._(); - - @override - final String browserstackUsername; - @override - final String browserstackAccessKey; - @override - final File apk; - @override - final File testSuite; - @override - final String? customId; - final List _devices; - @override - List get devices { - if (_devices is EqualUnmodifiableListView) return _devices; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_devices); - } - - @override - @JsonKey() - final bool networkLogs; - @override - @JsonKey() - final bool deviceLogs; - - @override - String toString() { - return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IntegrationTestAndroidOptionImpl && - (identical(other.browserstackUsername, browserstackUsername) || - other.browserstackUsername == browserstackUsername) && - (identical(other.browserstackAccessKey, browserstackAccessKey) || - other.browserstackAccessKey == browserstackAccessKey) && - (identical(other.apk, apk) || other.apk == apk) && - (identical(other.testSuite, testSuite) || - other.testSuite == testSuite) && - (identical(other.customId, customId) || - other.customId == customId) && - const DeepCollectionEquality().equals(other._devices, _devices) && - (identical(other.networkLogs, networkLogs) || - other.networkLogs == networkLogs) && - (identical(other.deviceLogs, deviceLogs) || - other.deviceLogs == deviceLogs)); - } - - @override - int get hashCode => Object.hash( - runtimeType, - browserstackUsername, - browserstackAccessKey, - apk, - testSuite, - customId, - const DeepCollectionEquality().hash(_devices), - networkLogs, - deviceLogs); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$IntegrationTestAndroidOptionImplCopyWith< - _$IntegrationTestAndroidOptionImpl> - get copyWith => __$$IntegrationTestAndroidOptionImplCopyWithImpl< - _$IntegrationTestAndroidOptionImpl>(this, _$identity); + +} +/// @nodoc +class __$IntegrationTestAndroidOptionCopyWithImpl<$Res> + implements _$IntegrationTestAndroidOptionCopyWith<$Res> { + __$IntegrationTestAndroidOptionCopyWithImpl(this._self, this._then); + + final _IntegrationTestAndroidOption _self; + final $Res Function(_IntegrationTestAndroidOption) _then; + +/// Create a copy of IntegrationTestAndroidOption +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? apk = null,Object? testSuite = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { + return _then(_IntegrationTestAndroidOption( +browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable +as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable +as String,apk: null == apk ? _self.apk : apk // ignore: cast_nullable_to_non_nullable +as File,testSuite: null == testSuite ? _self.testSuite : testSuite // ignore: cast_nullable_to_non_nullable +as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable +as String?,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable +as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable +as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable +as bool, + )); } -abstract class _IntegrationTestAndroidOption - extends IntegrationTestAndroidOption { - const factory _IntegrationTestAndroidOption( - {required final String browserstackUsername, - required final String browserstackAccessKey, - required final File apk, - required final File testSuite, - final String? customId, - required final List devices, - final bool networkLogs, - final bool deviceLogs}) = _$IntegrationTestAndroidOptionImpl; - const _IntegrationTestAndroidOption._() : super._(); - - @override - String get browserstackUsername; - @override - String get browserstackAccessKey; - @override - File get apk; - @override - File get testSuite; - @override - String? get customId; - @override - List get devices; - @override - bool get networkLogs; - @override - bool get deviceLogs; - @override - @JsonKey(ignore: true) - _$$IntegrationTestAndroidOptionImplCopyWith< - _$IntegrationTestAndroidOptionImpl> - get copyWith => throw _privateConstructorUsedError; + } + +// dart format on diff --git a/lib/src/integration_test/option/integration_test_ios_option.dart b/lib/src/integration_test/option/integration_test_ios_option.dart index 63baf30..512b818 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.dart @@ -24,15 +24,16 @@ class IntegrationTestIosOption with _$IntegrationTestIosOption { static Future fromArguments( List arguments, ) async { - final parser = ArgParser() - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) - ..addOption(IntegrationTestParameter.testPackagePathParam) - ..addOption( - IntegrationTestParameter.devicesParam, - defaultsTo: "iPhone 14 Plus-16", - ) - ..addOption(IntegrationTestParameter.customIdParam); + final parser = + ArgParser() + ..addOption(IntegrationTestParameter.browserstackUserParam) + ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) + ..addOption(IntegrationTestParameter.testPackagePathParam) + ..addOption( + IntegrationTestParameter.devicesParam, + defaultsTo: "iPhone 14 Plus-16", + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments); diff --git a/lib/src/integration_test/option/integration_test_ios_option.freezed.dart b/lib/src/integration_test/option/integration_test_ios_option.freezed.dart index 4532dbc..d29aa11 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.freezed.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,278 +10,157 @@ part of 'integration_test_ios_option.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - /// @nodoc mixin _$IntegrationTestIosOption { - String get browserstackUsername => throw _privateConstructorUsedError; - String get browserstackAccessKey => throw _privateConstructorUsedError; - File get testPackage => throw _privateConstructorUsedError; - String? get customId => throw _privateConstructorUsedError; - List get devices => throw _privateConstructorUsedError; - bool get networkLogs => throw _privateConstructorUsedError; - bool get deviceLogs => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $IntegrationTestIosOptionCopyWith get copyWith => - throw _privateConstructorUsedError; + + String get browserstackUsername; String get browserstackAccessKey; File get testPackage; String? get customId; List get devices; bool get networkLogs; bool get deviceLogs; +/// Create a copy of IntegrationTestIosOption +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IntegrationTestIosOptionCopyWith get copyWith => _$IntegrationTestIosOptionCopyWithImpl(this as IntegrationTestIosOption, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IntegrationTestIosOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.testPackage, testPackage) || other.testPackage == testPackage)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); } -/// @nodoc -abstract class $IntegrationTestIosOptionCopyWith<$Res> { - factory $IntegrationTestIosOptionCopyWith(IntegrationTestIosOption value, - $Res Function(IntegrationTestIosOption) then) = - _$IntegrationTestIosOptionCopyWithImpl<$Res, IntegrationTestIosOption>; - @useResult - $Res call( - {String browserstackUsername, - String browserstackAccessKey, - File testPackage, - String? customId, - List devices, - bool networkLogs, - bool deviceLogs}); + +@override +int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,testPackage,customId,const DeepCollectionEquality().hash(devices),networkLogs,deviceLogs); + +@override +String toString() { + return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; } -/// @nodoc -class _$IntegrationTestIosOptionCopyWithImpl<$Res, - $Val extends IntegrationTestIosOption> - implements $IntegrationTestIosOptionCopyWith<$Res> { - _$IntegrationTestIosOptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? browserstackUsername = null, - Object? browserstackAccessKey = null, - Object? testPackage = null, - Object? customId = freezed, - Object? devices = null, - Object? networkLogs = null, - Object? deviceLogs = null, - }) { - return _then(_value.copyWith( - browserstackUsername: null == browserstackUsername - ? _value.browserstackUsername - : browserstackUsername // ignore: cast_nullable_to_non_nullable - as String, - browserstackAccessKey: null == browserstackAccessKey - ? _value.browserstackAccessKey - : browserstackAccessKey // ignore: cast_nullable_to_non_nullable - as String, - testPackage: null == testPackage - ? _value.testPackage - : testPackage // ignore: cast_nullable_to_non_nullable - as File, - customId: freezed == customId - ? _value.customId - : customId // ignore: cast_nullable_to_non_nullable - as String?, - devices: null == devices - ? _value.devices - : devices // ignore: cast_nullable_to_non_nullable - as List, - networkLogs: null == networkLogs - ? _value.networkLogs - : networkLogs // ignore: cast_nullable_to_non_nullable - as bool, - deviceLogs: null == deviceLogs - ? _value.deviceLogs - : deviceLogs // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } + } /// @nodoc -abstract class _$$IntegrationTestIosOptionImplCopyWith<$Res> +abstract mixin class $IntegrationTestIosOptionCopyWith<$Res> { + factory $IntegrationTestIosOptionCopyWith(IntegrationTestIosOption value, $Res Function(IntegrationTestIosOption) _then) = _$IntegrationTestIosOptionCopyWithImpl; +@useResult +$Res call({ + String browserstackUsername, String browserstackAccessKey, File testPackage, String? customId, List devices, bool networkLogs, bool deviceLogs +}); + + + + +} +/// @nodoc +class _$IntegrationTestIosOptionCopyWithImpl<$Res> implements $IntegrationTestIosOptionCopyWith<$Res> { - factory _$$IntegrationTestIosOptionImplCopyWith( - _$IntegrationTestIosOptionImpl value, - $Res Function(_$IntegrationTestIosOptionImpl) then) = - __$$IntegrationTestIosOptionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String browserstackUsername, - String browserstackAccessKey, - File testPackage, - String? customId, - List devices, - bool networkLogs, - bool deviceLogs}); + _$IntegrationTestIosOptionCopyWithImpl(this._self, this._then); + + final IntegrationTestIosOption _self; + final $Res Function(IntegrationTestIosOption) _then; + +/// Create a copy of IntegrationTestIosOption +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? testPackage = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { + return _then(_self.copyWith( +browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable +as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable +as String,testPackage: null == testPackage ? _self.testPackage : testPackage // ignore: cast_nullable_to_non_nullable +as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable +as String?,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable +as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable +as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + } + /// @nodoc -class __$$IntegrationTestIosOptionImplCopyWithImpl<$Res> - extends _$IntegrationTestIosOptionCopyWithImpl<$Res, - _$IntegrationTestIosOptionImpl> - implements _$$IntegrationTestIosOptionImplCopyWith<$Res> { - __$$IntegrationTestIosOptionImplCopyWithImpl( - _$IntegrationTestIosOptionImpl _value, - $Res Function(_$IntegrationTestIosOptionImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? browserstackUsername = null, - Object? browserstackAccessKey = null, - Object? testPackage = null, - Object? customId = freezed, - Object? devices = null, - Object? networkLogs = null, - Object? deviceLogs = null, - }) { - return _then(_$IntegrationTestIosOptionImpl( - browserstackUsername: null == browserstackUsername - ? _value.browserstackUsername - : browserstackUsername // ignore: cast_nullable_to_non_nullable - as String, - browserstackAccessKey: null == browserstackAccessKey - ? _value.browserstackAccessKey - : browserstackAccessKey // ignore: cast_nullable_to_non_nullable - as String, - testPackage: null == testPackage - ? _value.testPackage - : testPackage // ignore: cast_nullable_to_non_nullable - as File, - customId: freezed == customId - ? _value.customId - : customId // ignore: cast_nullable_to_non_nullable - as String?, - devices: null == devices - ? _value._devices - : devices // ignore: cast_nullable_to_non_nullable - as List, - networkLogs: null == networkLogs - ? _value.networkLogs - : networkLogs // ignore: cast_nullable_to_non_nullable - as bool, - deviceLogs: null == deviceLogs - ? _value.deviceLogs - : deviceLogs // ignore: cast_nullable_to_non_nullable - as bool, - )); - } + + +class _IntegrationTestIosOption extends IntegrationTestIosOption { + const _IntegrationTestIosOption({required this.browserstackUsername, required this.browserstackAccessKey, required this.testPackage, this.customId, required final List devices, this.networkLogs = true, this.deviceLogs = true}): _devices = devices,super._(); + + +@override final String browserstackUsername; +@override final String browserstackAccessKey; +@override final File testPackage; +@override final String? customId; + final List _devices; +@override List get devices { + if (_devices is EqualUnmodifiableListView) return _devices; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_devices); +} + +@override@JsonKey() final bool networkLogs; +@override@JsonKey() final bool deviceLogs; + +/// Create a copy of IntegrationTestIosOption +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IntegrationTestIosOptionCopyWith<_IntegrationTestIosOption> get copyWith => __$IntegrationTestIosOptionCopyWithImpl<_IntegrationTestIosOption>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntegrationTestIosOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.testPackage, testPackage) || other.testPackage == testPackage)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); +} + + +@override +int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,testPackage,customId,const DeepCollectionEquality().hash(_devices),networkLogs,deviceLogs); + +@override +String toString() { + return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; +} + + } /// @nodoc +abstract mixin class _$IntegrationTestIosOptionCopyWith<$Res> implements $IntegrationTestIosOptionCopyWith<$Res> { + factory _$IntegrationTestIosOptionCopyWith(_IntegrationTestIosOption value, $Res Function(_IntegrationTestIosOption) _then) = __$IntegrationTestIosOptionCopyWithImpl; +@override @useResult +$Res call({ + String browserstackUsername, String browserstackAccessKey, File testPackage, String? customId, List devices, bool networkLogs, bool deviceLogs +}); + + -class _$IntegrationTestIosOptionImpl extends _IntegrationTestIosOption { - const _$IntegrationTestIosOptionImpl( - {required this.browserstackUsername, - required this.browserstackAccessKey, - required this.testPackage, - this.customId, - required final List devices, - this.networkLogs = true, - this.deviceLogs = true}) - : _devices = devices, - super._(); - - @override - final String browserstackUsername; - @override - final String browserstackAccessKey; - @override - final File testPackage; - @override - final String? customId; - final List _devices; - @override - List get devices { - if (_devices is EqualUnmodifiableListView) return _devices; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_devices); - } - - @override - @JsonKey() - final bool networkLogs; - @override - @JsonKey() - final bool deviceLogs; - - @override - String toString() { - return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IntegrationTestIosOptionImpl && - (identical(other.browserstackUsername, browserstackUsername) || - other.browserstackUsername == browserstackUsername) && - (identical(other.browserstackAccessKey, browserstackAccessKey) || - other.browserstackAccessKey == browserstackAccessKey) && - (identical(other.testPackage, testPackage) || - other.testPackage == testPackage) && - (identical(other.customId, customId) || - other.customId == customId) && - const DeepCollectionEquality().equals(other._devices, _devices) && - (identical(other.networkLogs, networkLogs) || - other.networkLogs == networkLogs) && - (identical(other.deviceLogs, deviceLogs) || - other.deviceLogs == deviceLogs)); - } - - @override - int get hashCode => Object.hash( - runtimeType, - browserstackUsername, - browserstackAccessKey, - testPackage, - customId, - const DeepCollectionEquality().hash(_devices), - networkLogs, - deviceLogs); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$IntegrationTestIosOptionImplCopyWith<_$IntegrationTestIosOptionImpl> - get copyWith => __$$IntegrationTestIosOptionImplCopyWithImpl< - _$IntegrationTestIosOptionImpl>(this, _$identity); + +} +/// @nodoc +class __$IntegrationTestIosOptionCopyWithImpl<$Res> + implements _$IntegrationTestIosOptionCopyWith<$Res> { + __$IntegrationTestIosOptionCopyWithImpl(this._self, this._then); + + final _IntegrationTestIosOption _self; + final $Res Function(_IntegrationTestIosOption) _then; + +/// Create a copy of IntegrationTestIosOption +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? testPackage = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { + return _then(_IntegrationTestIosOption( +browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable +as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable +as String,testPackage: null == testPackage ? _self.testPackage : testPackage // ignore: cast_nullable_to_non_nullable +as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable +as String?,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable +as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable +as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable +as bool, + )); } -abstract class _IntegrationTestIosOption extends IntegrationTestIosOption { - const factory _IntegrationTestIosOption( - {required final String browserstackUsername, - required final String browserstackAccessKey, - required final File testPackage, - final String? customId, - required final List devices, - final bool networkLogs, - final bool deviceLogs}) = _$IntegrationTestIosOptionImpl; - const _IntegrationTestIosOption._() : super._(); - - @override - String get browserstackUsername; - @override - String get browserstackAccessKey; - @override - File get testPackage; - @override - String? get customId; - @override - List get devices; - @override - bool get networkLogs; - @override - bool get deviceLogs; - @override - @JsonKey(ignore: true) - _$$IntegrationTestIosOptionImplCopyWith<_$IntegrationTestIosOptionImpl> - get copyWith => throw _privateConstructorUsedError; + } + +// dart format on diff --git a/lib/src/integration_test/option/integration_test_parameter.dart b/lib/src/integration_test/option/integration_test_parameter.dart index 04cdcb3..cff018d 100644 --- a/lib/src/integration_test/option/integration_test_parameter.dart +++ b/lib/src/integration_test/option/integration_test_parameter.dart @@ -16,5 +16,5 @@ class IntegrationTestParameter { static const String devicesParam = "devices"; -// endregion + // endregion } diff --git a/lib/src/integration_test/run_android_integration_test.dart b/lib/src/integration_test/run_android_integration_test.dart index c0e1302..21813c3 100644 --- a/lib/src/integration_test/run_android_integration_test.dart +++ b/lib/src/integration_test/run_android_integration_test.dart @@ -21,9 +21,7 @@ Future runAndroidIntegrationTest(List arguments) async { file: option.testSuite, url: "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/android/test-suite", - fields: { - if (option.customId != null) "custom_id": option.customId!, - }, + fields: {if (option.customId != null) "custom_id": option.customId!}, ); final testSuiteUrl = uploadTestSuiteResponse.getRequiredKey("test_suite_url"); diff --git a/lib/src/integration_test/run_ios_integration_test.dart b/lib/src/integration_test/run_ios_integration_test.dart index 3e21aff..8111c38 100644 --- a/lib/src/integration_test/run_ios_integration_test.dart +++ b/lib/src/integration_test/run_ios_integration_test.dart @@ -12,9 +12,7 @@ Future runIosIntegrationTest(List arguments) async { "https://api-cloud.browserstack.com/app-automate/flutter-integration-tests/v2/ios/test-package", file: option.testPackage, basicAuthHeader: option.basicAuthValue, - fields: { - if (option.customId != null) "custom_id": option.customId!, - }, + fields: {if (option.customId != null) "custom_id": option.customId!}, ); final testPackageUrl = uploadPackageResult.getRequiredKey("test_package_url"); diff --git a/lib/tapped_test_toolkit.dart b/lib/tapped_test_toolkit.dart index a85ed19..7745ebc 100644 --- a/lib/tapped_test_toolkit.dart +++ b/lib/tapped_test_toolkit.dart @@ -1,4 +1,4 @@ -library tapped_test_toolkit; +library; export 'src/integration_test/browser_stack_api.dart'; export 'src/integration_test/browser_stack_test_status.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index e0f396d..92ddf4d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,22 +4,22 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=2.18.4 <3.0.0" + sdk: ">=3.7.0 <4.0.0" flutter: ">=3.16.0" dependencies: - args: ^2.5.0 - http: ^1.2.1 - freezed_annotation: ^2.4.1 + args: ^2.6.0 + http: ^1.3.0 + freezed_annotation: ^3.0.0 json_annotation: ^4.9.0 - path: ^1.9.0 + path: ^1.9.1 # formatting the time of some jobs intl: ^0.19.0 dev_dependencies: - build_runner: ^2.4.11 - flutter_lints: ^4.0.0 - freezed: ^2.5.2 + build_runner: ^2.4.15 + flutter_lints: ^5.0.0 + freezed: ^3.0.3 tapped_lints: git: url: https://github.com/tappeddev/tapped_lints.git From 727f2d4b6641fba0edc839b00b77c0398faa2652 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 08:49:07 +0100 Subject: [PATCH 2/6] fix abstract classes --- .../option/integration_test_android_option.dart | 3 ++- .../integration_test/option/integration_test_ios_option.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/integration_test/option/integration_test_android_option.dart b/lib/src/integration_test/option/integration_test_android_option.dart index 5afae99..bec6026 100644 --- a/lib/src/integration_test/option/integration_test_android_option.dart +++ b/lib/src/integration_test/option/integration_test_android_option.dart @@ -9,7 +9,8 @@ import 'package:tapped_test_toolkit/src/integration_test/option/integration_test part 'integration_test_android_option.freezed.dart'; @freezed -class IntegrationTestAndroidOption with _$IntegrationTestAndroidOption { +abstract class IntegrationTestAndroidOption + with _$IntegrationTestAndroidOption { const IntegrationTestAndroidOption._(); const factory IntegrationTestAndroidOption({ diff --git a/lib/src/integration_test/option/integration_test_ios_option.dart b/lib/src/integration_test/option/integration_test_ios_option.dart index 512b818..69d63e5 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.dart @@ -8,7 +8,7 @@ import 'package:tapped_test_toolkit/src/integration_test/option/integration_test part 'integration_test_ios_option.freezed.dart'; @freezed -class IntegrationTestIosOption with _$IntegrationTestIosOption { +abstract class IntegrationTestIosOption with _$IntegrationTestIosOption { const IntegrationTestIosOption._(); const factory IntegrationTestIosOption({ From 5e2179f504f875fc27f5e633e32f37903c7a1ae4 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 09:19:46 +0100 Subject: [PATCH 3/6] downgrade version --- .fvmrc | 2 +- pubspec.yaml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.fvmrc b/.fvmrc index c0edbf9..69d6f3c 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.29.0" + "flutter": "3.27.4" } diff --git a/pubspec.yaml b/pubspec.yaml index 92ddf4d..c05c7f9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,13 +4,13 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.7.0 <4.0.0" + sdk: ">=3.6.2 <4.0.0" flutter: ">=3.16.0" dependencies: args: ^2.6.0 http: ^1.3.0 - freezed_annotation: ^3.0.0 + freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 path: ^1.9.1 # formatting the time of some jobs @@ -19,10 +19,8 @@ dependencies: dev_dependencies: build_runner: ^2.4.15 flutter_lints: ^5.0.0 - freezed: ^3.0.3 + freezed: ^2.5.8 tapped_lints: git: url: https://github.com/tappeddev/tapped_lints.git ref: master - -flutter: From 1c36004a99f79a23696b5bb6b7d28989e8c80147 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 09:38:22 +0100 Subject: [PATCH 4/6] downgrade version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index c05c7f9..1aaa70d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: http: ^1.3.0 freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 - path: ^1.9.1 + path: ^1.9.0 # formatting the time of some jobs intl: ^0.19.0 From dfe02fb956cbb2d20f1b59a4e87b05aafee302a3 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 09:39:21 +0100 Subject: [PATCH 5/6] regen build runner --- ...tegration_test_android_option.freezed.dart | 428 ++++++++++++------ .../integration_test_ios_option.freezed.dart | 399 ++++++++++------ 2 files changed, 556 insertions(+), 271 deletions(-) diff --git a/lib/src/integration_test/option/integration_test_android_option.freezed.dart b/lib/src/integration_test/option/integration_test_android_option.freezed.dart index 66bae7b..4588fc8 100644 --- a/lib/src/integration_test/option/integration_test_android_option.freezed.dart +++ b/lib/src/integration_test/option/integration_test_android_option.freezed.dart @@ -1,4 +1,3 @@ -// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -10,160 +9,315 @@ part of 'integration_test_android_option.dart'; // FreezedGenerator // ************************************************************************** -// dart format off T _$identity(T value) => value; -/// @nodoc -mixin _$IntegrationTestAndroidOption { - - String get browserstackUsername; String get browserstackAccessKey; File get apk; File get testSuite; String? get customId; List get devices; bool get networkLogs; bool get deviceLogs; -/// Create a copy of IntegrationTestAndroidOption -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$IntegrationTestAndroidOptionCopyWith get copyWith => _$IntegrationTestAndroidOptionCopyWithImpl(this as IntegrationTestAndroidOption, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is IntegrationTestAndroidOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.apk, apk) || other.apk == apk)&&(identical(other.testSuite, testSuite) || other.testSuite == testSuite)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); -} - - -@override -int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,apk,testSuite,customId,const DeepCollectionEquality().hash(devices),networkLogs,deviceLogs); - -@override -String toString() { - return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; -} +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$IntegrationTestAndroidOption { + String get browserstackUsername => throw _privateConstructorUsedError; + String get browserstackAccessKey => throw _privateConstructorUsedError; + File get apk => throw _privateConstructorUsedError; + File get testSuite => throw _privateConstructorUsedError; + String? get customId => throw _privateConstructorUsedError; + List get devices => throw _privateConstructorUsedError; + bool get networkLogs => throw _privateConstructorUsedError; + bool get deviceLogs => throw _privateConstructorUsedError; + + /// Create a copy of IntegrationTestAndroidOption + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $IntegrationTestAndroidOptionCopyWith + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $IntegrationTestAndroidOptionCopyWith<$Res> { - factory $IntegrationTestAndroidOptionCopyWith(IntegrationTestAndroidOption value, $Res Function(IntegrationTestAndroidOption) _then) = _$IntegrationTestAndroidOptionCopyWithImpl; -@useResult -$Res call({ - String browserstackUsername, String browserstackAccessKey, File apk, File testSuite, String? customId, List devices, bool networkLogs, bool deviceLogs -}); - - - - +abstract class $IntegrationTestAndroidOptionCopyWith<$Res> { + factory $IntegrationTestAndroidOptionCopyWith( + IntegrationTestAndroidOption value, + $Res Function(IntegrationTestAndroidOption) then) = + _$IntegrationTestAndroidOptionCopyWithImpl<$Res, + IntegrationTestAndroidOption>; + @useResult + $Res call( + {String browserstackUsername, + String browserstackAccessKey, + File apk, + File testSuite, + String? customId, + List devices, + bool networkLogs, + bool deviceLogs}); } + /// @nodoc -class _$IntegrationTestAndroidOptionCopyWithImpl<$Res> +class _$IntegrationTestAndroidOptionCopyWithImpl<$Res, + $Val extends IntegrationTestAndroidOption> implements $IntegrationTestAndroidOptionCopyWith<$Res> { - _$IntegrationTestAndroidOptionCopyWithImpl(this._self, this._then); - - final IntegrationTestAndroidOption _self; - final $Res Function(IntegrationTestAndroidOption) _then; - -/// Create a copy of IntegrationTestAndroidOption -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? apk = null,Object? testSuite = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { - return _then(_self.copyWith( -browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable -as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable -as String,apk: null == apk ? _self.apk : apk // ignore: cast_nullable_to_non_nullable -as File,testSuite: null == testSuite ? _self.testSuite : testSuite // ignore: cast_nullable_to_non_nullable -as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable -as String?,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable -as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable -as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - + _$IntegrationTestAndroidOptionCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of IntegrationTestAndroidOption + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? browserstackUsername = null, + Object? browserstackAccessKey = null, + Object? apk = null, + Object? testSuite = null, + Object? customId = freezed, + Object? devices = null, + Object? networkLogs = null, + Object? deviceLogs = null, + }) { + return _then(_value.copyWith( + browserstackUsername: null == browserstackUsername + ? _value.browserstackUsername + : browserstackUsername // ignore: cast_nullable_to_non_nullable + as String, + browserstackAccessKey: null == browserstackAccessKey + ? _value.browserstackAccessKey + : browserstackAccessKey // ignore: cast_nullable_to_non_nullable + as String, + apk: null == apk + ? _value.apk + : apk // ignore: cast_nullable_to_non_nullable + as File, + testSuite: null == testSuite + ? _value.testSuite + : testSuite // ignore: cast_nullable_to_non_nullable + as File, + customId: freezed == customId + ? _value.customId + : customId // ignore: cast_nullable_to_non_nullable + as String?, + devices: null == devices + ? _value.devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + networkLogs: null == networkLogs + ? _value.networkLogs + : networkLogs // ignore: cast_nullable_to_non_nullable + as bool, + deviceLogs: null == deviceLogs + ? _value.deviceLogs + : deviceLogs // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } } - /// @nodoc - - -class _IntegrationTestAndroidOption extends IntegrationTestAndroidOption { - const _IntegrationTestAndroidOption({required this.browserstackUsername, required this.browserstackAccessKey, required this.apk, required this.testSuite, this.customId, required final List devices, this.networkLogs = true, this.deviceLogs = true}): _devices = devices,super._(); - - -@override final String browserstackUsername; -@override final String browserstackAccessKey; -@override final File apk; -@override final File testSuite; -@override final String? customId; - final List _devices; -@override List get devices { - if (_devices is EqualUnmodifiableListView) return _devices; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_devices); -} - -@override@JsonKey() final bool networkLogs; -@override@JsonKey() final bool deviceLogs; - -/// Create a copy of IntegrationTestAndroidOption -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$IntegrationTestAndroidOptionCopyWith<_IntegrationTestAndroidOption> get copyWith => __$IntegrationTestAndroidOptionCopyWithImpl<_IntegrationTestAndroidOption>(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntegrationTestAndroidOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.apk, apk) || other.apk == apk)&&(identical(other.testSuite, testSuite) || other.testSuite == testSuite)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); -} - - -@override -int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,apk,testSuite,customId,const DeepCollectionEquality().hash(_devices),networkLogs,deviceLogs); - -@override -String toString() { - return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; +abstract class _$$IntegrationTestAndroidOptionImplCopyWith<$Res> + implements $IntegrationTestAndroidOptionCopyWith<$Res> { + factory _$$IntegrationTestAndroidOptionImplCopyWith( + _$IntegrationTestAndroidOptionImpl value, + $Res Function(_$IntegrationTestAndroidOptionImpl) then) = + __$$IntegrationTestAndroidOptionImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String browserstackUsername, + String browserstackAccessKey, + File apk, + File testSuite, + String? customId, + List devices, + bool networkLogs, + bool deviceLogs}); } - +/// @nodoc +class __$$IntegrationTestAndroidOptionImplCopyWithImpl<$Res> + extends _$IntegrationTestAndroidOptionCopyWithImpl<$Res, + _$IntegrationTestAndroidOptionImpl> + implements _$$IntegrationTestAndroidOptionImplCopyWith<$Res> { + __$$IntegrationTestAndroidOptionImplCopyWithImpl( + _$IntegrationTestAndroidOptionImpl _value, + $Res Function(_$IntegrationTestAndroidOptionImpl) _then) + : super(_value, _then); + + /// Create a copy of IntegrationTestAndroidOption + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? browserstackUsername = null, + Object? browserstackAccessKey = null, + Object? apk = null, + Object? testSuite = null, + Object? customId = freezed, + Object? devices = null, + Object? networkLogs = null, + Object? deviceLogs = null, + }) { + return _then(_$IntegrationTestAndroidOptionImpl( + browserstackUsername: null == browserstackUsername + ? _value.browserstackUsername + : browserstackUsername // ignore: cast_nullable_to_non_nullable + as String, + browserstackAccessKey: null == browserstackAccessKey + ? _value.browserstackAccessKey + : browserstackAccessKey // ignore: cast_nullable_to_non_nullable + as String, + apk: null == apk + ? _value.apk + : apk // ignore: cast_nullable_to_non_nullable + as File, + testSuite: null == testSuite + ? _value.testSuite + : testSuite // ignore: cast_nullable_to_non_nullable + as File, + customId: freezed == customId + ? _value.customId + : customId // ignore: cast_nullable_to_non_nullable + as String?, + devices: null == devices + ? _value._devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + networkLogs: null == networkLogs + ? _value.networkLogs + : networkLogs // ignore: cast_nullable_to_non_nullable + as bool, + deviceLogs: null == deviceLogs + ? _value.deviceLogs + : deviceLogs // ignore: cast_nullable_to_non_nullable + as bool, + )); + } } /// @nodoc -abstract mixin class _$IntegrationTestAndroidOptionCopyWith<$Res> implements $IntegrationTestAndroidOptionCopyWith<$Res> { - factory _$IntegrationTestAndroidOptionCopyWith(_IntegrationTestAndroidOption value, $Res Function(_IntegrationTestAndroidOption) _then) = __$IntegrationTestAndroidOptionCopyWithImpl; -@override @useResult -$Res call({ - String browserstackUsername, String browserstackAccessKey, File apk, File testSuite, String? customId, List devices, bool networkLogs, bool deviceLogs -}); - - - -} -/// @nodoc -class __$IntegrationTestAndroidOptionCopyWithImpl<$Res> - implements _$IntegrationTestAndroidOptionCopyWith<$Res> { - __$IntegrationTestAndroidOptionCopyWithImpl(this._self, this._then); - - final _IntegrationTestAndroidOption _self; - final $Res Function(_IntegrationTestAndroidOption) _then; - -/// Create a copy of IntegrationTestAndroidOption -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? apk = null,Object? testSuite = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { - return _then(_IntegrationTestAndroidOption( -browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable -as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable -as String,apk: null == apk ? _self.apk : apk // ignore: cast_nullable_to_non_nullable -as File,testSuite: null == testSuite ? _self.testSuite : testSuite // ignore: cast_nullable_to_non_nullable -as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable -as String?,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable -as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable -as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable -as bool, - )); +class _$IntegrationTestAndroidOptionImpl extends _IntegrationTestAndroidOption { + const _$IntegrationTestAndroidOptionImpl( + {required this.browserstackUsername, + required this.browserstackAccessKey, + required this.apk, + required this.testSuite, + this.customId, + required final List devices, + this.networkLogs = true, + this.deviceLogs = true}) + : _devices = devices, + super._(); + + @override + final String browserstackUsername; + @override + final String browserstackAccessKey; + @override + final File apk; + @override + final File testSuite; + @override + final String? customId; + final List _devices; + @override + List get devices { + if (_devices is EqualUnmodifiableListView) return _devices; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_devices); + } + + @override + @JsonKey() + final bool networkLogs; + @override + @JsonKey() + final bool deviceLogs; + + @override + String toString() { + return 'IntegrationTestAndroidOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, apk: $apk, testSuite: $testSuite, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$IntegrationTestAndroidOptionImpl && + (identical(other.browserstackUsername, browserstackUsername) || + other.browserstackUsername == browserstackUsername) && + (identical(other.browserstackAccessKey, browserstackAccessKey) || + other.browserstackAccessKey == browserstackAccessKey) && + (identical(other.apk, apk) || other.apk == apk) && + (identical(other.testSuite, testSuite) || + other.testSuite == testSuite) && + (identical(other.customId, customId) || + other.customId == customId) && + const DeepCollectionEquality().equals(other._devices, _devices) && + (identical(other.networkLogs, networkLogs) || + other.networkLogs == networkLogs) && + (identical(other.deviceLogs, deviceLogs) || + other.deviceLogs == deviceLogs)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + browserstackUsername, + browserstackAccessKey, + apk, + testSuite, + customId, + const DeepCollectionEquality().hash(_devices), + networkLogs, + deviceLogs); + + /// Create a copy of IntegrationTestAndroidOption + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$IntegrationTestAndroidOptionImplCopyWith< + _$IntegrationTestAndroidOptionImpl> + get copyWith => __$$IntegrationTestAndroidOptionImplCopyWithImpl< + _$IntegrationTestAndroidOptionImpl>(this, _$identity); } - +abstract class _IntegrationTestAndroidOption + extends IntegrationTestAndroidOption { + const factory _IntegrationTestAndroidOption( + {required final String browserstackUsername, + required final String browserstackAccessKey, + required final File apk, + required final File testSuite, + final String? customId, + required final List devices, + final bool networkLogs, + final bool deviceLogs}) = _$IntegrationTestAndroidOptionImpl; + const _IntegrationTestAndroidOption._() : super._(); + + @override + String get browserstackUsername; + @override + String get browserstackAccessKey; + @override + File get apk; + @override + File get testSuite; + @override + String? get customId; + @override + List get devices; + @override + bool get networkLogs; + @override + bool get deviceLogs; + + /// Create a copy of IntegrationTestAndroidOption + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$IntegrationTestAndroidOptionImplCopyWith< + _$IntegrationTestAndroidOptionImpl> + get copyWith => throw _privateConstructorUsedError; } - -// dart format on diff --git a/lib/src/integration_test/option/integration_test_ios_option.freezed.dart b/lib/src/integration_test/option/integration_test_ios_option.freezed.dart index d29aa11..f797d82 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.freezed.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.freezed.dart @@ -1,4 +1,3 @@ -// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -10,157 +9,289 @@ part of 'integration_test_ios_option.dart'; // FreezedGenerator // ************************************************************************** -// dart format off T _$identity(T value) => value; -/// @nodoc -mixin _$IntegrationTestIosOption { - - String get browserstackUsername; String get browserstackAccessKey; File get testPackage; String? get customId; List get devices; bool get networkLogs; bool get deviceLogs; -/// Create a copy of IntegrationTestIosOption -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$IntegrationTestIosOptionCopyWith get copyWith => _$IntegrationTestIosOptionCopyWithImpl(this as IntegrationTestIosOption, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is IntegrationTestIosOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.testPackage, testPackage) || other.testPackage == testPackage)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); -} - - -@override -int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,testPackage,customId,const DeepCollectionEquality().hash(devices),networkLogs,deviceLogs); - -@override -String toString() { - return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; -} +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$IntegrationTestIosOption { + String get browserstackUsername => throw _privateConstructorUsedError; + String get browserstackAccessKey => throw _privateConstructorUsedError; + File get testPackage => throw _privateConstructorUsedError; + String? get customId => throw _privateConstructorUsedError; + List get devices => throw _privateConstructorUsedError; + bool get networkLogs => throw _privateConstructorUsedError; + bool get deviceLogs => throw _privateConstructorUsedError; + + /// Create a copy of IntegrationTestIosOption + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $IntegrationTestIosOptionCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $IntegrationTestIosOptionCopyWith<$Res> { - factory $IntegrationTestIosOptionCopyWith(IntegrationTestIosOption value, $Res Function(IntegrationTestIosOption) _then) = _$IntegrationTestIosOptionCopyWithImpl; -@useResult -$Res call({ - String browserstackUsername, String browserstackAccessKey, File testPackage, String? customId, List devices, bool networkLogs, bool deviceLogs -}); - - - - +abstract class $IntegrationTestIosOptionCopyWith<$Res> { + factory $IntegrationTestIosOptionCopyWith(IntegrationTestIosOption value, + $Res Function(IntegrationTestIosOption) then) = + _$IntegrationTestIosOptionCopyWithImpl<$Res, IntegrationTestIosOption>; + @useResult + $Res call( + {String browserstackUsername, + String browserstackAccessKey, + File testPackage, + String? customId, + List devices, + bool networkLogs, + bool deviceLogs}); } + /// @nodoc -class _$IntegrationTestIosOptionCopyWithImpl<$Res> +class _$IntegrationTestIosOptionCopyWithImpl<$Res, + $Val extends IntegrationTestIosOption> implements $IntegrationTestIosOptionCopyWith<$Res> { - _$IntegrationTestIosOptionCopyWithImpl(this._self, this._then); - - final IntegrationTestIosOption _self; - final $Res Function(IntegrationTestIosOption) _then; - -/// Create a copy of IntegrationTestIosOption -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? testPackage = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { - return _then(_self.copyWith( -browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable -as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable -as String,testPackage: null == testPackage ? _self.testPackage : testPackage // ignore: cast_nullable_to_non_nullable -as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable -as String?,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable -as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable -as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - + _$IntegrationTestIosOptionCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of IntegrationTestIosOption + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? browserstackUsername = null, + Object? browserstackAccessKey = null, + Object? testPackage = null, + Object? customId = freezed, + Object? devices = null, + Object? networkLogs = null, + Object? deviceLogs = null, + }) { + return _then(_value.copyWith( + browserstackUsername: null == browserstackUsername + ? _value.browserstackUsername + : browserstackUsername // ignore: cast_nullable_to_non_nullable + as String, + browserstackAccessKey: null == browserstackAccessKey + ? _value.browserstackAccessKey + : browserstackAccessKey // ignore: cast_nullable_to_non_nullable + as String, + testPackage: null == testPackage + ? _value.testPackage + : testPackage // ignore: cast_nullable_to_non_nullable + as File, + customId: freezed == customId + ? _value.customId + : customId // ignore: cast_nullable_to_non_nullable + as String?, + devices: null == devices + ? _value.devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + networkLogs: null == networkLogs + ? _value.networkLogs + : networkLogs // ignore: cast_nullable_to_non_nullable + as bool, + deviceLogs: null == deviceLogs + ? _value.deviceLogs + : deviceLogs // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } } - /// @nodoc - - -class _IntegrationTestIosOption extends IntegrationTestIosOption { - const _IntegrationTestIosOption({required this.browserstackUsername, required this.browserstackAccessKey, required this.testPackage, this.customId, required final List devices, this.networkLogs = true, this.deviceLogs = true}): _devices = devices,super._(); - - -@override final String browserstackUsername; -@override final String browserstackAccessKey; -@override final File testPackage; -@override final String? customId; - final List _devices; -@override List get devices { - if (_devices is EqualUnmodifiableListView) return _devices; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_devices); -} - -@override@JsonKey() final bool networkLogs; -@override@JsonKey() final bool deviceLogs; - -/// Create a copy of IntegrationTestIosOption -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$IntegrationTestIosOptionCopyWith<_IntegrationTestIosOption> get copyWith => __$IntegrationTestIosOptionCopyWithImpl<_IntegrationTestIosOption>(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntegrationTestIosOption&&(identical(other.browserstackUsername, browserstackUsername) || other.browserstackUsername == browserstackUsername)&&(identical(other.browserstackAccessKey, browserstackAccessKey) || other.browserstackAccessKey == browserstackAccessKey)&&(identical(other.testPackage, testPackage) || other.testPackage == testPackage)&&(identical(other.customId, customId) || other.customId == customId)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.networkLogs, networkLogs) || other.networkLogs == networkLogs)&&(identical(other.deviceLogs, deviceLogs) || other.deviceLogs == deviceLogs)); -} - - -@override -int get hashCode => Object.hash(runtimeType,browserstackUsername,browserstackAccessKey,testPackage,customId,const DeepCollectionEquality().hash(_devices),networkLogs,deviceLogs); - -@override -String toString() { - return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; +abstract class _$$IntegrationTestIosOptionImplCopyWith<$Res> + implements $IntegrationTestIosOptionCopyWith<$Res> { + factory _$$IntegrationTestIosOptionImplCopyWith( + _$IntegrationTestIosOptionImpl value, + $Res Function(_$IntegrationTestIosOptionImpl) then) = + __$$IntegrationTestIosOptionImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String browserstackUsername, + String browserstackAccessKey, + File testPackage, + String? customId, + List devices, + bool networkLogs, + bool deviceLogs}); } - +/// @nodoc +class __$$IntegrationTestIosOptionImplCopyWithImpl<$Res> + extends _$IntegrationTestIosOptionCopyWithImpl<$Res, + _$IntegrationTestIosOptionImpl> + implements _$$IntegrationTestIosOptionImplCopyWith<$Res> { + __$$IntegrationTestIosOptionImplCopyWithImpl( + _$IntegrationTestIosOptionImpl _value, + $Res Function(_$IntegrationTestIosOptionImpl) _then) + : super(_value, _then); + + /// Create a copy of IntegrationTestIosOption + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? browserstackUsername = null, + Object? browserstackAccessKey = null, + Object? testPackage = null, + Object? customId = freezed, + Object? devices = null, + Object? networkLogs = null, + Object? deviceLogs = null, + }) { + return _then(_$IntegrationTestIosOptionImpl( + browserstackUsername: null == browserstackUsername + ? _value.browserstackUsername + : browserstackUsername // ignore: cast_nullable_to_non_nullable + as String, + browserstackAccessKey: null == browserstackAccessKey + ? _value.browserstackAccessKey + : browserstackAccessKey // ignore: cast_nullable_to_non_nullable + as String, + testPackage: null == testPackage + ? _value.testPackage + : testPackage // ignore: cast_nullable_to_non_nullable + as File, + customId: freezed == customId + ? _value.customId + : customId // ignore: cast_nullable_to_non_nullable + as String?, + devices: null == devices + ? _value._devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + networkLogs: null == networkLogs + ? _value.networkLogs + : networkLogs // ignore: cast_nullable_to_non_nullable + as bool, + deviceLogs: null == deviceLogs + ? _value.deviceLogs + : deviceLogs // ignore: cast_nullable_to_non_nullable + as bool, + )); + } } /// @nodoc -abstract mixin class _$IntegrationTestIosOptionCopyWith<$Res> implements $IntegrationTestIosOptionCopyWith<$Res> { - factory _$IntegrationTestIosOptionCopyWith(_IntegrationTestIosOption value, $Res Function(_IntegrationTestIosOption) _then) = __$IntegrationTestIosOptionCopyWithImpl; -@override @useResult -$Res call({ - String browserstackUsername, String browserstackAccessKey, File testPackage, String? customId, List devices, bool networkLogs, bool deviceLogs -}); - - - -} -/// @nodoc -class __$IntegrationTestIosOptionCopyWithImpl<$Res> - implements _$IntegrationTestIosOptionCopyWith<$Res> { - __$IntegrationTestIosOptionCopyWithImpl(this._self, this._then); - - final _IntegrationTestIosOption _self; - final $Res Function(_IntegrationTestIosOption) _then; - -/// Create a copy of IntegrationTestIosOption -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? browserstackUsername = null,Object? browserstackAccessKey = null,Object? testPackage = null,Object? customId = freezed,Object? devices = null,Object? networkLogs = null,Object? deviceLogs = null,}) { - return _then(_IntegrationTestIosOption( -browserstackUsername: null == browserstackUsername ? _self.browserstackUsername : browserstackUsername // ignore: cast_nullable_to_non_nullable -as String,browserstackAccessKey: null == browserstackAccessKey ? _self.browserstackAccessKey : browserstackAccessKey // ignore: cast_nullable_to_non_nullable -as String,testPackage: null == testPackage ? _self.testPackage : testPackage // ignore: cast_nullable_to_non_nullable -as File,customId: freezed == customId ? _self.customId : customId // ignore: cast_nullable_to_non_nullable -as String?,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable -as List,networkLogs: null == networkLogs ? _self.networkLogs : networkLogs // ignore: cast_nullable_to_non_nullable -as bool,deviceLogs: null == deviceLogs ? _self.deviceLogs : deviceLogs // ignore: cast_nullable_to_non_nullable -as bool, - )); +class _$IntegrationTestIosOptionImpl extends _IntegrationTestIosOption { + const _$IntegrationTestIosOptionImpl( + {required this.browserstackUsername, + required this.browserstackAccessKey, + required this.testPackage, + this.customId, + required final List devices, + this.networkLogs = true, + this.deviceLogs = true}) + : _devices = devices, + super._(); + + @override + final String browserstackUsername; + @override + final String browserstackAccessKey; + @override + final File testPackage; + @override + final String? customId; + final List _devices; + @override + List get devices { + if (_devices is EqualUnmodifiableListView) return _devices; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_devices); + } + + @override + @JsonKey() + final bool networkLogs; + @override + @JsonKey() + final bool deviceLogs; + + @override + String toString() { + return 'IntegrationTestIosOption(browserstackUsername: $browserstackUsername, browserstackAccessKey: $browserstackAccessKey, testPackage: $testPackage, customId: $customId, devices: $devices, networkLogs: $networkLogs, deviceLogs: $deviceLogs)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$IntegrationTestIosOptionImpl && + (identical(other.browserstackUsername, browserstackUsername) || + other.browserstackUsername == browserstackUsername) && + (identical(other.browserstackAccessKey, browserstackAccessKey) || + other.browserstackAccessKey == browserstackAccessKey) && + (identical(other.testPackage, testPackage) || + other.testPackage == testPackage) && + (identical(other.customId, customId) || + other.customId == customId) && + const DeepCollectionEquality().equals(other._devices, _devices) && + (identical(other.networkLogs, networkLogs) || + other.networkLogs == networkLogs) && + (identical(other.deviceLogs, deviceLogs) || + other.deviceLogs == deviceLogs)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + browserstackUsername, + browserstackAccessKey, + testPackage, + customId, + const DeepCollectionEquality().hash(_devices), + networkLogs, + deviceLogs); + + /// Create a copy of IntegrationTestIosOption + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$IntegrationTestIosOptionImplCopyWith<_$IntegrationTestIosOptionImpl> + get copyWith => __$$IntegrationTestIosOptionImplCopyWithImpl< + _$IntegrationTestIosOptionImpl>(this, _$identity); } - +abstract class _IntegrationTestIosOption extends IntegrationTestIosOption { + const factory _IntegrationTestIosOption( + {required final String browserstackUsername, + required final String browserstackAccessKey, + required final File testPackage, + final String? customId, + required final List devices, + final bool networkLogs, + final bool deviceLogs}) = _$IntegrationTestIosOptionImpl; + const _IntegrationTestIosOption._() : super._(); + + @override + String get browserstackUsername; + @override + String get browserstackAccessKey; + @override + File get testPackage; + @override + String? get customId; + @override + List get devices; + @override + bool get networkLogs; + @override + bool get deviceLogs; + + /// Create a copy of IntegrationTestIosOption + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$IntegrationTestIosOptionImplCopyWith<_$IntegrationTestIosOptionImpl> + get copyWith => throw _privateConstructorUsedError; } - -// dart format on From 64471213512fdd7990914480b94b8c3b8436d4f7 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Wed, 5 Mar 2025 09:41:17 +0100 Subject: [PATCH 6/6] format code --- .../integration_test/browser_stack_api.dart | 56 +++++++++---------- .../integration_test_android_option.dart | 21 ++++--- .../option/integration_test_ios_option.dart | 19 +++---- 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/lib/src/integration_test/browser_stack_api.dart b/lib/src/integration_test/browser_stack_api.dart index 9b2558c..59b0d9b 100644 --- a/lib/src/integration_test/browser_stack_api.dart +++ b/lib/src/integration_test/browser_stack_api.dart @@ -19,30 +19,29 @@ class BrowserStackApi { stdout.writeln('Upload: $filename:\n'); int? uploadPercent; - final request = - ProgressUpdateMultipartRequest( - "POST", - Uri.parse(url), - onProgress: (bytes, totalBytes) { - final remainingMbs = (bytes / 1024 / 1024); - final totalMbs = (totalBytes / 1024 / 1024); - - final percent = ((100 * remainingMbs) / totalMbs).round(); - - if (percent != uploadPercent) { - // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart - // Append a \r to make sure we update the statement instead of adding a new one. - // Keep in mind to use write instead of writeln. - stdout.write( - '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', - ); - uploadPercent = percent; - } - }, - ) - ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader - ..files.add(await http.MultipartFile.fromPath("file", file.path)) - ..fields.addAll(fields); + final request = ProgressUpdateMultipartRequest( + "POST", + Uri.parse(url), + onProgress: (bytes, totalBytes) { + final remainingMbs = (bytes / 1024 / 1024); + final totalMbs = (totalBytes / 1024 / 1024); + + final percent = ((100 * remainingMbs) / totalMbs).round(); + + if (percent != uploadPercent) { + // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart + // Append a \r to make sure we update the statement instead of adding a new one. + // Keep in mind to use write instead of writeln. + stdout.write( + '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', + ); + uploadPercent = percent; + } + }, + ) + ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader + ..files.add(await http.MultipartFile.fromPath("file", file.path)) + ..fields.addAll(fields); final response = await http.Response.fromStream(await request.send()); @@ -125,11 +124,10 @@ class BrowserStackApi { extension on http.Response { Map handleResult() { if (statusCode != 200) { - final buffer = - StringBuffer() - ..writeln("Request to ${request?.url} failed.") - ..writeln("Code: $statusCode") - ..writeln("Body: $body"); + final buffer = StringBuffer() + ..writeln("Request to ${request?.url} failed.") + ..writeln("Code: $statusCode") + ..writeln("Body: $body"); stderr.write(buffer); exit(-1); } diff --git a/lib/src/integration_test/option/integration_test_android_option.dart b/lib/src/integration_test/option/integration_test_android_option.dart index bec6026..1226b61 100644 --- a/lib/src/integration_test/option/integration_test_android_option.dart +++ b/lib/src/integration_test/option/integration_test_android_option.dart @@ -27,17 +27,16 @@ abstract class IntegrationTestAndroidOption static Future fromArguments( List arguments, ) async { - final parser = - ArgParser() - ..addOption(IntegrationTestParameter.apkPathParam) - ..addOption(IntegrationTestParameter.testSuitePathParam) - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) - ..addOption( - IntegrationTestParameter.devicesParam, - defaultsTo: "Samsung Galaxy S22-12.0", - ) - ..addOption(IntegrationTestParameter.customIdParam); + final parser = ArgParser() + ..addOption(IntegrationTestParameter.apkPathParam) + ..addOption(IntegrationTestParameter.testSuitePathParam) + ..addOption(IntegrationTestParameter.browserstackUserParam) + ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) + ..addOption( + IntegrationTestParameter.devicesParam, + defaultsTo: "Samsung Galaxy S22-12.0", + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments); diff --git a/lib/src/integration_test/option/integration_test_ios_option.dart b/lib/src/integration_test/option/integration_test_ios_option.dart index 69d63e5..b2af27f 100644 --- a/lib/src/integration_test/option/integration_test_ios_option.dart +++ b/lib/src/integration_test/option/integration_test_ios_option.dart @@ -24,16 +24,15 @@ abstract class IntegrationTestIosOption with _$IntegrationTestIosOption { static Future fromArguments( List arguments, ) async { - final parser = - ArgParser() - ..addOption(IntegrationTestParameter.browserstackUserParam) - ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) - ..addOption(IntegrationTestParameter.testPackagePathParam) - ..addOption( - IntegrationTestParameter.devicesParam, - defaultsTo: "iPhone 14 Plus-16", - ) - ..addOption(IntegrationTestParameter.customIdParam); + final parser = ArgParser() + ..addOption(IntegrationTestParameter.browserstackUserParam) + ..addOption(IntegrationTestParameter.browserstackAccessKeyParam) + ..addOption(IntegrationTestParameter.testPackagePathParam) + ..addOption( + IntegrationTestParameter.devicesParam, + defaultsTo: "iPhone 14 Plus-16", + ) + ..addOption(IntegrationTestParameter.customIdParam); final argResults = parser.parse(arguments);