diff --git a/analysis_options.yaml b/analysis_options.yaml index 56ce1482..0f3da66f 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,6 +2,8 @@ analyzer: exclude: - lib/**/*.g.dart - test/**/*.g.dart + errors: + uri_has_not_been_generated: ignore linter: rules: diff --git a/lib/src/generators/class_checks_collector.dart b/lib/src/generators/class_checks_collector.dart index 1c0b0728..a1545b16 100644 --- a/lib/src/generators/class_checks_collector.dart +++ b/lib/src/generators/class_checks_collector.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +20,7 @@ import 'methods/core.dart' as core; String _generateCheck(Annotation annotation) { if (annotation.arguments == null) throw 'bad'; return '${annotation.name.toString()}' - '(${annotation.arguments.arguments.join(', ')})'; + '(${annotation.arguments?.arguments.join(', ')})'; } /// Generates a comma separated list of class check declarations for the given diff --git a/lib/src/generators/collector_visitor.dart b/lib/src/generators/collector_visitor.dart index 137477bb..a0dcd390 100644 --- a/lib/src/generators/collector_visitor.dart +++ b/lib/src/generators/collector_visitor.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +15,7 @@ import 'dart:convert'; import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/visitor.dart'; -import 'package:pageloader/src/api/page_object_annotation.dart'; +import '../api/page_object_annotation.dart'; import 'methods/core.dart'; import 'methods/core_method_information.dart'; @@ -305,12 +303,12 @@ class CollectorVisitor extends GeneralizingAstVisitor { : parameter; final type = (declaration is SimpleFormalParameter && declaration.type != null) - ? declaration.type.toSource() + ? declaration.type?.toSource() : 'var'; var defaultValue = (parameter is DefaultFormalParameter && parameter.defaultValue != null) - ? parameter.defaultValue.toSource() + ? parameter.defaultValue?.toSource() : null; if (defaultValue == 'null') { @@ -323,20 +321,20 @@ class CollectorVisitor extends GeneralizingAstVisitor { if (parameter.isRequired) { buffer.writeln('''{ - 'name': '${parameter.declaredElement.name}', + 'name': '${parameter.declaredElement?.name}', 'kind': 'required', 'type': '$type' },'''); } else if (parameter.isNamed) { buffer.writeln('''{ - 'name': '${parameter.declaredElement.name}', + 'name': '${parameter.declaredElement?.name}', 'kind': 'named', 'type': '$type', 'default': $defaultValue },'''); } else if (parameter.isOptionalPositional) { buffer.writeln('''{ - 'name': '${parameter.declaredElement.name}', + 'name': '${parameter.declaredElement?.name}', 'kind': 'positional', 'type': '$type', 'default': $defaultValue diff --git a/lib/src/generators/methods/annotation_evaluators.dart b/lib/src/generators/methods/annotation_evaluators.dart index 924138c9..01e5073e 100644 --- a/lib/src/generators/methods/annotation_evaluators.dart +++ b/lib/src/generators/methods/annotation_evaluators.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,7 +27,8 @@ final String pageLoaderAnnotationInterface = /// Returns set of AnnotationKinds that match '@root', '@Mouse', '@nullElement' /// and '@Pointer'. -Set evaluateAsAtomicAnnotation(Element element) { +/// TODO(null-safety): argument null-optional might be unnecessary +Set evaluateAsAtomicAnnotation(Element? element) { final returnSet = {}; if (element is PropertyAccessorElement && element.library.name == pageLoaderAnnotations) { @@ -43,10 +42,10 @@ Set evaluateAsAtomicAnnotation(Element element) { /// Returns set of AnnotationKinds if the annotation is a subclass of /// Finder, Checker, and/or Filter. -Set evaluateAsInterfaceAnnotation(Element element) { - final returnSet = {}; +Set evaluateAsInterfaceAnnotation(Element element) { + final returnSet = {}; - DartType type; + DartType? type; if (element is PropertyAccessorElement && element.isGetter) { type = element.returnType; } else if (element is ConstructorElement) { @@ -54,7 +53,7 @@ Set evaluateAsInterfaceAnnotation(Element element) { } if (type is InterfaceType) { - final seenValidAnnotations = {}; + final seenValidAnnotations = {}; final interfaces = [type, ...type.allSupertypes]; for (var interface in interfaces) { final interfaceElement = interface.element; @@ -84,7 +83,7 @@ enum AnnotationKind { } /// Maps library and className to proper AnnotationKind. -AnnotationKind classNameToAnnotationKind(String className, {bool isAtomic}) { +AnnotationKind? classNameToAnnotationKind(String className, {required bool isAtomic}) { if (isAtomic) { switch (className) { case 'LegacyPageObject': diff --git a/lib/src/generators/methods/core.dart b/lib/src/generators/methods/core.dart index 9262566d..1fda71d2 100644 --- a/lib/src/generators/methods/core.dart +++ b/lib/src/generators/methods/core.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,12 +38,14 @@ final String pageObjectList = 'PageObjectList'; /// Returns a declaration of a annotation. String generateAnnotationDeclaration(Annotation annotation) => - '${annotation.name}(${annotation.arguments.arguments.join(", ")})'; + '${annotation.name}(${annotation.arguments?.arguments.join(", ")})'; /// Returns a 'ByTagName' declaration from the 'ByCheckTag' annotation. String generateByTagNameFromByCheckTag( - InterfaceType node, String methodSource) { - final defaultTagName = _extractTagName(node.element); + DartType? node, String methodSource) { + // Original(null-safety): node is InterfaceType and no "?" + // Also no cast below. + final defaultTagName = _extractTagName(node?.element as ClassElement); if (defaultTagName.isEmpty) { throw "'@ByCheckTag' can only be used on getters that return a " "PageObject type with the'@CheckTag' annotation.\n\nCheck the type on " @@ -58,15 +58,15 @@ String generateByTagNameFromByCheckTag( /// If there is no tag name associated with the Page Object, /// returns and empty string. String _extractTagName(ClassElement poTypeElement) { - var expectedTag = ''; + late String expectedTag; for (final annotation in poTypeElement.metadata) { final annotationElement = annotation.element; if (annotationElement is ConstructorElement) { final annotationName = annotationElement.enclosingElement.displayName; final annotationValue = annotation.computeConstantValue(); if (annotationName == 'CheckTag') { - final inner = annotationValue.getField('_expectedTagName'); - expectedTag = inner.toStringValue(); + final inner = annotationValue?.getField('_expectedTagName'); + expectedTag = inner?.toStringValue() ?? ''; } } } @@ -100,8 +100,8 @@ bool isPageloaderAnnotation(Annotation annotation) => getAnnotationKind(annotation).isNotEmpty; /// Returns set of all Pageloader annotation the current annotation satisfies. -Set getAnnotationKind(Annotation annotation) { - final returnSet = {}; +Set getAnnotationKind(Annotation annotation) { + final returnSet = {}; final element = annotation.element; if (element != null) { returnSet @@ -164,20 +164,21 @@ List getReturnTypeArguments(String returnStr) { /// matching name [matchingType]. /// /// Assumes that the inner-type has a single type (ex: not Foo). -DartType getInnerType(DartType topType, String matchingType) { +DartType getInnerType(DartType? topType, String matchingType) { // Filter out type name incase prefixes exist on the type. matchingType = matchingType.contains('.') ? matchingType.split('.')[1] : matchingType; final typeArgs = (topType as ParameterizedType).typeArguments; final first = typeArgs.first; - if (first.name == matchingType) { + // TODO(null-safety): nullability: true or false? + if (first.getDisplayString(withNullability: true) == matchingType) { return first; } return getInnerType(first, matchingType); } /// Return the Dart code that corresponds to the [type]. -String typeToCode(DartType type) { +String? typeToCode(DartType? type) { // TODO: This should be replaced with actual code generation. - return type?.getDisplayString(withNullability: false); + return type?.getDisplayString(withNullability: true); } diff --git a/lib/src/generators/methods/core_method_information.dart b/lib/src/generators/methods/core_method_information.dart index 0f6ed443..9f108be7 100644 --- a/lib/src/generators/methods/core_method_information.dart +++ b/lib/src/generators/methods/core_method_information.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,7 +71,11 @@ TypeInformation extractPageObjectInfo( CoreMethodInformation collectCoreMethodInformation(MethodDeclaration node) { // Extract type info. - final typeInfo = getTypeInformation(node.returnType.toSource()); + // TODO(null-safety): verify logic. + // Before: final typeInfo = getTypeInformation((node.returnType).toSource()); + // The reason is because for Dart, if a method doesn't declare a return type, + // it's automatically `dynamic`. + final typeInfo = getTypeInformation(node.returnType?.toSource() ?? 'dynamic'); final isFuture = typeInfo.type == 'Future'; final isList = typeInfo.type == 'List' || diff --git a/lib/src/generators/methods/core_method_information.g.dart b/lib/src/generators/methods/core_method_information.g.dart index f9fd3a1f..293fb4d0 100644 --- a/lib/src/generators/methods/core_method_information.g.dart +++ b/lib/src/generators/methods/core_method_information.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.core_method_information; @@ -13,10 +12,11 @@ class _$TypeInformation extends TypeInformation { @override final List typeArguments; - factory _$TypeInformation([void Function(TypeInformationBuilder) updates]) => + factory _$TypeInformation([void Function(TypeInformationBuilder)? updates]) => (new TypeInformationBuilder()..update(updates)).build(); - _$TypeInformation._({this.type, this.typeArguments}) : super._() { + _$TypeInformation._({required this.type, required this.typeArguments}) + : super._() { BuiltValueNullFieldError.checkNotNull(type, 'TypeInformation', 'type'); BuiltValueNullFieldError.checkNotNull( typeArguments, 'TypeInformation', 'typeArguments'); @@ -54,15 +54,15 @@ class _$TypeInformation extends TypeInformation { class TypeInformationBuilder implements Builder { - _$TypeInformation _$v; + _$TypeInformation? _$v; - String _type; - String get type => _$this._type; - set type(String type) => _$this._type = type; + String? _type; + String? get type => _$this._type; + set type(String? type) => _$this._type = type; - List _typeArguments; - List get typeArguments => _$this._typeArguments; - set typeArguments(List typeArguments) => + List? _typeArguments; + List? get typeArguments => _$this._typeArguments; + set typeArguments(List? typeArguments) => _$this._typeArguments = typeArguments; TypeInformationBuilder(); @@ -84,7 +84,7 @@ class TypeInformationBuilder } @override - void update(void Function(TypeInformationBuilder) updates) { + void update(void Function(TypeInformationBuilder)? updates) { if (updates != null) updates(this); } @@ -136,26 +136,26 @@ class _$CoreMethodInformation extends CoreMethodInformation { final AstNode node; factory _$CoreMethodInformation( - [void Function(CoreMethodInformationBuilder) updates]) => + [void Function(CoreMethodInformationBuilder)? updates]) => (new CoreMethodInformationBuilder()..update(updates)).build(); _$CoreMethodInformation._( - {this.name, - this.isGetter, - this.isAbstract, - this.pageObjectType, - this.pageObjectTemplate, - this.isFuture, - this.isList, - this.isMouse, - this.isPointer, - this.finder, - this.filters, - this.checkers, - this.isRoot, - this.isNullElement, - this.nodeSource, - this.node}) + {required this.name, + required this.isGetter, + required this.isAbstract, + required this.pageObjectType, + required this.pageObjectTemplate, + required this.isFuture, + required this.isList, + required this.isMouse, + required this.isPointer, + required this.finder, + required this.filters, + required this.checkers, + required this.isRoot, + required this.isNullElement, + required this.nodeSource, + required this.node}) : super._() { BuiltValueNullFieldError.checkNotNull( name, 'CoreMethodInformation', 'name'); @@ -291,75 +291,75 @@ class CoreMethodInformationBuilder implements Builder, CoreMethodInformationBaseBuilder { - _$CoreMethodInformation _$v; + _$CoreMethodInformation? _$v; - String _name; - String get name => _$this._name; - set name(covariant String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; - bool _isGetter; - bool get isGetter => _$this._isGetter; - set isGetter(covariant bool isGetter) => _$this._isGetter = isGetter; + bool? _isGetter; + bool? get isGetter => _$this._isGetter; + set isGetter(covariant bool? isGetter) => _$this._isGetter = isGetter; - bool _isAbstract; - bool get isAbstract => _$this._isAbstract; - set isAbstract(covariant bool isAbstract) => _$this._isAbstract = isAbstract; + bool? _isAbstract; + bool? get isAbstract => _$this._isAbstract; + set isAbstract(covariant bool? isAbstract) => _$this._isAbstract = isAbstract; - String _pageObjectType; - String get pageObjectType => _$this._pageObjectType; - set pageObjectType(covariant String pageObjectType) => + String? _pageObjectType; + String? get pageObjectType => _$this._pageObjectType; + set pageObjectType(covariant String? pageObjectType) => _$this._pageObjectType = pageObjectType; - Optional _pageObjectTemplate; - Optional get pageObjectTemplate => _$this._pageObjectTemplate; - set pageObjectTemplate(covariant Optional pageObjectTemplate) => + Optional? _pageObjectTemplate; + Optional? get pageObjectTemplate => _$this._pageObjectTemplate; + set pageObjectTemplate(covariant Optional? pageObjectTemplate) => _$this._pageObjectTemplate = pageObjectTemplate; - bool _isFuture; - bool get isFuture => _$this._isFuture; - set isFuture(covariant bool isFuture) => _$this._isFuture = isFuture; + bool? _isFuture; + bool? get isFuture => _$this._isFuture; + set isFuture(covariant bool? isFuture) => _$this._isFuture = isFuture; - bool _isList; - bool get isList => _$this._isList; - set isList(covariant bool isList) => _$this._isList = isList; + bool? _isList; + bool? get isList => _$this._isList; + set isList(covariant bool? isList) => _$this._isList = isList; - bool _isMouse; - bool get isMouse => _$this._isMouse; - set isMouse(covariant bool isMouse) => _$this._isMouse = isMouse; + bool? _isMouse; + bool? get isMouse => _$this._isMouse; + set isMouse(covariant bool? isMouse) => _$this._isMouse = isMouse; - bool _isPointer; - bool get isPointer => _$this._isPointer; - set isPointer(covariant bool isPointer) => _$this._isPointer = isPointer; + bool? _isPointer; + bool? get isPointer => _$this._isPointer; + set isPointer(covariant bool? isPointer) => _$this._isPointer = isPointer; - Optional _finder; - Optional get finder => _$this._finder; - set finder(covariant Optional finder) => _$this._finder = finder; + Optional? _finder; + Optional? get finder => _$this._finder; + set finder(covariant Optional? finder) => _$this._finder = finder; - List _filters; - List get filters => _$this._filters; - set filters(covariant List filters) => _$this._filters = filters; + List? _filters; + List? get filters => _$this._filters; + set filters(covariant List? filters) => _$this._filters = filters; - List _checkers; - List get checkers => _$this._checkers; - set checkers(covariant List checkers) => _$this._checkers = checkers; + List? _checkers; + List? get checkers => _$this._checkers; + set checkers(covariant List? checkers) => _$this._checkers = checkers; - bool _isRoot; - bool get isRoot => _$this._isRoot; - set isRoot(covariant bool isRoot) => _$this._isRoot = isRoot; + bool? _isRoot; + bool? get isRoot => _$this._isRoot; + set isRoot(covariant bool? isRoot) => _$this._isRoot = isRoot; - bool _isNullElement; - bool get isNullElement => _$this._isNullElement; - set isNullElement(covariant bool isNullElement) => + bool? _isNullElement; + bool? get isNullElement => _$this._isNullElement; + set isNullElement(covariant bool? isNullElement) => _$this._isNullElement = isNullElement; - String _nodeSource; - String get nodeSource => _$this._nodeSource; - set nodeSource(covariant String nodeSource) => + String? _nodeSource; + String? get nodeSource => _$this._nodeSource; + set nodeSource(covariant String? nodeSource) => _$this._nodeSource = nodeSource; - AstNode _node; - AstNode get node => _$this._node; - set node(covariant AstNode node) => _$this._node = node; + AstNode? _node; + AstNode? get node => _$this._node; + set node(covariant AstNode? node) => _$this._node = node; CoreMethodInformationBuilder(); @@ -394,7 +394,7 @@ class CoreMethodInformationBuilder } @override - void update(void Function(CoreMethodInformationBuilder) updates) { + void update(void Function(CoreMethodInformationBuilder)? updates) { if (updates != null) updates(this); } @@ -434,53 +434,53 @@ class CoreMethodInformationBuilder abstract class CoreMethodInformationBaseBuilder { void replace(CoreMethodInformationBase other); void update(void Function(CoreMethodInformationBaseBuilder) updates); - String get name; - set name(String name); + String? get name; + set name(String? name); - bool get isGetter; - set isGetter(bool isGetter); + bool? get isGetter; + set isGetter(bool? isGetter); - bool get isAbstract; - set isAbstract(bool isAbstract); + bool? get isAbstract; + set isAbstract(bool? isAbstract); - String get pageObjectType; - set pageObjectType(String pageObjectType); + String? get pageObjectType; + set pageObjectType(String? pageObjectType); - Optional get pageObjectTemplate; - set pageObjectTemplate(Optional pageObjectTemplate); + Optional? get pageObjectTemplate; + set pageObjectTemplate(Optional? pageObjectTemplate); - bool get isFuture; - set isFuture(bool isFuture); + bool? get isFuture; + set isFuture(bool? isFuture); - bool get isList; - set isList(bool isList); + bool? get isList; + set isList(bool? isList); - bool get isMouse; - set isMouse(bool isMouse); + bool? get isMouse; + set isMouse(bool? isMouse); - bool get isPointer; - set isPointer(bool isPointer); + bool? get isPointer; + set isPointer(bool? isPointer); - Optional get finder; - set finder(Optional finder); + Optional? get finder; + set finder(Optional? finder); - List get filters; - set filters(List filters); + List? get filters; + set filters(List? filters); - List get checkers; - set checkers(List checkers); + List? get checkers; + set checkers(List? checkers); - bool get isRoot; - set isRoot(bool isRoot); + bool? get isRoot; + set isRoot(bool? isRoot); - bool get isNullElement; - set isNullElement(bool isNullElement); + bool? get isNullElement; + set isNullElement(bool? isNullElement); - String get nodeSource; - set nodeSource(String nodeSource); + String? get nodeSource; + set nodeSource(String? nodeSource); - AstNode get node; - set node(AstNode node); + AstNode? get node; + set node(AstNode? node); } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/getter.dart b/lib/src/generators/methods/getter.dart index 1f68ced8..bc8753a9 100644 --- a/lib/src/generators/methods/getter.dart +++ b/lib/src/generators/methods/getter.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/getter.g.dart b/lib/src/generators/methods/getter.g.dart index 2d9a6c1e..4da29e84 100644 --- a/lib/src/generators/methods/getter.g.dart +++ b/lib/src/generators/methods/getter.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.getter; @@ -13,10 +12,10 @@ class _$Getter extends Getter { @override final String returnType; - factory _$Getter([void Function(GetterBuilder) updates]) => + factory _$Getter([void Function(GetterBuilder)? updates]) => (new GetterBuilder()..update(updates)).build(); - _$Getter._({this.name, this.returnType}) : super._() { + _$Getter._({required this.name, required this.returnType}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'Getter', 'name'); BuiltValueNullFieldError.checkNotNull(returnType, 'Getter', 'returnType'); } @@ -51,15 +50,15 @@ class _$Getter extends Getter { } class GetterBuilder implements Builder { - _$Getter _$v; + _$Getter? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _returnType; - String get returnType => _$this._returnType; - set returnType(String returnType) => _$this._returnType = returnType; + String? _returnType; + String? get returnType => _$this._returnType; + set returnType(String? returnType) => _$this._returnType = returnType; GetterBuilder(); @@ -80,7 +79,7 @@ class GetterBuilder implements Builder { } @override - void update(void Function(GetterBuilder) updates) { + void update(void Function(GetterBuilder)? updates) { if (updates != null) updates(this); } @@ -96,4 +95,4 @@ class GetterBuilder implements Builder { } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/invalid_method_exception.dart b/lib/src/generators/methods/invalid_method_exception.dart index e26fd7cc..c0a45109 100644 --- a/lib/src/generators/methods/invalid_method_exception.dart +++ b/lib/src/generators/methods/invalid_method_exception.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,6 +17,7 @@ import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/element/element.dart'; /// Thrown when a method defined in a page object is invalid in some way. +// TODO(null-safety): should null also be a part of it? class InvalidMethodException implements Exception { final String _message; final AstNode _methodNode; @@ -32,18 +31,18 @@ class InvalidMethodException implements Exception { /// that includes file and location. String _nodeMessage(AstNode node) { final compUnitElement = _getCompilationUnitElement(node); - final uri = compUnitElement.source.uri; + final uri = compUnitElement?.source.uri; - final exactLineInfo = compUnitElement.lineInfo.getLocation(node.offset); + final exactLineInfo = compUnitElement?.lineInfo?.getLocation(node.offset); return '$uri $exactLineInfo\t\t ${node.toSource()}'; } /// Returns the [CompilationUnitElement] of [node]. - CompilationUnitElement _getCompilationUnitElement(AstNode node) { - var _node = node; + CompilationUnitElement? _getCompilationUnitElement(AstNode node) { + AstNode? _node = node; while (_node is! CompilationUnit) { - _node = _node.parent; + _node = _node?.parent; } - return (_node as CompilationUnit).declaredElement; + return _node.declaredElement; } } diff --git a/lib/src/generators/methods/iterable_finder_method.dart b/lib/src/generators/methods/iterable_finder_method.dart index ec1b1409..0b6c2848 100644 --- a/lib/src/generators/methods/iterable_finder_method.dart +++ b/lib/src/generators/methods/iterable_finder_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +15,7 @@ library pageloader.iterable_finder_method; import 'package:analyzer/dart/ast/ast.dart'; +import 'package:analyzer/dart/element/type.dart'; import 'package:built_value/built_value.dart'; import 'package:quiver/core.dart'; @@ -38,7 +37,7 @@ Optional collectIterableFinderGetter( return Optional.absent(); } - String finder; + String? finder; final filters = []; final checkers = []; for (final annotation in methodAnnotations) { @@ -66,8 +65,9 @@ Optional collectIterableFinderGetter( // Convert 'ByCheckTag' to 'ByTagName' if necessary. if (finder != null && finder.contains('ByCheckTag')) { + // TODO(null-safety): does casting from `DartType` to `InterfaceType` work? finder = generateByTagNameFromByCheckTag( - getInnerType(node.returnType.type, typeArguments[0]), node.toSource()); + getInnerType(node.returnType?.type, typeArguments[0]) as InterfaceType, node.toSource()); } if (finder == null) { @@ -82,7 +82,7 @@ Optional collectIterableFinderGetter( return Optional.of(IterableFinderMethod((b) => b ..name = node.name.toString() ..iterableTypeArgument = typeArguments[0] - ..finderDeclaration = finder + ..finderDeclaration = finder // Should be resolved by built_value ..filterDeclarations = '[${filters.join(', ')}]' ..checkerDeclarations = '[${checkers.join(', ')}]')); } diff --git a/lib/src/generators/methods/iterable_finder_method.g.dart b/lib/src/generators/methods/iterable_finder_method.g.dart index 6904c6a0..8e2e818f 100644 --- a/lib/src/generators/methods/iterable_finder_method.g.dart +++ b/lib/src/generators/methods/iterable_finder_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.iterable_finder_method; @@ -20,15 +19,15 @@ class _$IterableFinderMethod extends IterableFinderMethod { final String checkerDeclarations; factory _$IterableFinderMethod( - [void Function(IterableFinderMethodBuilder) updates]) => + [void Function(IterableFinderMethodBuilder)? updates]) => (new IterableFinderMethodBuilder()..update(updates)).build(); _$IterableFinderMethod._( - {this.name, - this.iterableTypeArgument, - this.finderDeclaration, - this.filterDeclarations, - this.checkerDeclarations}) + {required this.name, + required this.iterableTypeArgument, + required this.finderDeclaration, + required this.filterDeclarations, + required this.checkerDeclarations}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'IterableFinderMethod', 'name'); BuiltValueNullFieldError.checkNotNull( @@ -85,30 +84,30 @@ class _$IterableFinderMethod extends IterableFinderMethod { class IterableFinderMethodBuilder implements Builder { - _$IterableFinderMethod _$v; + _$IterableFinderMethod? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _iterableTypeArgument; - String get iterableTypeArgument => _$this._iterableTypeArgument; - set iterableTypeArgument(String iterableTypeArgument) => + String? _iterableTypeArgument; + String? get iterableTypeArgument => _$this._iterableTypeArgument; + set iterableTypeArgument(String? iterableTypeArgument) => _$this._iterableTypeArgument = iterableTypeArgument; - String _finderDeclaration; - String get finderDeclaration => _$this._finderDeclaration; - set finderDeclaration(String finderDeclaration) => + String? _finderDeclaration; + String? get finderDeclaration => _$this._finderDeclaration; + set finderDeclaration(String? finderDeclaration) => _$this._finderDeclaration = finderDeclaration; - String _filterDeclarations; - String get filterDeclarations => _$this._filterDeclarations; - set filterDeclarations(String filterDeclarations) => + String? _filterDeclarations; + String? get filterDeclarations => _$this._filterDeclarations; + set filterDeclarations(String? filterDeclarations) => _$this._filterDeclarations = filterDeclarations; - String _checkerDeclarations; - String get checkerDeclarations => _$this._checkerDeclarations; - set checkerDeclarations(String checkerDeclarations) => + String? _checkerDeclarations; + String? get checkerDeclarations => _$this._checkerDeclarations; + set checkerDeclarations(String? checkerDeclarations) => _$this._checkerDeclarations = checkerDeclarations; IterableFinderMethodBuilder(); @@ -133,7 +132,7 @@ class IterableFinderMethodBuilder } @override - void update(void Function(IterableFinderMethodBuilder) updates) { + void update(void Function(IterableFinderMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -162,4 +161,4 @@ class IterableFinderMethodBuilder } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/list_finder_method.dart b/lib/src/generators/methods/list_finder_method.dart index 8f2ecb83..8e376182 100644 --- a/lib/src/generators/methods/list_finder_method.dart +++ b/lib/src/generators/methods/list_finder_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,10 +38,10 @@ Optional collectListFinderGetter( } // Convert 'ByCheckTag' to 'ByTagName' if necessary. - var finder = methodInfo.finder.value; + var finder = methodInfo.finder.orNull; if (finder != null && finder.contains('ByCheckTag')) { finder = generateByTagNameFromByCheckTag( - getInnerType(node.returnType.type, methodInfo.pageObjectType), + getInnerType(node.returnType?.type, methodInfo.pageObjectType), node.toSource()); } diff --git a/lib/src/generators/methods/list_finder_method.g.dart b/lib/src/generators/methods/list_finder_method.g.dart index b33bd2e8..e5ed7448 100644 --- a/lib/src/generators/methods/list_finder_method.g.dart +++ b/lib/src/generators/methods/list_finder_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.list_finder_method; @@ -24,17 +23,17 @@ class _$ListFinderMethod extends ListFinderMethod { final Optional genericType; factory _$ListFinderMethod( - [void Function(ListFinderMethodBuilder) updates]) => + [void Function(ListFinderMethodBuilder)? updates]) => (new ListFinderMethodBuilder()..update(updates)).build(); _$ListFinderMethod._( - {this.name, - this.listTypeArgument, - this.finderDeclaration, - this.filterDeclarations, - this.checkerDeclarations, - this.isFuture, - this.genericType}) + {required this.name, + required this.listTypeArgument, + required this.finderDeclaration, + required this.filterDeclarations, + required this.checkerDeclarations, + required this.isFuture, + required this.genericType}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'ListFinderMethod', 'name'); BuiltValueNullFieldError.checkNotNull( @@ -104,39 +103,39 @@ class ListFinderMethodBuilder implements Builder, ListFinderMethodBaseBuilder { - _$ListFinderMethod _$v; + _$ListFinderMethod? _$v; - String _name; - String get name => _$this._name; - set name(covariant String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; - String _listTypeArgument; - String get listTypeArgument => _$this._listTypeArgument; - set listTypeArgument(covariant String listTypeArgument) => + String? _listTypeArgument; + String? get listTypeArgument => _$this._listTypeArgument; + set listTypeArgument(covariant String? listTypeArgument) => _$this._listTypeArgument = listTypeArgument; - String _finderDeclaration; - String get finderDeclaration => _$this._finderDeclaration; - set finderDeclaration(covariant String finderDeclaration) => + String? _finderDeclaration; + String? get finderDeclaration => _$this._finderDeclaration; + set finderDeclaration(covariant String? finderDeclaration) => _$this._finderDeclaration = finderDeclaration; - String _filterDeclarations; - String get filterDeclarations => _$this._filterDeclarations; - set filterDeclarations(covariant String filterDeclarations) => + String? _filterDeclarations; + String? get filterDeclarations => _$this._filterDeclarations; + set filterDeclarations(covariant String? filterDeclarations) => _$this._filterDeclarations = filterDeclarations; - String _checkerDeclarations; - String get checkerDeclarations => _$this._checkerDeclarations; - set checkerDeclarations(covariant String checkerDeclarations) => + String? _checkerDeclarations; + String? get checkerDeclarations => _$this._checkerDeclarations; + set checkerDeclarations(covariant String? checkerDeclarations) => _$this._checkerDeclarations = checkerDeclarations; - bool _isFuture; - bool get isFuture => _$this._isFuture; - set isFuture(covariant bool isFuture) => _$this._isFuture = isFuture; + bool? _isFuture; + bool? get isFuture => _$this._isFuture; + set isFuture(covariant bool? isFuture) => _$this._isFuture = isFuture; - Optional _genericType; - Optional get genericType => _$this._genericType; - set genericType(covariant Optional genericType) => + Optional? _genericType; + Optional? get genericType => _$this._genericType; + set genericType(covariant Optional? genericType) => _$this._genericType = genericType; ListFinderMethodBuilder(); @@ -163,7 +162,7 @@ class ListFinderMethodBuilder } @override - void update(void Function(ListFinderMethodBuilder) updates) { + void update(void Function(ListFinderMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -193,26 +192,26 @@ class ListFinderMethodBuilder abstract class ListFinderMethodBaseBuilder { void replace(ListFinderMethodBase other); void update(void Function(ListFinderMethodBaseBuilder) updates); - String get name; - set name(String name); + String? get name; + set name(String? name); - String get listTypeArgument; - set listTypeArgument(String listTypeArgument); + String? get listTypeArgument; + set listTypeArgument(String? listTypeArgument); - String get finderDeclaration; - set finderDeclaration(String finderDeclaration); + String? get finderDeclaration; + set finderDeclaration(String? finderDeclaration); - String get filterDeclarations; - set filterDeclarations(String filterDeclarations); + String? get filterDeclarations; + set filterDeclarations(String? filterDeclarations); - String get checkerDeclarations; - set checkerDeclarations(String checkerDeclarations); + String? get checkerDeclarations; + set checkerDeclarations(String? checkerDeclarations); - bool get isFuture; - set isFuture(bool isFuture); + bool? get isFuture; + set isFuture(bool? isFuture); - Optional get genericType; - set genericType(Optional genericType); + Optional? get genericType; + set genericType(Optional? genericType); } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/listeners.dart b/lib/src/generators/methods/listeners.dart index da11be24..56d9d541 100644 --- a/lib/src/generators/methods/listeners.dart +++ b/lib/src/generators/methods/listeners.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/mouse_finder_method.dart b/lib/src/generators/methods/mouse_finder_method.dart index 7c465d0f..2166c4f0 100644 --- a/lib/src/generators/methods/mouse_finder_method.dart +++ b/lib/src/generators/methods/mouse_finder_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/mouse_finder_method.g.dart b/lib/src/generators/methods/mouse_finder_method.g.dart index 52638d15..ea87f65c 100644 --- a/lib/src/generators/methods/mouse_finder_method.g.dart +++ b/lib/src/generators/methods/mouse_finder_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.mouse_finder_method; @@ -14,10 +13,11 @@ class _$MouseFinderMethod extends MouseFinderMethod { final String name; factory _$MouseFinderMethod( - [void Function(MouseFinderMethodBuilder) updates]) => + [void Function(MouseFinderMethodBuilder)? updates]) => (new MouseFinderMethodBuilder()..update(updates)).build(); - _$MouseFinderMethod._({this.nullSafety, this.name}) : super._() { + _$MouseFinderMethod._({required this.nullSafety, required this.name}) + : super._() { BuiltValueNullFieldError.checkNotNull( nullSafety, 'MouseFinderMethod', 'nullSafety'); BuiltValueNullFieldError.checkNotNull(name, 'MouseFinderMethod', 'name'); @@ -55,17 +55,17 @@ class _$MouseFinderMethod extends MouseFinderMethod { class MouseFinderMethodBuilder implements Builder { - _$MouseFinderMethod _$v; + _$MouseFinderMethod? _$v; - NullSafetyBuilder _nullSafety; + NullSafetyBuilder? _nullSafety; NullSafetyBuilder get nullSafety => _$this._nullSafety ??= new NullSafetyBuilder(); - set nullSafety(NullSafetyBuilder nullSafety) => + set nullSafety(NullSafetyBuilder? nullSafety) => _$this._nullSafety = nullSafety; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; MouseFinderMethodBuilder(); @@ -86,7 +86,7 @@ class MouseFinderMethodBuilder } @override - void update(void Function(MouseFinderMethodBuilder) updates) { + void update(void Function(MouseFinderMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -100,7 +100,7 @@ class MouseFinderMethodBuilder name: BuiltValueNullFieldError.checkNotNull( name, 'MouseFinderMethod', 'name')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'nullSafety'; nullSafety.build(); @@ -115,4 +115,4 @@ class MouseFinderMethodBuilder } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/null_safety.dart b/lib/src/generators/methods/null_safety.dart index 0bc88873..1bf3b664 100644 --- a/lib/src/generators/methods/null_safety.dart +++ b/lib/src/generators/methods/null_safety.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2020 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/null_safety.g.dart b/lib/src/generators/methods/null_safety.g.dart index d56c019d..7cd6bbdc 100644 --- a/lib/src/generators/methods/null_safety.g.dart +++ b/lib/src/generators/methods/null_safety.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of 'null_safety.dart'; @@ -11,10 +10,10 @@ class _$NullSafety extends NullSafety { @override final bool enabled; - factory _$NullSafety([void Function(NullSafetyBuilder) updates]) => + factory _$NullSafety([void Function(NullSafetyBuilder)? updates]) => (new NullSafetyBuilder()..update(updates)).build(); - _$NullSafety._({this.enabled}) : super._() { + _$NullSafety._({required this.enabled}) : super._() { BuiltValueNullFieldError.checkNotNull(enabled, 'NullSafety', 'enabled'); } @@ -44,11 +43,11 @@ class _$NullSafety extends NullSafety { } class NullSafetyBuilder implements Builder { - _$NullSafety _$v; + _$NullSafety? _$v; - bool _enabled; - bool get enabled => _$this._enabled; - set enabled(bool enabled) => _$this._enabled = enabled; + bool? _enabled; + bool? get enabled => _$this._enabled; + set enabled(bool? enabled) => _$this._enabled = enabled; NullSafetyBuilder(); @@ -68,7 +67,7 @@ class NullSafetyBuilder implements Builder { } @override - void update(void Function(NullSafetyBuilder) updates) { + void update(void Function(NullSafetyBuilder)? updates) { if (updates != null) updates(this); } @@ -83,4 +82,4 @@ class NullSafetyBuilder implements Builder { } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/oversupported_method.dart b/lib/src/generators/methods/oversupported_method.dart index 0dc2fe3c..c6dd157f 100644 --- a/lib/src/generators/methods/oversupported_method.dart +++ b/lib/src/generators/methods/oversupported_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/pointer_finder_method.dart b/lib/src/generators/methods/pointer_finder_method.dart index 5cb0714e..3f6967ed 100644 --- a/lib/src/generators/methods/pointer_finder_method.dart +++ b/lib/src/generators/methods/pointer_finder_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/lib/src/generators/methods/pointer_finder_method.g.dart b/lib/src/generators/methods/pointer_finder_method.g.dart index d8a4f60c..d92b2650 100644 --- a/lib/src/generators/methods/pointer_finder_method.g.dart +++ b/lib/src/generators/methods/pointer_finder_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.pointer_finder_method; @@ -14,10 +13,11 @@ class _$PointerFinderMethod extends PointerFinderMethod { final String name; factory _$PointerFinderMethod( - [void Function(PointerFinderMethodBuilder) updates]) => + [void Function(PointerFinderMethodBuilder)? updates]) => (new PointerFinderMethodBuilder()..update(updates)).build(); - _$PointerFinderMethod._({this.nullSafety, this.name}) : super._() { + _$PointerFinderMethod._({required this.nullSafety, required this.name}) + : super._() { BuiltValueNullFieldError.checkNotNull( nullSafety, 'PointerFinderMethod', 'nullSafety'); BuiltValueNullFieldError.checkNotNull(name, 'PointerFinderMethod', 'name'); @@ -56,17 +56,17 @@ class _$PointerFinderMethod extends PointerFinderMethod { class PointerFinderMethodBuilder implements Builder { - _$PointerFinderMethod _$v; + _$PointerFinderMethod? _$v; - NullSafetyBuilder _nullSafety; + NullSafetyBuilder? _nullSafety; NullSafetyBuilder get nullSafety => _$this._nullSafety ??= new NullSafetyBuilder(); - set nullSafety(NullSafetyBuilder nullSafety) => + set nullSafety(NullSafetyBuilder? nullSafety) => _$this._nullSafety = nullSafety; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; PointerFinderMethodBuilder(); @@ -87,7 +87,7 @@ class PointerFinderMethodBuilder } @override - void update(void Function(PointerFinderMethodBuilder) updates) { + void update(void Function(PointerFinderMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -101,7 +101,7 @@ class PointerFinderMethodBuilder name: BuiltValueNullFieldError.checkNotNull( name, 'PointerFinderMethod', 'name')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'nullSafety'; nullSafety.build(); @@ -116,4 +116,4 @@ class PointerFinderMethodBuilder } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/setter.dart b/lib/src/generators/methods/setter.dart index cfa1f57b..a6faef0c 100644 --- a/lib/src/generators/methods/setter.dart +++ b/lib/src/generators/methods/setter.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,11 +26,11 @@ part 'setter.g.dart'; /// Returns a [Setter] for concrete setters, and [absent()] otherwise. Optional collectUnannotatedSetter(MethodDeclaration node) { if (!node.isAbstract && node.isSetter) { - final param = node.parameters.parameters.first; + final param = node.parameters?.parameters.first; return Optional.of(Setter((b) => b ..name = node.name.toString() - ..setterType = typeToCode(param.declaredElement.type) - ..setterValueName = param.declaredElement.name)); + ..setterType = typeToCode(param?.declaredElement?.type) + ..setterValueName = param?.declaredElement?.name)); } return Optional.absent(); } diff --git a/lib/src/generators/methods/setter.g.dart b/lib/src/generators/methods/setter.g.dart index 24bdb31a..9a96e066 100644 --- a/lib/src/generators/methods/setter.g.dart +++ b/lib/src/generators/methods/setter.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.setter; @@ -15,10 +14,14 @@ class _$Setter extends Setter { @override final String setterValueName; - factory _$Setter([void Function(SetterBuilder) updates]) => + factory _$Setter([void Function(SetterBuilder)? updates]) => (new SetterBuilder()..update(updates)).build(); - _$Setter._({this.name, this.setterType, this.setterValueName}) : super._() { + _$Setter._( + {required this.name, + required this.setterType, + required this.setterValueName}) + : super._() { BuiltValueNullFieldError.checkNotNull(name, 'Setter', 'name'); BuiltValueNullFieldError.checkNotNull(setterType, 'Setter', 'setterType'); BuiltValueNullFieldError.checkNotNull( @@ -58,19 +61,19 @@ class _$Setter extends Setter { } class SetterBuilder implements Builder { - _$Setter _$v; + _$Setter? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _setterType; - String get setterType => _$this._setterType; - set setterType(String setterType) => _$this._setterType = setterType; + String? _setterType; + String? get setterType => _$this._setterType; + set setterType(String? setterType) => _$this._setterType = setterType; - String _setterValueName; - String get setterValueName => _$this._setterValueName; - set setterValueName(String setterValueName) => + String? _setterValueName; + String? get setterValueName => _$this._setterValueName; + set setterValueName(String? setterValueName) => _$this._setterValueName = setterValueName; SetterBuilder(); @@ -93,7 +96,7 @@ class SetterBuilder implements Builder { } @override - void update(void Function(SetterBuilder) updates) { + void update(void Function(SetterBuilder)? updates) { if (updates != null) updates(this); } @@ -111,4 +114,4 @@ class SetterBuilder implements Builder { } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/single_finder_method.dart b/lib/src/generators/methods/single_finder_method.dart index 1d7c7f1b..c51b7fcd 100644 --- a/lib/src/generators/methods/single_finder_method.dart +++ b/lib/src/generators/methods/single_finder_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -67,7 +65,7 @@ Optional collectSingleFinderGetter( var typeArgument = node.returnType.toString(); // Get template, if it exists. - String templateType; + String? templateType; if (typeArgument.contains('<')) { final typeArguments = getReturnTypeArguments(typeArgument); if (typeArguments.length != 1) { @@ -90,9 +88,9 @@ Optional collectSingleFinderGetter( // Check to see if return type is expected [InterfaceType]. If not, then // this means there is an error in the original Dart file but we don't // throw an error here since it hides underlying Dart error. - if (node.returnType.type is InterfaceType) { + if (node.returnType?.type is InterfaceType) { finder = generateByTagNameFromByCheckTag( - node.returnType.type, node.toSource()); + node.returnType?.type, node.toSource()); } } diff --git a/lib/src/generators/methods/single_finder_method.g.dart b/lib/src/generators/methods/single_finder_method.g.dart index 847401fc..1be5e800 100644 --- a/lib/src/generators/methods/single_finder_method.g.dart +++ b/lib/src/generators/methods/single_finder_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.single_finder_method; @@ -26,18 +25,18 @@ class _$SingleFinderMethod extends SingleFinderMethod { final bool isNullElement; factory _$SingleFinderMethod( - [void Function(SingleFinderMethodBuilder) updates]) => + [void Function(SingleFinderMethodBuilder)? updates]) => (new SingleFinderMethodBuilder()..update(updates)).build(); _$SingleFinderMethod._( - {this.name, - this.pageObjectType, - this.finderDeclaration, - this.filterDeclarations, - this.checkerDeclarations, - this.templateType, - this.isRoot, - this.isNullElement}) + {required this.name, + required this.pageObjectType, + required this.finderDeclaration, + required this.filterDeclarations, + required this.checkerDeclarations, + required this.templateType, + required this.isRoot, + required this.isNullElement}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'SingleFinderMethod', 'name'); BuiltValueNullFieldError.checkNotNull( @@ -114,44 +113,44 @@ class SingleFinderMethodBuilder implements Builder, SingleFinderMethodBaseBuilder { - _$SingleFinderMethod _$v; + _$SingleFinderMethod? _$v; - String _name; - String get name => _$this._name; - set name(covariant String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; - String _pageObjectType; - String get pageObjectType => _$this._pageObjectType; - set pageObjectType(covariant String pageObjectType) => + String? _pageObjectType; + String? get pageObjectType => _$this._pageObjectType; + set pageObjectType(covariant String? pageObjectType) => _$this._pageObjectType = pageObjectType; - Optional _finderDeclaration; - Optional get finderDeclaration => _$this._finderDeclaration; - set finderDeclaration(covariant Optional finderDeclaration) => + Optional? _finderDeclaration; + Optional? get finderDeclaration => _$this._finderDeclaration; + set finderDeclaration(covariant Optional? finderDeclaration) => _$this._finderDeclaration = finderDeclaration; - String _filterDeclarations; - String get filterDeclarations => _$this._filterDeclarations; - set filterDeclarations(covariant String filterDeclarations) => + String? _filterDeclarations; + String? get filterDeclarations => _$this._filterDeclarations; + set filterDeclarations(covariant String? filterDeclarations) => _$this._filterDeclarations = filterDeclarations; - String _checkerDeclarations; - String get checkerDeclarations => _$this._checkerDeclarations; - set checkerDeclarations(covariant String checkerDeclarations) => + String? _checkerDeclarations; + String? get checkerDeclarations => _$this._checkerDeclarations; + set checkerDeclarations(covariant String? checkerDeclarations) => _$this._checkerDeclarations = checkerDeclarations; - Optional _templateType; - Optional get templateType => _$this._templateType; - set templateType(covariant Optional templateType) => + Optional? _templateType; + Optional? get templateType => _$this._templateType; + set templateType(covariant Optional? templateType) => _$this._templateType = templateType; - bool _isRoot; - bool get isRoot => _$this._isRoot; - set isRoot(covariant bool isRoot) => _$this._isRoot = isRoot; + bool? _isRoot; + bool? get isRoot => _$this._isRoot; + set isRoot(covariant bool? isRoot) => _$this._isRoot = isRoot; - bool _isNullElement; - bool get isNullElement => _$this._isNullElement; - set isNullElement(covariant bool isNullElement) => + bool? _isNullElement; + bool? get isNullElement => _$this._isNullElement; + set isNullElement(covariant bool? isNullElement) => _$this._isNullElement = isNullElement; SingleFinderMethodBuilder(); @@ -179,7 +178,7 @@ class SingleFinderMethodBuilder } @override - void update(void Function(SingleFinderMethodBuilder) updates) { + void update(void Function(SingleFinderMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -211,29 +210,29 @@ class SingleFinderMethodBuilder abstract class SingleFinderMethodBaseBuilder { void replace(SingleFinderMethodBase other); void update(void Function(SingleFinderMethodBaseBuilder) updates); - String get name; - set name(String name); + String? get name; + set name(String? name); - String get pageObjectType; - set pageObjectType(String pageObjectType); + String? get pageObjectType; + set pageObjectType(String? pageObjectType); - Optional get finderDeclaration; - set finderDeclaration(Optional finderDeclaration); + Optional? get finderDeclaration; + set finderDeclaration(Optional? finderDeclaration); - String get filterDeclarations; - set filterDeclarations(String filterDeclarations); + String? get filterDeclarations; + set filterDeclarations(String? filterDeclarations); - String get checkerDeclarations; - set checkerDeclarations(String checkerDeclarations); + String? get checkerDeclarations; + set checkerDeclarations(String? checkerDeclarations); - Optional get templateType; - set templateType(Optional templateType); + Optional? get templateType; + set templateType(Optional? templateType); - bool get isRoot; - set isRoot(bool isRoot); + bool? get isRoot; + set isRoot(bool? isRoot); - bool get isNullElement; - set isNullElement(bool isNullElement); + bool? get isNullElement; + set isNullElement(bool? isNullElement); } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/methods/unannotated_method.dart b/lib/src/generators/methods/unannotated_method.dart index 0fa07d8a..c263225a 100644 --- a/lib/src/generators/methods/unannotated_method.dart +++ b/lib/src/generators/methods/unannotated_method.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +35,7 @@ Optional collectUnannotatedMethod(MethodDeclaration node) { return Optional.of(UnannotatedMethod((b) => b ..name = node.name.toString() ..returnType = node.returnType.toString() - ..parameters = node.parameters.parameters + ..parameters = node.parameters?.parameters ..typeParameters = Optional.fromNullable(node.typeParameters))); } @@ -106,17 +104,17 @@ abstract class UnannotatedMethod String get _parameterNames { final required = parameters .where((p) => p.isRequired && !p.isNamed) - .map((p) => p.declaredElement.name) + .map((p) => p.declaredElement?.name) .join(', '); final named = parameters .where((p) => p.isNamed) - .map((p) => '${p.declaredElement.name}:${p.declaredElement.name}') + .map((p) => '${p.declaredElement?.name}:${p.declaredElement?.name}') .join(', '); final positional = parameters .where((p) => p.isOptionalPositional) - .map((p) => p.declaredElement.name) + .map((p) => p.declaredElement?.name) .join(', '); return _combineParameters(required, named, positional); diff --git a/lib/src/generators/methods/unannotated_method.g.dart b/lib/src/generators/methods/unannotated_method.g.dart index 02a72b49..02274b75 100644 --- a/lib/src/generators/methods/unannotated_method.g.dart +++ b/lib/src/generators/methods/unannotated_method.g.dart @@ -1,5 +1,4 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 part of pageloader.unannotated_method; @@ -18,11 +17,14 @@ class _$UnannotatedMethod extends UnannotatedMethod { final Optional typeParameters; factory _$UnannotatedMethod( - [void Function(UnannotatedMethodBuilder) updates]) => + [void Function(UnannotatedMethodBuilder)? updates]) => (new UnannotatedMethodBuilder()..update(updates)).build(); _$UnannotatedMethod._( - {this.name, this.returnType, this.parameters, this.typeParameters}) + {required this.name, + required this.returnType, + required this.parameters, + required this.typeParameters}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'UnannotatedMethod', 'name'); BuiltValueNullFieldError.checkNotNull( @@ -72,24 +74,24 @@ class _$UnannotatedMethod extends UnannotatedMethod { class UnannotatedMethodBuilder implements Builder { - _$UnannotatedMethod _$v; + _$UnannotatedMethod? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _returnType; - String get returnType => _$this._returnType; - set returnType(String returnType) => _$this._returnType = returnType; + String? _returnType; + String? get returnType => _$this._returnType; + set returnType(String? returnType) => _$this._returnType = returnType; - List _parameters; - List get parameters => _$this._parameters; - set parameters(List parameters) => + List? _parameters; + List? get parameters => _$this._parameters; + set parameters(List? parameters) => _$this._parameters = parameters; - Optional _typeParameters; - Optional get typeParameters => _$this._typeParameters; - set typeParameters(Optional typeParameters) => + Optional? _typeParameters; + Optional? get typeParameters => _$this._typeParameters; + set typeParameters(Optional? typeParameters) => _$this._typeParameters = typeParameters; UnannotatedMethodBuilder(); @@ -113,7 +115,7 @@ class UnannotatedMethodBuilder } @override - void update(void Function(UnannotatedMethodBuilder) updates) { + void update(void Function(UnannotatedMethodBuilder)? updates) { if (updates != null) updates(this); } @@ -134,4 +136,4 @@ class UnannotatedMethodBuilder } } -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new +// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/lib/src/generators/pageobject_generator.dart b/lib/src/generators/pageobject_generator.dart index b5bad79f..17bb3419 100644 --- a/lib/src/generators/pageobject_generator.dart +++ b/lib/src/generators/pageobject_generator.dart @@ -1,5 +1,3 @@ -// @dart = 2.9 - // Copyright 2017 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,9 +48,9 @@ class PageObjectGenerator extends GeneratorForAnnotation { try { final resolver = buildStep.resolver; library = await resolver - .libraryFor(await resolver.assetIdForElement(element.library)); + .libraryFor(await resolver.assetIdForElement(element)); final session = library.session; - resolvedLibrary = await session.getResolvedLibraryByElement2(library) + resolvedLibrary = await session.getResolvedLibraryByElement(library) as ResolvedLibraryResult; break; } catch (_) { @@ -64,7 +62,7 @@ class PageObjectGenerator extends GeneratorForAnnotation { } } - final annotatedNode = resolvedLibrary.getElementDeclaration(element).node; + final annotatedNode = resolvedLibrary.getElementDeclaration(element)?.node; final poAnnotation = getPageObjectAnnotation(annotation); final nullSafety = NullSafety((b) => b..enabled = library.isNonNullableByDefault); @@ -104,7 +102,7 @@ class PageObjectGenerator extends GeneratorForAnnotation { // Run check to make sure PO is not extending another PO. // Only mixins are allowed. - if (poExtendsAnotherPo(declaration.declaredElement)) { + if (poExtendsAnotherPo(declaration.declaredElement!)) { throw Exception('******************\n\n' 'Errors detected during code generation:\n\n' "PageObject class '${declaration.name.name}' is extending another " @@ -115,8 +113,8 @@ class PageObjectGenerator extends GeneratorForAnnotation { // Run check to make sure if PO has any factory constructor, it must has // a default constructor as well. - if (hasFactoryConstructor(declaration.declaredElement) && - !hasDefaultConstructor(declaration.declaredElement)) { + if (hasFactoryConstructor(declaration.declaredElement!) && + !hasDefaultConstructor(declaration.declaredElement!)) { throw Exception('******************\n\n' 'Errors detected during code generation:\n\n' "PageObject class '${declaration.name.name}' has a factory constructor" @@ -126,8 +124,8 @@ class PageObjectGenerator extends GeneratorForAnnotation { // If PageObject has constructor, define constructor class with root // and start constructor. - if (hasPoConstructors(declaration.declaredElement)) { - final withs = getMixins(declaration.declaredElement, signatureArgs); + if (hasPoConstructors(declaration.declaredElement!)) { + final withs = getMixins(declaration.declaredElement!, signatureArgs); constructorBuffer.write(''' class \$$signature extends $signatureArgs with ${withs.map((w) => '\$\$$w').join(', ')} { @@ -136,13 +134,13 @@ class PageObjectGenerator extends GeneratorForAnnotation { // Default tag associated with this PO if @CheckTag or @EnsureTag is // present. - String defaultTag; + late String defaultTag; // Generate the 'create' constructor. // If @EnsureTag used, we add finder to constructor. Otherwise // set current root as the passed 'currentContext'. - final ensureTag = core.getEnsureTag(declaration); + final ensureTag = core.getEnsureTag(declaration as ClassDeclaration); if (ensureTag.isPresent) { constructorBuffer.write('${core.root} = currentContext.createElement' '(${core.generateAnnotationDeclaration(ensureTag.value)}, ' @@ -213,9 +211,7 @@ class PageObjectGenerator extends GeneratorForAnnotation { // Given , returns this exactly. String _generateTypeParameters(ClassOrMixinDeclaration declaration) => - declaration.typeParameters != null - ? declaration.typeParameters.toSource() - : ''; + declaration.typeParameters?.toSource() ?? ''; // Given , returns . String _generateTypeArguments(ClassOrMixinDeclaration declaration) { @@ -223,8 +219,8 @@ class PageObjectGenerator extends GeneratorForAnnotation { return ''; } final typeArguments = - declaration.typeParameters.typeParameters.map((tp) => tp.name.name); - return '<${typeArguments.join(', ')}>'; + declaration.typeParameters?.typeParameters.map((tp) => tp.name.name); + return '<${typeArguments?.join(', ')}>'; } void _doErrorHandling(CollectorVisitor visitor) { @@ -252,7 +248,7 @@ PageObject getPageObjectAnnotation(ConstantReader annotation) { final code = annotation.peek('code'); return PageObject( code: code?.mapValue - ?.map((k, v) => MapEntry(k.toStringValue(), v.toStringValue()))); + .map((k, v) => MapEntry(k!.toStringValue()!, v!.toStringValue()!))); } /// Generates the with clause for the generated constructor code. @@ -265,7 +261,8 @@ List getMixins(ClassElement mainPo, String mainSignature) { // class, we add its mixin-component to the list. if (supertype != null && !supertype.isDartCoreObject) { if (isPageObject(supertype.element)) { - withs.add(supertype.displayName); + // TODO(null-safety): use/pass builder options + withs.add(supertype.getDisplayString(withNullability: true)); } } @@ -275,7 +272,7 @@ List getMixins(ClassElement mainPo, String mainSignature) { // Generated: // class $MyPo extends MyPo with $$A_POMixin, $$B_POMixin, $$MyPo for (final mixin in mixins) { - final name = mixin.displayName; + final name = mixin.getDisplayString(withNullability: true); if (isPageObject(mixin.element)) { withs.add(name); } @@ -291,7 +288,7 @@ List getMixins(ClassElement mainPo, String mainSignature) { /// /// Assumes that the annotation has exactly one argument. String getAnnotationSingleArg(Annotation annotation) => - annotation.arguments.arguments.single.toSource(); + annotation.arguments!.arguments.single.toSource(); /// Checks if the PageObject has the standard constructors: /// abstract class MyPO { diff --git a/lib/utils.dart b/lib/utils.dart index fba237c6..8c29aec3 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -157,3 +157,5 @@ class PageLoaderArgumentError extends ArgumentError { "'$f' must be called on PageObjects or 'PageLoaderElement' type. " "Currently being called on type '$actualType'."); } + +set() {} diff --git a/pubspec.yaml b/pubspec.yaml index 8216132c..ca38de9a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: - analyzer: ^1.7.1 + analyzer: ^2.8.0 build: ^2.0.2 built_value: ^8.0.6 build_config: ^1.0.0 diff --git a/test/examples/correct/class_checks.g.dart b/test/examples/correct/class_checks.g.dart index af72272e..123212e8 100644 --- a/test/examples/correct/class_checks.g.dart +++ b/test/examples/correct/class_checks.g.dart @@ -11,135 +11,8 @@ part of 'class_checks.dart'; // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -mixin $$ChecksMixin on ChecksMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInChecksMixin() { - return {}; - } - - Map>> - testCreatorMethodsInChecksMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInChecksMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'myRoot') { - return myRoot; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInChecksMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var myRootIndex = internalIds.indexOf(this.myRoot.id); - if (myRootIndex >= 0 && myRootIndex < closestIndex) { - closestIndex = myRootIndex; - closestValue = (_) => - 'myRoot.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get myRoot { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ChecksMixin', 'myRoot'); - } - final element = $__root__; - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ChecksMixin', 'myRoot'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecks extends ClassChecks with $$ClassChecks { - PageLoaderElement $__root__; - $ClassChecks.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecks.lookup(PageLoaderSource source) => - $ClassChecks.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInClassChecks()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInClassChecks()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecks( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInClassChecks(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => 'ClassChecks\n\n${$__root__.toStringDeep()}'; -} - mixin $$ClassChecks on ClassChecks { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInClassChecks() { return {}; @@ -194,80 +67,9 @@ mixin $$ClassChecks on ClassChecks { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagChecks extends EnsureTagChecks with $$EnsureTagChecks { - PageLoaderElement $__root__; - $EnsureTagChecks.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('some-other-tag'), [], []) { - $__root__.addCheckers([EnsureTag('some-other-tag')]); - } - factory $EnsureTagChecks.lookup(PageLoaderSource source) => - $EnsureTagChecks.create(source.byTag('some-other-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEnsureTagChecks()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEnsureTagChecks()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagChecks( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInEnsureTagChecks(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-other-tag'; - String toStringDeep() => 'EnsureTagChecks\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagChecks on EnsureTagChecks { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInEnsureTagChecks() { return {}; @@ -322,95 +124,9 @@ mixin $$EnsureTagChecks on EnsureTagChecks { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecksUsingClassMixin extends ClassChecksUsingClassMixin - with $$ChecksClassMixin, $$ClassChecksUsingClassMixin { - PageLoaderElement $__root__; - $ClassChecksUsingClassMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecksUsingClassMixin.lookup(PageLoaderSource source) => - $ClassChecksUsingClassMixin.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksClassMixin()); - getters.addAll(testCreatorGettersInClassChecksUsingClassMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksClassMixin()); - methods.addAll(testCreatorMethodsInClassChecksUsingClassMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecksUsingClassMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksClassMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInClassChecksUsingClassMixin(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksClassMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => - 'ClassChecksUsingClassMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ClassChecksUsingClassMixin on ClassChecksUsingClassMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInClassChecksUsingClassMixin() { return {}; @@ -440,93 +156,9 @@ mixin $$ClassChecksUsingClassMixin on ClassChecksUsingClassMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecksUsingMixin extends ClassChecksUsingMixin - with $$ChecksMixin, $$ClassChecksUsingMixin { - PageLoaderElement $__root__; - $ClassChecksUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecksUsingMixin.lookup(PageLoaderSource source) => - $ClassChecksUsingMixin.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksMixin()); - getters.addAll(testCreatorGettersInClassChecksUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksMixin()); - methods.addAll(testCreatorMethodsInClassChecksUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecksUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInClassChecksUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => - 'ClassChecksUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ClassChecksUsingMixin on ClassChecksUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInClassChecksUsingMixin() { return {}; @@ -556,95 +188,9 @@ mixin $$ClassChecksUsingMixin on ClassChecksUsingMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagChecksUsingMixin extends EnsureTagChecksUsingMixin - with $$ChecksMixin, $$EnsureTagChecksUsingMixin { - PageLoaderElement $__root__; - $EnsureTagChecksUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('some-other-tag'), [], []) { - $__root__.addCheckers([EnsureTag('some-other-tag')]); - } - factory $EnsureTagChecksUsingMixin.lookup(PageLoaderSource source) => - $EnsureTagChecksUsingMixin.create(source.byTag('some-other-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksMixin()); - getters.addAll(testCreatorGettersInEnsureTagChecksUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksMixin()); - methods.addAll(testCreatorMethodsInEnsureTagChecksUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagChecksUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInEnsureTagChecksUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-other-tag'; - String toStringDeep() => - 'EnsureTagChecksUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagChecksUsingMixin on EnsureTagChecksUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInEnsureTagChecksUsingMixin() { return {}; @@ -676,7 +222,7 @@ mixin $$EnsureTagChecksUsingMixin on EnsureTagChecksUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$ChecksClassMixin on ChecksClassMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInChecksClassMixin() { return {}; @@ -727,3 +273,60 @@ mixin $$ChecksClassMixin on ChecksClassMixin { return returnMe; } } + +// ignore_for_file: unused_field, non_constant_identifier_names +// ignore_for_file: overridden_fields, annotate_overrides +// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package + +mixin $$ChecksMixin on ChecksMixin { + /*late*/ PageLoaderElement $__root__; + PageLoaderElement get $root => $__root__; + Map testCreatorGettersInChecksMixin() { + return {}; + } + + Map>> + testCreatorMethodsInChecksMixin() { + return {}; + } + + dynamic testCreatorInvokeMethodInChecksMixin( + String methodName, List positionalArguments, + [Map /*?*/ namedArguments]) { + if (methodName == 'myRoot') { + return myRoot; + } + throw 'METHOD NOT FOUND. This method' + ' failed to be generated during test creator codegen.'; + } + + Map) /*?*/ > findChainInChecksMixin( + List internalIds, + [String action = 'default']) { + var closestIndex = internalIds.length; + String Function(List) /*?*/ closestValue; + try { + var myRootIndex = internalIds.indexOf(this.myRoot.id); + if (myRootIndex >= 0 && myRootIndex < closestIndex) { + closestIndex = myRootIndex; + closestValue = (_) => + 'myRoot.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; + } + } catch (_) { + // Ignored. + } + return {closestIndex: closestValue}; + } + + PageLoaderElement get myRoot { + for (final __listener in $__root__.listeners) { + __listener.startPageObjectMethod('ChecksMixin', 'myRoot'); + } + final element = $__root__; + final returnMe = element; + for (final __listener in $__root__.listeners) { + __listener.endPageObjectMethod('ChecksMixin', 'myRoot'); + } + return returnMe; + } +} diff --git a/test/examples/correct/empty.g.dart b/test/examples/correct/empty.g.dart index 79c9eae2..dd4f457f 100644 --- a/test/examples/correct/empty.g.dart +++ b/test/examples/correct/empty.g.dart @@ -10,81 +10,9 @@ part of 'empty.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Empty extends Empty with $$Empty { - PageLoaderElement $__root__; - $Empty.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Empty.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Empty is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEmpty()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEmpty()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInEmpty( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInEmpty(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Empty". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Empty\n\n${$__root__.toStringDeep()}'; -} mixin $$Empty on Empty { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInEmpty() { return {}; @@ -115,7 +43,7 @@ mixin $$Empty on Empty { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$EmptyMixin on EmptyMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInEmptyMixin() { return {}; diff --git a/test/examples/correct/finders.g.dart b/test/examples/correct/finders.g.dart index 877cd981..d9d4c435 100644 --- a/test/examples/correct/finders.g.dart +++ b/test/examples/correct/finders.g.dart @@ -10,93 +10,9 @@ part of 'finders.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Finders extends Finders with $$Finders { - PageLoaderElement $__root__; - $Finders.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Finders.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Finders is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInFinders()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInFinders()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInFinders( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInFinders(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Finders". Requires @CheckTag annotation in order for "tagName" to be generated.'; - PageLoaderElement get secret { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Finders', 'secret'); - } - final returnMe = super.secret; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Finders', 'secret'); - } - return returnMe; - } - - String toStringDeep() => 'Finders\n\n${$__root__.toStringDeep()}'; -} mixin $$Finders on Finders { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInFinders() { return {}; @@ -236,90 +152,9 @@ mixin $$Finders on Finders { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckTagPO extends CheckTagPO with $$CheckTagPO { - PageLoaderElement $__root__; - $CheckTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('check-tag-po')]); - } - factory $CheckTagPO.lookup(PageLoaderSource source) => - $CheckTagPO.create(source.byTag('check-tag-po')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCheckTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCheckTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'check-tag-po'; - String toString() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CheckTagPO', 'toString'); - } - final returnMe = super.toString(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CheckTagPO', 'toString'); - } - return returnMe; - } - - String toStringDeep() => 'CheckTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$CheckTagPO on CheckTagPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInCheckTagPO() { return {}; @@ -374,95 +209,9 @@ mixin $$CheckTagPO on CheckTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $FindersUsingMixin extends FindersUsingMixin - with $$FindersMixin, $$FindersUsingMixin { - PageLoaderElement $__root__; - $FindersUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $FindersUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "FindersUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInFindersMixin()); - getters.addAll(testCreatorGettersInFindersUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInFindersMixin()); - methods.addAll(testCreatorMethodsInFindersUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInFindersUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInFindersMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInFindersUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInFindersMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "FindersUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'FindersUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$FindersUsingMixin on FindersUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInFindersUsingMixin() { return {}; @@ -494,7 +243,7 @@ mixin $$FindersUsingMixin on FindersUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$FindersMixin on FindersMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInFindersMixin() { return {}; diff --git a/test/examples/correct/generics.g.dart b/test/examples/correct/generics.g.dart deleted file mode 100644 index a876fa82..00000000 --- a/test/examples/correct/generics.g.dart +++ /dev/null @@ -1,1198 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 - -part of 'generics.dart'; - -// ************************************************************************** -// PageObjectGenerator -// ************************************************************************** - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'typeDefParameter'); - } - return returnMe; - } - - S exampleMethod(S s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'exampleMethod'); - } - final returnMe = super.exampleMethod(s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'exampleMethod'); - } - return returnMe; - } - - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} - -mixin $$Generics on Generics { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenerics() { - return {}; - } - - Map>> testCreatorMethodsInGenerics() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenerics( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - if (methodName == 'exampleMethod') { - return Function.apply(exampleMethod, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInGenerics( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckedGenerics extends CheckedGenerics with $$CheckedGenerics { - PageLoaderElement $__root__; - $CheckedGenerics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('checked-generics')]); - } - factory $CheckedGenerics.lookup(PageLoaderSource source) => - $CheckedGenerics.create(source.byTag('checked-generics')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckedGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckedGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCheckedGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCheckedGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'checked-generics'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CheckedGenerics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CheckedGenerics', 'typeDefParameter'); - } - return returnMe; - } - - String toStringDeep() => 'CheckedGenerics\n\n${$__root__.toStringDeep()}'; -} - -mixin $$CheckedGenerics on CheckedGenerics { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInCheckedGenerics() { - return {}; - } - - Map>> - testCreatorMethodsInCheckedGenerics() { - return {}; - } - - dynamic testCreatorInvokeMethodInCheckedGenerics( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInCheckedGenerics( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericPair extends GenericPair with $$GenericPair { - PageLoaderElement $__root__; - $GenericPair.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericPair.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericPair is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericPair()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericPair()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenericPair( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenericPair(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericPair". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Map exampleMethodMap(R r, S s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('GenericPair', 'exampleMethodMap'); - } - final returnMe = super.exampleMethodMap(r, s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('GenericPair', 'exampleMethodMap'); - } - return returnMe; - } - - String toStringDeep() => 'GenericPair\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericPair on GenericPair { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPair() { - return {}; - } - - Map>> - testCreatorMethodsInGenericPair() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPair( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'exampleMethodMap') { - return Function.apply( - exampleMethodMap, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInGenericPair( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPo extends RootPo with $$RootPo { - PageLoaderElement $__root__; - $RootPo.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPo.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPo is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPo()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPo()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRootPo( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRootPo(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPo". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPo\n\n${$__root__.toStringDeep()}'; -} - -mixin $$RootPo on RootPo { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPo() { - return {}; - } - - Map>> testCreatorMethodsInRootPo() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPo( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'generics') { - return generics; - } - if (methodName == 'checkedGenerics') { - return checkedGenerics; - } - if (methodName == 'genericsList') { - return genericsList; - } - if (methodName == 'checkedGenericsList') { - return checkedGenericsList; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInRootPo( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var genericsElement = this.generics as dynamic; - var genericsIndex = - internalIds.indexOf(genericsElement.$__root__.id as String); - if (genericsIndex >= 0 && genericsIndex < closestIndex) { - closestIndex = genericsIndex; - closestValue = (ids) => - 'generics.${genericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var checkedGenericsElement = this.checkedGenerics as dynamic; - var checkedGenericsIndex = - internalIds.indexOf(checkedGenericsElement.$__root__.id as String); - if (checkedGenericsIndex >= 0 && checkedGenericsIndex < closestIndex) { - closestIndex = checkedGenericsIndex; - closestValue = (ids) => - 'checkedGenerics.${checkedGenericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - final genericsListElements = this.genericsList; - for (var elementIter = 0; - elementIter < genericsListElements.length; - elementIter++) { - try { - var genericsListElement = genericsListElements[elementIter] as dynamic; - var genericsListIndex = - internalIds.indexOf(genericsListElement.$__root__.id as String); - if (genericsListIndex >= 0 && genericsListIndex < closestIndex) { - closestIndex = genericsListIndex; - closestValue = (ids) => - 'genericsList[$elementIter].${genericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkedGenericsListElements = this.checkedGenericsList; - for (var elementIter = 0; - elementIter < checkedGenericsListElements.length; - elementIter++) { - try { - var checkedGenericsListElement = - checkedGenericsListElements[elementIter] as dynamic; - var checkedGenericsListIndex = internalIds - .indexOf(checkedGenericsListElement.$__root__.id as String); - if (checkedGenericsListIndex >= 0 && - checkedGenericsListIndex < closestIndex) { - closestIndex = checkedGenericsListIndex; - closestValue = (ids) => - 'checkedGenericsList[$elementIter].${checkedGenericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Generics get generics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'generics'); - } - final element = $__root__.createElement(ByTagName('x'), [], []); - final returnMe = Generics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'generics'); - } - return returnMe; - } - - CheckedGenerics get checkedGenerics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'checkedGenerics'); - } - final element = - $__root__.createElement(ByTagName('checked-generics'), [], []); - final returnMe = CheckedGenerics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'checkedGenerics'); - } - return returnMe; - } - - PageObjectList> get genericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'genericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('y'), [], []), - (PageLoaderElement e) => Generics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'genericsList'); - } - return returnMe; - } - - PageObjectList> get checkedGenericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'checkedGenericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('checked-generics'), [], []), - (PageLoaderElement e) => CheckedGenerics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'checkedGenericsList'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericsUsingMixin extends GenericsUsingMixin - with $$GenericsMixin, $$GenericsUsingMixin { - PageLoaderElement $__root__; - $GenericsUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericsUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericsUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericsMixin()); - getters.addAll(testCreatorGettersInGenericsUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericsMixin()); - methods.addAll(testCreatorMethodsInGenericsUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenericsUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInGenericsMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenericsUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInGenericsMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericsUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'GenericsUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericsUsingMixin on GenericsUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericsUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericsUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericsUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInGenericsUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$GenericsMixin on GenericsMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericsMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericsMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericsMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - if (methodName == 'exampleMethod') { - return Function.apply(exampleMethod, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInGenericsMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericPairUsingMixin extends GenericPairUsingMixin - with $$GenericPairMixin, $$GenericPairUsingMixin { - PageLoaderElement $__root__; - $GenericPairUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericPairUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericPairUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericPairMixin()); - getters.addAll(testCreatorGettersInGenericPairUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericPairMixin()); - methods.addAll(testCreatorMethodsInGenericPairUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenericPairUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInGenericPairMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenericPairUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInGenericPairMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericPairUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'GenericPairUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericPairUsingMixin on GenericPairUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPairUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericPairUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPairUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > - findChainInGenericPairUsingMixin(List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$GenericPairMixin on GenericPairMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPairMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericPairMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPairMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'exampleMethodMap') { - return Function.apply( - exampleMethodMap, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInGenericPairMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPoUsingMixin extends RootPoUsingMixin - with $$RootPoMixin, $$RootPoUsingMixin { - PageLoaderElement $__root__; - $RootPoUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPoUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPoUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPoMixin()); - getters.addAll(testCreatorGettersInRootPoUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPoMixin()); - methods.addAll(testCreatorMethodsInRootPoUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRootPoUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRootPoMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRootPoUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInRootPoMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPoUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPoUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$RootPoUsingMixin on RootPoUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPoUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInRootPoUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPoUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInRootPoUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$RootPoMixin on RootPoMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPoMixin() { - return {}; - } - - Map>> - testCreatorMethodsInRootPoMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPoMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'generics') { - return generics; - } - if (methodName == 'checkedGenerics') { - return checkedGenerics; - } - if (methodName == 'genericsList') { - return genericsList; - } - if (methodName == 'checkedGenericsList') { - return checkedGenericsList; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInRootPoMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var genericsElement = this.generics as dynamic; - var genericsIndex = - internalIds.indexOf(genericsElement.$__root__.id as String); - if (genericsIndex >= 0 && genericsIndex < closestIndex) { - closestIndex = genericsIndex; - closestValue = (ids) => - 'generics.${genericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var checkedGenericsElement = this.checkedGenerics as dynamic; - var checkedGenericsIndex = - internalIds.indexOf(checkedGenericsElement.$__root__.id as String); - if (checkedGenericsIndex >= 0 && checkedGenericsIndex < closestIndex) { - closestIndex = checkedGenericsIndex; - closestValue = (ids) => - 'checkedGenerics.${checkedGenericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - final genericsListElements = this.genericsList; - for (var elementIter = 0; - elementIter < genericsListElements.length; - elementIter++) { - try { - var genericsListElement = genericsListElements[elementIter] as dynamic; - var genericsListIndex = - internalIds.indexOf(genericsListElement.$__root__.id as String); - if (genericsListIndex >= 0 && genericsListIndex < closestIndex) { - closestIndex = genericsListIndex; - closestValue = (ids) => - 'genericsList[$elementIter].${genericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkedGenericsListElements = this.checkedGenericsList; - for (var elementIter = 0; - elementIter < checkedGenericsListElements.length; - elementIter++) { - try { - var checkedGenericsListElement = - checkedGenericsListElements[elementIter] as dynamic; - var checkedGenericsListIndex = internalIds - .indexOf(checkedGenericsListElement.$__root__.id as String); - if (checkedGenericsListIndex >= 0 && - checkedGenericsListIndex < closestIndex) { - closestIndex = checkedGenericsListIndex; - closestValue = (ids) => - 'checkedGenericsList[$elementIter].${checkedGenericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Generics get generics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'generics'); - } - final element = $__root__.createElement(ByTagName('x'), [], []); - final returnMe = Generics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'generics'); - } - return returnMe; - } - - CheckedGenerics get checkedGenerics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'checkedGenerics'); - } - final element = - $__root__.createElement(ByTagName('checked-generics'), [], []); - final returnMe = CheckedGenerics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'checkedGenerics'); - } - return returnMe; - } - - PageObjectList> get genericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'genericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('y'), [], []), - (PageLoaderElement e) => Generics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'genericsList'); - } - return returnMe; - } - - PageObjectList> get checkedGenericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'checkedGenericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('checked-generics'), [], []), - (PageLoaderElement e) => CheckedGenerics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'checkedGenericsList'); - } - return returnMe; - } -} diff --git a/test/examples/correct/iterables.g.dart b/test/examples/correct/iterables.g.dart deleted file mode 100644 index 7992023c..00000000 --- a/test/examples/correct/iterables.g.dart +++ /dev/null @@ -1,729 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 - -part of 'iterables.dart'; - -// ************************************************************************** -// PageObjectGenerator -// ************************************************************************** - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Iterables extends Iterables with $$Iterables { - PageLoaderElement $__root__; - $Iterables.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Iterables.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Iterables is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInIterables()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInIterables()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInIterables( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInIterables(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Iterables". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Iterables\n\n${$__root__.toStringDeep()}'; -} - -mixin $$Iterables on Iterables { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInIterables() { - return {}; - } - - Map>> - testCreatorMethodsInIterables() { - return {}; - } - - dynamic testCreatorInvokeMethodInIterables( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'basics') { - return basics; - } - if (methodName == 'nested') { - return nested; - } - if (methodName == 'checkTagPO') { - return checkTagPO; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInIterables( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } - - PageObjectIterable get basics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Iterables', 'basics'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Iterables', 'basics'); - } - return returnMe; - } - - PageObjectIterable get nested { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Iterables', 'nested'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerObject.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Iterables', 'nested'); - } - return returnMe; - } - - PageObjectIterable get checkTagPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Iterables', 'checkTagPO'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Iterables', 'checkTagPO'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerObject extends InnerObject with $$InnerObject { - PageLoaderElement $__root__; - $InnerObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInInnerObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInInnerObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'InnerObject\n\n${$__root__.toStringDeep()}'; -} - -mixin $$InnerObject on InnerObject { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerObject() { - return {}; - } - - Map>> - testCreatorMethodsInInnerObject() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerObject( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'single') { - return single; - } - if (methodName == 'innerIterable') { - return innerIterable; - } - if (methodName == 'innerCheckTagPO') { - return innerCheckTagPO; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInInnerObject( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var singleIndex = internalIds.indexOf(this.single.id); - if (singleIndex >= 0 && singleIndex < closestIndex) { - closestIndex = singleIndex; - closestValue = (_) => - 'single.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get single { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObject', 'single'); - } - final element = $__root__.createElement(ByCss('single'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObject', 'single'); - } - return returnMe; - } - - PageObjectIterable get innerIterable { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObject', 'innerIterable'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('nested-iterable'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObject', 'innerIterable'); - } - return returnMe; - } - - PageObjectIterable get innerCheckTagPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObject', 'innerCheckTagPO'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObject', 'innerCheckTagPO'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $IterablesUsingMixin extends IterablesUsingMixin - with $$IterablesMixin, $$IterablesUsingMixin { - PageLoaderElement $__root__; - $IterablesUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $IterablesUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "IterablesUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInIterablesMixin()); - getters.addAll(testCreatorGettersInIterablesUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInIterablesMixin()); - methods.addAll(testCreatorMethodsInIterablesUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInIterablesUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInIterablesMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInIterablesUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInIterablesMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "IterablesUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'IterablesUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$IterablesUsingMixin on IterablesUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInIterablesUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInIterablesUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInIterablesUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInIterablesUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$IterablesMixin on IterablesMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInIterablesMixin() { - return {}; - } - - Map>> - testCreatorMethodsInIterablesMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInIterablesMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'basics') { - return basics; - } - if (methodName == 'nested') { - return nested; - } - if (methodName == 'checkTagPO') { - return checkTagPO; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInIterablesMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } - - PageObjectIterable get basics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('IterablesMixin', 'basics'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('IterablesMixin', 'basics'); - } - return returnMe; - } - - PageObjectIterable get nested { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('IterablesMixin', 'nested'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerObjectUsingMixin.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('IterablesMixin', 'nested'); - } - return returnMe; - } - - PageObjectIterable get checkTagPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('IterablesMixin', 'checkTagPO'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('IterablesMixin', 'checkTagPO'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerObjectUsingMixin extends InnerObjectUsingMixin - with $$InnerObjectMixin, $$InnerObjectUsingMixin { - PageLoaderElement $__root__; - $InnerObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerObjectMixin()); - getters.addAll(testCreatorGettersInInnerObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerObjectMixin()); - methods.addAll(testCreatorMethodsInInnerObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInInnerObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInInnerObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInInnerObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInInnerObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'InnerObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$InnerObjectUsingMixin on InnerObjectUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerObjectUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInInnerObjectUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerObjectUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > - findChainInInnerObjectUsingMixin(List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$InnerObjectMixin on InnerObjectMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerObjectMixin() { - return {}; - } - - Map>> - testCreatorMethodsInInnerObjectMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerObjectMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'single') { - return single; - } - if (methodName == 'innerIterable') { - return innerIterable; - } - if (methodName == 'innerCheckTagPO') { - return innerCheckTagPO; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInInnerObjectMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var singleIndex = internalIds.indexOf(this.single.id); - if (singleIndex >= 0 && singleIndex < closestIndex) { - closestIndex = singleIndex; - closestValue = (_) => - 'single.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get single { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObjectMixin', 'single'); - } - final element = $__root__.createElement(ByCss('single'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObjectMixin', 'single'); - } - return returnMe; - } - - PageObjectIterable get innerIterable { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObjectMixin', 'innerIterable'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByCss('nested-iterable'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObjectMixin', 'innerIterable'); - } - return returnMe; - } - - PageObjectIterable get innerCheckTagPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerObjectMixin', 'innerCheckTagPO'); - } - final returnMe = PageObjectIterable( - $__root__.createIterable(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerObjectMixin', 'innerCheckTagPO'); - } - return returnMe; - } -} diff --git a/test/examples/correct/list.g.dart b/test/examples/correct/list.g.dart deleted file mode 100644 index b1eb9ff1..00000000 --- a/test/examples/correct/list.g.dart +++ /dev/null @@ -1,898 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 - -part of 'list.dart'; - -// ************************************************************************** -// PageObjectGenerator -// ************************************************************************** - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Lists extends Lists with $$Lists { - PageLoaderElement $__root__; - $Lists.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Lists.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Lists is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInLists()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInLists()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInLists( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInLists(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Lists". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Lists\n\n${$__root__.toStringDeep()}'; -} - -mixin $$Lists on Lists { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInLists() { - return {}; - } - - Map>> testCreatorMethodsInLists() { - return {}; - } - - dynamic testCreatorInvokeMethodInLists( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'basics') { - return basics; - } - if (methodName == 'nested') { - return nested; - } - if (methodName == 'checkTagPO') { - return checkTagPO; - } - if (methodName == 'basicsSync') { - return basicsSync; - } - if (methodName == 'nestedSync') { - return nestedSync; - } - if (methodName == 'checkTagPOSync') { - return checkTagPOSync; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInLists( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - final nestedSyncElements = this.nestedSync; - for (var elementIter = 0; - elementIter < nestedSyncElements.length; - elementIter++) { - try { - var nestedSyncElement = nestedSyncElements[elementIter] as dynamic; - var nestedSyncIndex = - internalIds.indexOf(nestedSyncElement.$__root__.id as String); - if (nestedSyncIndex >= 0 && nestedSyncIndex < closestIndex) { - closestIndex = nestedSyncIndex; - closestValue = (ids) => - 'nestedSync[$elementIter].${nestedSyncElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkTagPOSyncElements = this.checkTagPOSync; - for (var elementIter = 0; - elementIter < checkTagPOSyncElements.length; - elementIter++) { - try { - var checkTagPOSyncElement = - checkTagPOSyncElements[elementIter] as dynamic; - var checkTagPOSyncIndex = - internalIds.indexOf(checkTagPOSyncElement.$__root__.id as String); - if (checkTagPOSyncIndex >= 0 && checkTagPOSyncIndex < closestIndex) { - closestIndex = checkTagPOSyncIndex; - closestValue = (ids) => - 'checkTagPOSync[$elementIter].${checkTagPOSyncElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final basicsSyncElements = this.basicsSync; - for (var elementIter = 0; - elementIter < basicsSyncElements.length; - elementIter++) { - try { - var basicsSyncIndex = - internalIds.indexOf(basicsSyncElements[elementIter].id); - if (basicsSyncIndex >= 0 && basicsSyncIndex < closestIndex) { - closestIndex = basicsSyncIndex; - closestValue = (_) => - 'basicsSync[$elementIter].${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Future> get basics async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'basics'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'basics'); - } - return returnMe; - } - - Future> get nested async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'nested'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerListObject.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'nested'); - } - return returnMe; - } - - Future> get checkTagPO async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'checkTagPO'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'checkTagPO'); - } - return returnMe; - } - - PageObjectList get basicsSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'basicsSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'basicsSync'); - } - return returnMe; - } - - PageObjectList get nestedSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'nestedSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerListObject.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'nestedSync'); - } - return returnMe; - } - - PageObjectList get checkTagPOSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Lists', 'checkTagPOSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Lists', 'checkTagPOSync'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerListObject extends InnerListObject with $$InnerListObject { - PageLoaderElement $__root__; - $InnerListObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerListObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerListObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerListObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerListObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInInnerListObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInInnerListObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerListObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'InnerListObject\n\n${$__root__.toStringDeep()}'; -} - -mixin $$InnerListObject on InnerListObject { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerListObject() { - return {}; - } - - Map>> - testCreatorMethodsInInnerListObject() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerListObject( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'single') { - return single; - } - if (methodName == 'innerIterable') { - return innerIterable; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInInnerListObject( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var singleIndex = internalIds.indexOf(this.single.id); - if (singleIndex >= 0 && singleIndex < closestIndex) { - closestIndex = singleIndex; - closestValue = (_) => - 'single.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get single { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerListObject', 'single'); - } - final element = $__root__.createElement(ByCss('single'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerListObject', 'single'); - } - return returnMe; - } - - Future> get innerIterable async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerListObject', 'innerIterable'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested-iterable'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerListObject', 'innerIterable'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ListsUsingMixin extends ListsUsingMixin - with $$ListsMixin, $$ListsUsingMixin { - PageLoaderElement $__root__; - $ListsUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ListsUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ListsUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInListsMixin()); - getters.addAll(testCreatorGettersInListsUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInListsMixin()); - methods.addAll(testCreatorMethodsInListsUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInListsUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInListsMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInListsUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInListsMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ListsUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ListsUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$ListsUsingMixin on ListsUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInListsUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInListsUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInListsUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInListsUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$ListsMixin on ListsMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInListsMixin() { - return {}; - } - - Map>> - testCreatorMethodsInListsMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInListsMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'basics') { - return basics; - } - if (methodName == 'nested') { - return nested; - } - if (methodName == 'checkTagPO') { - return checkTagPO; - } - if (methodName == 'basicsSync') { - return basicsSync; - } - if (methodName == 'nestedSync') { - return nestedSync; - } - if (methodName == 'checkTagPOSync') { - return checkTagPOSync; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInListsMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - final nestedSyncElements = this.nestedSync; - for (var elementIter = 0; - elementIter < nestedSyncElements.length; - elementIter++) { - try { - var nestedSyncElement = nestedSyncElements[elementIter] as dynamic; - var nestedSyncIndex = - internalIds.indexOf(nestedSyncElement.$__root__.id as String); - if (nestedSyncIndex >= 0 && nestedSyncIndex < closestIndex) { - closestIndex = nestedSyncIndex; - closestValue = (ids) => - 'nestedSync[$elementIter].${nestedSyncElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkTagPOSyncElements = this.checkTagPOSync; - for (var elementIter = 0; - elementIter < checkTagPOSyncElements.length; - elementIter++) { - try { - var checkTagPOSyncElement = - checkTagPOSyncElements[elementIter] as dynamic; - var checkTagPOSyncIndex = - internalIds.indexOf(checkTagPOSyncElement.$__root__.id as String); - if (checkTagPOSyncIndex >= 0 && checkTagPOSyncIndex < closestIndex) { - closestIndex = checkTagPOSyncIndex; - closestValue = (ids) => - 'checkTagPOSync[$elementIter].${checkTagPOSyncElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final basicsSyncElements = this.basicsSync; - for (var elementIter = 0; - elementIter < basicsSyncElements.length; - elementIter++) { - try { - var basicsSyncIndex = - internalIds.indexOf(basicsSyncElements[elementIter].id); - if (basicsSyncIndex >= 0 && basicsSyncIndex < closestIndex) { - closestIndex = basicsSyncIndex; - closestValue = (_) => - 'basicsSync[$elementIter].${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Future> get basics async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'basics'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'basics'); - } - return returnMe; - } - - Future> get nested async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'nested'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerListObjectUsingMixin.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'nested'); - } - return returnMe; - } - - Future> get checkTagPO async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'checkTagPO'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'checkTagPO'); - } - return returnMe; - } - - PageObjectList get basicsSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'basicsSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('basic'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'basicsSync'); - } - return returnMe; - } - - PageObjectList get nestedSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'nestedSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested'), [], []), - (PageLoaderElement e) => InnerListObjectUsingMixin.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'nestedSync'); - } - return returnMe; - } - - PageObjectList get checkTagPOSync { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ListsMixin', 'checkTagPOSync'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('check-tag-po'), [], []), - (PageLoaderElement e) => CheckTagPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ListsMixin', 'checkTagPOSync'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerListObjectUsingMixin extends InnerListObjectUsingMixin - with $$InnerListObjectMixin, $$InnerListObjectUsingMixin { - PageLoaderElement $__root__; - $InnerListObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerListObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerListObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerListObjectMixin()); - getters.addAll(testCreatorGettersInInnerListObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerListObjectMixin()); - methods.addAll(testCreatorMethodsInInnerListObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInInnerListObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInInnerListObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInInnerListObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInInnerListObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerListObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'InnerListObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$InnerListObjectUsingMixin on InnerListObjectUsingMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerListObjectUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInInnerListObjectUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerListObjectUsingMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > - findChainInInnerListObjectUsingMixin(List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$InnerListObjectMixin on InnerListObjectMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInInnerListObjectMixin() { - return {}; - } - - Map>> - testCreatorMethodsInInnerListObjectMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInInnerListObjectMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'single') { - return single; - } - if (methodName == 'innerIterable') { - return innerIterable; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > - findChainInInnerListObjectMixin(List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var singleIndex = internalIds.indexOf(this.single.id); - if (singleIndex >= 0 && singleIndex < closestIndex) { - closestIndex = singleIndex; - closestValue = (_) => - 'single.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get single { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerListObjectMixin', 'single'); - } - final element = $__root__.createElement(ByCss('single'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerListObjectMixin', 'single'); - } - return returnMe; - } - - Future> get innerIterable async { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('InnerListObjectMixin', 'innerIterable'); - } - final returnMe = PageObjectList( - $__root__.createList(ByCss('nested-iterable'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('InnerListObjectMixin', 'innerIterable'); - } - return returnMe; - } -} diff --git a/test/examples/correct/mouse.g.dart b/test/examples/correct/mouse.g.dart index 8ba5813d..b1a38a42 100644 --- a/test/examples/correct/mouse.g.dart +++ b/test/examples/correct/mouse.g.dart @@ -10,82 +10,9 @@ part of 'mouse.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MouseObject extends MouseObject with $$MouseObject { - PageLoaderElement $__root__; - $MouseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MouseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MouseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMouseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMouseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInMouseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInMouseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MouseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'MouseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$MouseObject on MouseObject { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderMouse /*?*/ __mouse__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInMouseObject() { @@ -128,96 +55,9 @@ mixin $$MouseObject on MouseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MouseObjectUsingMixin extends MouseObjectUsingMixin - with $$MouseObjectMixin, $$MouseObjectUsingMixin { - PageLoaderElement $__root__; - $MouseObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MouseObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MouseObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMouseObjectMixin()); - getters.addAll(testCreatorGettersInMouseObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMouseObjectMixin()); - methods.addAll(testCreatorMethodsInMouseObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInMouseObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInMouseObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInMouseObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInMouseObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MouseObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'MouseObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$MouseObjectUsingMixin on MouseObjectUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInMouseObjectUsingMixin() { return {}; @@ -249,7 +89,7 @@ mixin $$MouseObjectUsingMixin on MouseObjectUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$MouseObjectMixin on MouseObjectMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderMouse /*?*/ __mouse__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInMouseObjectMixin() { diff --git a/test/examples/correct/multiple_in_file.g.dart b/test/examples/correct/multiple_in_file.g.dart index 38a6b867..4841b049 100644 --- a/test/examples/correct/multiple_in_file.g.dart +++ b/test/examples/correct/multiple_in_file.g.dart @@ -10,81 +10,9 @@ part of 'multiple_in_file.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $A extends A with $$A { - PageLoaderElement $__root__; - $A.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $A.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "A is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInA()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInA()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInA( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInA(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "A". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'A\n\n${$__root__.toStringDeep()}'; -} mixin $$A on A { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInA() { return {}; @@ -139,81 +67,9 @@ mixin $$A on A { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $B extends B with $$B { - PageLoaderElement $__root__; - $B.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $B.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "B is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInB()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInB()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInB( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInB(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "B". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'B\n\n${$__root__.toStringDeep()}'; -} mixin $$B on B { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInB() { return {}; @@ -267,81 +123,9 @@ mixin $$B on B { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $C extends C with $$C { - PageLoaderElement $__root__; - $C.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $C.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "C is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInC()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInC()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInC( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInC(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "C". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'C\n\n${$__root__.toStringDeep()}'; -} mixin $$C on C { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInC() { return {}; diff --git a/test/examples/correct/nested.g.dart b/test/examples/correct/nested.g.dart index 48d4c8a1..5a8085f9 100644 --- a/test/examples/correct/nested.g.dart +++ b/test/examples/correct/nested.g.dart @@ -10,82 +10,9 @@ part of 'nested.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Nested extends Nested with $$Nested { - PageLoaderElement $__root__; - $Nested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Nested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Nested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInNested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInNested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Nested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Nested\n\n${$__root__.toStringDeep()}'; -} mixin $$Nested on Nested { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInNested() { return {}; @@ -142,95 +69,9 @@ mixin $$Nested on Nested { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NestedUsingMixin extends NestedUsingMixin - with $$NestedMixin, $$NestedUsingMixin { - PageLoaderElement $__root__; - $NestedUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NestedUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NestedUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNestedMixin()); - getters.addAll(testCreatorGettersInNestedUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNestedMixin()); - methods.addAll(testCreatorMethodsInNestedUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInNestedUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInNestedMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInNestedUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInNestedMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NestedUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NestedUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$NestedUsingMixin on NestedUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInNestedUsingMixin() { return {}; @@ -262,7 +103,7 @@ mixin $$NestedUsingMixin on NestedUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$NestedMixin on NestedMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInNestedMixin() { return {}; diff --git a/test/examples/correct/null_element.g.dart b/test/examples/correct/null_element.g.dart index da8dc2f2..df5576db 100644 --- a/test/examples/correct/null_element.g.dart +++ b/test/examples/correct/null_element.g.dart @@ -10,82 +10,9 @@ part of 'null_element.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRoot extends ParentRoot with $$ParentRoot { - PageLoaderElement $__root__; - $ParentRoot.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRoot.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRoot is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInParentRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInParentRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRoot". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ParentRoot\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRoot on ParentRoot { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParentRoot() { return {}; @@ -188,82 +115,9 @@ mixin $$ParentRoot on ParentRoot { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NullPO extends NullPO with $$NullPO { - PageLoaderElement $__root__; - $NullPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NullPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NullPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNullPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNullPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInNullPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInNullPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NullPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NullPO\n\n${$__root__.toStringDeep()}'; -} mixin $$NullPO on NullPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInNullPO() { return {}; @@ -292,82 +146,9 @@ mixin $$NullPO on NullPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} mixin $$Generics on Generics { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInGenerics() { return {}; diff --git a/test/examples/correct/parameters.g.dart b/test/examples/correct/parameters.g.dart index af777172..8adaaa26 100644 --- a/test/examples/correct/parameters.g.dart +++ b/test/examples/correct/parameters.g.dart @@ -10,136 +10,9 @@ part of 'parameters.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Parameters extends Parameters with $$Parameters { - PageLoaderElement $__root__; - $Parameters.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Parameters.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Parameters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParameters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParameters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInParameters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInParameters(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Parameters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String testOptionalPositionalParam( - [String first = 'a', String second = 'b']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testOptionalPositionalParam'); - } - final returnMe = super.testOptionalPositionalParam(first, second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testOptionalPositionalParam'); - } - return returnMe; - } - - String testMixedOptionalPositionalParam(String x, - [String first = 'a', String second = 'b']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testMixedOptionalPositionalParam'); - } - final returnMe = super.testMixedOptionalPositionalParam(x, first, second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testMixedOptionalPositionalParam'); - } - return returnMe; - } - - String testOptionalNamedParam({String first = 'a', String second = 'b'}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Parameters', 'testOptionalNamedParam'); - } - final returnMe = super.testOptionalNamedParam(first: first, second: second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Parameters', 'testOptionalNamedParam'); - } - return returnMe; - } - - String testMixedOptionalNamedParam(String x, - {String first = 'a', String second = 'b'}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testMixedOptionalNamedParam'); - } - final returnMe = - super.testMixedOptionalNamedParam(x, first: first, second: second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testMixedOptionalNamedParam'); - } - return returnMe; - } - - String toStringDeep() => 'Parameters\n\n${$__root__.toStringDeep()}'; -} mixin $$Parameters on Parameters { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParameters() { return {}; @@ -185,96 +58,9 @@ mixin $$Parameters on Parameters { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParametersUsingMixin extends ParametersUsingMixin - with $$ParametersMixin, $$ParametersUsingMixin { - PageLoaderElement $__root__; - $ParametersUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParametersUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParametersUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParametersMixin()); - getters.addAll(testCreatorGettersInParametersUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParametersMixin()); - methods.addAll(testCreatorMethodsInParametersUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInParametersUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInParametersMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInParametersUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInParametersMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParametersUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'ParametersUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ParametersUsingMixin on ParametersUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParametersUsingMixin() { return {}; @@ -306,7 +92,7 @@ mixin $$ParametersUsingMixin on ParametersUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$ParametersMixin on ParametersMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParametersMixin() { return {}; diff --git a/test/examples/correct/root.g.dart b/test/examples/correct/root.g.dart index aa98f882..f72e79e6 100644 --- a/test/examples/correct/root.g.dart +++ b/test/examples/correct/root.g.dart @@ -10,82 +10,9 @@ part of 'root.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRoot extends ParentRoot with $$ParentRoot { - PageLoaderElement $__root__; - $ParentRoot.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRoot.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRoot is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInParentRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInParentRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRoot". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ParentRoot\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRoot on ParentRoot { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParentRoot() { return {}; @@ -141,81 +68,9 @@ mixin $$ParentRoot on ParentRoot { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Root extends Root with $$Root { - PageLoaderElement $__root__; - $Root.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Root.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Root is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Root". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Root\n\n${$__root__.toStringDeep()}'; -} mixin $$Root on Root { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRoot() { return {}; @@ -294,96 +149,9 @@ mixin $$Root on Root { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRootUsingMixin extends ParentRootUsingMixin - with $$ParentRootMixin, $$ParentRootUsingMixin { - PageLoaderElement $__root__; - $ParentRootUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRootUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRootUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRootMixin()); - getters.addAll(testCreatorGettersInParentRootUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRootMixin()); - methods.addAll(testCreatorMethodsInParentRootUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInParentRootUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInParentRootMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInParentRootUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInParentRootMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRootUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'ParentRootUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRootUsingMixin on ParentRootUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParentRootUsingMixin() { return {}; @@ -415,7 +183,7 @@ mixin $$ParentRootUsingMixin on ParentRootUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$ParentRootMixin on ParentRootMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInParentRootMixin() { return {}; @@ -471,95 +239,9 @@ mixin $$ParentRootMixin on ParentRootMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootUsingMixin extends RootUsingMixin - with $$RootMixin, $$RootUsingMixin { - PageLoaderElement $__root__; - $RootUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootMixin()); - getters.addAll(testCreatorGettersInRootUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootMixin()); - methods.addAll(testCreatorMethodsInRootUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRootUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRootMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRootUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInRootMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$RootUsingMixin on RootUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRootUsingMixin() { return {}; @@ -591,7 +273,7 @@ mixin $$RootUsingMixin on RootUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$RootMixin on RootMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRootMixin() { return {}; diff --git a/test/examples/correct/unannotated.g.dart b/test/examples/correct/unannotated.g.dart index e8ec4390..f268ee27 100644 --- a/test/examples/correct/unannotated.g.dart +++ b/test/examples/correct/unannotated.g.dart @@ -10,181 +10,9 @@ part of 'unannotated.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Unannotated extends Unannotated with $$Unannotated { - PageLoaderElement $__root__; - $Unannotated.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Unannotated.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Unannotated is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInUnannotated()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInUnannotated()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInUnannotated( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInUnannotated(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Unannotated". Requires @CheckTag annotation in order for "tagName" to be generated.'; - bool get isFieldSet { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'isFieldSet'); - } - final returnMe = super.isFieldSet; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'isFieldSet'); - } - return returnMe; - } - - set myField(bool setValue) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'myField'); - } - super.myField = setValue; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'myField'); - } - return; - } - - String noParameters() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'noParameters'); - } - final returnMe = super.noParameters(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'noParameters'); - } - return returnMe; - } - - String _privateMethod(String s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', '_privateMethod'); - } - final returnMe = super._privateMethod(s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', '_privateMethod'); - } - return returnMe; - } - - String oneParameter(String privateMe) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'oneParameter'); - } - final returnMe = super.oneParameter(privateMe); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'oneParameter'); - } - return returnMe; - } - - int twoParameters(int a, int b) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'twoParameters'); - } - final returnMe = super.twoParameters(a, b); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'twoParameters'); - } - return returnMe; - } - - String typeDefParameter(MyTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'typeDefParameter'); - } - return returnMe; - } - - void noReturnType() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'noReturnType'); - } - super.noReturnType(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'noReturnType'); - } - return; - } - - List generateTypedList() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'generateTypedList'); - } - final returnMe = super.generateTypedList(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'generateTypedList'); - } - return returnMe; - } - - String toStringDeep() => 'Unannotated\n\n${$__root__.toStringDeep()}'; -} mixin $$Unannotated on Unannotated { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInUnannotated() { return { @@ -239,96 +67,9 @@ mixin $$Unannotated on Unannotated { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $UnannotatedUsingMixin extends UnannotatedUsingMixin - with $$UnannotatedMixin, $$UnannotatedUsingMixin { - PageLoaderElement $__root__; - $UnannotatedUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $UnannotatedUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "UnannotatedUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInUnannotatedMixin()); - getters.addAll(testCreatorGettersInUnannotatedUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInUnannotatedMixin()); - methods.addAll(testCreatorMethodsInUnannotatedUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInUnannotatedUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInUnannotatedMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInUnannotatedUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInUnannotatedMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "UnannotatedUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'UnannotatedUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$UnannotatedUsingMixin on UnannotatedUsingMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInUnannotatedUsingMixin() { return {}; @@ -360,7 +101,7 @@ mixin $$UnannotatedUsingMixin on UnannotatedUsingMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$UnannotatedMixin on UnannotatedMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInUnannotatedMixin() { return { diff --git a/test/examples/correct_null_safety/class_checks.g.dart b/test/examples/correct_null_safety/class_checks.g.dart index 5c703b88..4cc8e213 100644 --- a/test/examples/correct_null_safety/class_checks.g.dart +++ b/test/examples/correct_null_safety/class_checks.g.dart @@ -10,131 +10,6 @@ part of 'class_checks.dart'; // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -mixin $$ChecksMixin on ChecksMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInChecksMixin() { - return {}; - } - - Map>> testCreatorMethodsInChecksMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInChecksMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'myRoot') { - return myRoot; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInChecksMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - try { - var myRootIndex = internalIds.indexOf(this.myRoot.id); - if (myRootIndex >= 0 && myRootIndex < closestIndex) { - closestIndex = myRootIndex; - closestValue = (_) => - 'myRoot.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get myRoot { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ChecksMixin', 'myRoot'); - } - final element = $__root__; - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ChecksMixin', 'myRoot'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecks extends ClassChecks with $$ClassChecks { - PageLoaderElement $__root__; - $ClassChecks.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecks.lookup(PageLoaderSource source) => - $ClassChecks.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInClassChecks()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInClassChecks()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecks( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInClassChecks(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => 'ClassChecks\n\n${$__root__.toStringDeep()}'; -} - mixin $$ClassChecks on ClassChecks { late PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; @@ -190,76 +65,6 @@ mixin $$ClassChecks on ClassChecks { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagChecks extends EnsureTagChecks with $$EnsureTagChecks { - PageLoaderElement $__root__; - $EnsureTagChecks.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('some-other-tag'), [], []) { - $__root__.addCheckers([EnsureTag('some-other-tag')]); - } - factory $EnsureTagChecks.lookup(PageLoaderSource source) => - $EnsureTagChecks.create(source.byTag('some-other-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEnsureTagChecks()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEnsureTagChecks()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagChecks( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInEnsureTagChecks(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-other-tag'; - String toStringDeep() => 'EnsureTagChecks\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagChecks on EnsureTagChecks { late PageLoaderElement $__root__; @@ -317,91 +122,6 @@ mixin $$EnsureTagChecks on EnsureTagChecks { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecksUsingClassMixin extends ClassChecksUsingClassMixin - with $$ChecksClassMixin, $$ClassChecksUsingClassMixin { - PageLoaderElement $__root__; - $ClassChecksUsingClassMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecksUsingClassMixin.lookup(PageLoaderSource source) => - $ClassChecksUsingClassMixin.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksClassMixin()); - getters.addAll(testCreatorGettersInClassChecksUsingClassMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksClassMixin()); - methods.addAll(testCreatorMethodsInClassChecksUsingClassMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecksUsingClassMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksClassMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInClassChecksUsingClassMixin(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksClassMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => - 'ClassChecksUsingClassMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ClassChecksUsingClassMixin on ClassChecksUsingClassMixin { late PageLoaderElement $__root__; @@ -434,89 +154,6 @@ mixin $$ClassChecksUsingClassMixin on ClassChecksUsingClassMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ClassChecksUsingMixin extends ClassChecksUsingMixin - with $$ChecksMixin, $$ClassChecksUsingMixin { - PageLoaderElement $__root__; - $ClassChecksUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('some-tag')]); - } - factory $ClassChecksUsingMixin.lookup(PageLoaderSource source) => - $ClassChecksUsingMixin.create(source.byTag('some-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksMixin()); - getters.addAll(testCreatorGettersInClassChecksUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksMixin()); - methods.addAll(testCreatorMethodsInClassChecksUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInClassChecksUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInClassChecksUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-tag'; - String toStringDeep() => - 'ClassChecksUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ClassChecksUsingMixin on ClassChecksUsingMixin { late PageLoaderElement $__root__; @@ -549,91 +186,6 @@ mixin $$ClassChecksUsingMixin on ClassChecksUsingMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagChecksUsingMixin extends EnsureTagChecksUsingMixin - with $$ChecksMixin, $$EnsureTagChecksUsingMixin { - PageLoaderElement $__root__; - $EnsureTagChecksUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('some-other-tag'), [], []) { - $__root__.addCheckers([EnsureTag('some-other-tag')]); - } - factory $EnsureTagChecksUsingMixin.lookup(PageLoaderSource source) => - $EnsureTagChecksUsingMixin.create(source.byTag('some-other-tag')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInChecksMixin()); - getters.addAll(testCreatorGettersInEnsureTagChecksUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInChecksMixin()); - methods.addAll(testCreatorMethodsInEnsureTagChecksUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagChecksUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInChecksMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInEnsureTagChecksUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInChecksMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'some-other-tag'; - String toStringDeep() => - 'EnsureTagChecksUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagChecksUsingMixin on EnsureTagChecksUsingMixin { late PageLoaderElement $__root__; @@ -719,3 +271,59 @@ mixin $$ChecksClassMixin on ChecksClassMixin { return returnMe; } } + +// ignore_for_file: unused_field, non_constant_identifier_names +// ignore_for_file: overridden_fields, annotate_overrides +// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package + +mixin $$ChecksMixin on ChecksMixin { + late PageLoaderElement $__root__; + PageLoaderElement get $root => $__root__; + Map testCreatorGettersInChecksMixin() { + return {}; + } + + Map>> testCreatorMethodsInChecksMixin() { + return {}; + } + + dynamic testCreatorInvokeMethodInChecksMixin( + String methodName, List positionalArguments, + [Map? namedArguments]) { + if (methodName == 'myRoot') { + return myRoot; + } + throw 'METHOD NOT FOUND. This method' + ' failed to be generated during test creator codegen.'; + } + + Map)?> findChainInChecksMixin( + List internalIds, + [String action = 'default']) { + var closestIndex = internalIds.length; + String Function(List)? closestValue; + try { + var myRootIndex = internalIds.indexOf(this.myRoot.id); + if (myRootIndex >= 0 && myRootIndex < closestIndex) { + closestIndex = myRootIndex; + closestValue = (_) => + 'myRoot.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; + } + } catch (_) { + // Ignored. + } + return {closestIndex: closestValue}; + } + + PageLoaderElement get myRoot { + for (final __listener in $__root__.listeners) { + __listener.startPageObjectMethod('ChecksMixin', 'myRoot'); + } + final element = $__root__; + final returnMe = element; + for (final __listener in $__root__.listeners) { + __listener.endPageObjectMethod('ChecksMixin', 'myRoot'); + } + return returnMe; + } +} diff --git a/test/examples/correct_null_safety/empty.g.dart b/test/examples/correct_null_safety/empty.g.dart index b473dd27..2959e894 100644 --- a/test/examples/correct_null_safety/empty.g.dart +++ b/test/examples/correct_null_safety/empty.g.dart @@ -9,77 +9,6 @@ part of 'empty.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Empty extends Empty with $$Empty { - PageLoaderElement $__root__; - $Empty.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Empty.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Empty is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEmpty()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEmpty()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInEmpty( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInEmpty(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Empty". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Empty\n\n${$__root__.toStringDeep()}'; -} mixin $$Empty on Empty { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/finders.g.dart b/test/examples/correct_null_safety/finders.g.dart index 40e6e519..9c8a0833 100644 --- a/test/examples/correct_null_safety/finders.g.dart +++ b/test/examples/correct_null_safety/finders.g.dart @@ -9,89 +9,6 @@ part of 'finders.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Finders extends Finders with $$Finders { - PageLoaderElement $__root__; - $Finders.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Finders.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Finders is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInFinders()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInFinders()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInFinders( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInFinders(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Finders". Requires @CheckTag annotation in order for "tagName" to be generated.'; - PageLoaderElement get secret { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Finders', 'secret'); - } - final returnMe = super.secret; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Finders', 'secret'); - } - return returnMe; - } - - String toStringDeep() => 'Finders\n\n${$__root__.toStringDeep()}'; -} mixin $$Finders on Finders { late PageLoaderElement $__root__; @@ -234,86 +151,6 @@ mixin $$Finders on Finders { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckTagPO extends CheckTagPO with $$CheckTagPO { - PageLoaderElement $__root__; - $CheckTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('check-tag-po')]); - } - factory $CheckTagPO.lookup(PageLoaderSource source) => - $CheckTagPO.create(source.byTag('check-tag-po')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCheckTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCheckTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'check-tag-po'; - String toString() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CheckTagPO', 'toString'); - } - final returnMe = super.toString(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CheckTagPO', 'toString'); - } - return returnMe; - } - - String toStringDeep() => 'CheckTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$CheckTagPO on CheckTagPO { late PageLoaderElement $__root__; @@ -370,91 +207,6 @@ mixin $$CheckTagPO on CheckTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $FindersUsingMixin extends FindersUsingMixin - with $$FindersMixin, $$FindersUsingMixin { - PageLoaderElement $__root__; - $FindersUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $FindersUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "FindersUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInFindersMixin()); - getters.addAll(testCreatorGettersInFindersUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInFindersMixin()); - methods.addAll(testCreatorMethodsInFindersUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInFindersUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInFindersMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInFindersUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInFindersMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "FindersUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'FindersUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$FindersUsingMixin on FindersUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/generics.g.dart b/test/examples/correct_null_safety/generics.g.dart deleted file mode 100644 index aecd49de..00000000 --- a/test/examples/correct_null_safety/generics.g.dart +++ /dev/null @@ -1,1187 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'generics.dart'; - -// ************************************************************************** -// PageObjectGenerator -// ************************************************************************** - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'typeDefParameter'); - } - return returnMe; - } - - S exampleMethod(S s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'exampleMethod'); - } - final returnMe = super.exampleMethod(s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'exampleMethod'); - } - return returnMe; - } - - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} - -mixin $$Generics on Generics { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenerics() { - return {}; - } - - Map>> testCreatorMethodsInGenerics() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenerics( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - if (methodName == 'exampleMethod') { - return Function.apply(exampleMethod, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenerics( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckedGenerics extends CheckedGenerics with $$CheckedGenerics { - PageLoaderElement $__root__; - $CheckedGenerics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('checked-generics')]); - } - factory $CheckedGenerics.lookup(PageLoaderSource source) => - $CheckedGenerics.create(source.byTag('checked-generics')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckedGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckedGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCheckedGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCheckedGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'checked-generics'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CheckedGenerics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CheckedGenerics', 'typeDefParameter'); - } - return returnMe; - } - - String toStringDeep() => 'CheckedGenerics\n\n${$__root__.toStringDeep()}'; -} - -mixin $$CheckedGenerics on CheckedGenerics { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInCheckedGenerics() { - return {}; - } - - Map>> - testCreatorMethodsInCheckedGenerics() { - return {}; - } - - dynamic testCreatorInvokeMethodInCheckedGenerics( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInCheckedGenerics( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericPair extends GenericPair with $$GenericPair { - PageLoaderElement $__root__; - $GenericPair.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericPair.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericPair is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericPair()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericPair()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenericPair( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenericPair(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericPair". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Map exampleMethodMap(R r, S s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('GenericPair', 'exampleMethodMap'); - } - final returnMe = super.exampleMethodMap(r, s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('GenericPair', 'exampleMethodMap'); - } - return returnMe; - } - - String toStringDeep() => 'GenericPair\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericPair on GenericPair { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPair() { - return {}; - } - - Map>> testCreatorMethodsInGenericPair() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPair( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'exampleMethodMap') { - return Function.apply( - exampleMethodMap, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenericPair( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPo extends RootPo with $$RootPo { - PageLoaderElement $__root__; - $RootPo.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPo.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPo is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPo()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPo()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRootPo( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRootPo(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPo". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPo\n\n${$__root__.toStringDeep()}'; -} - -mixin $$RootPo on RootPo { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPo() { - return {}; - } - - Map>> testCreatorMethodsInRootPo() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPo( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'generics') { - return generics; - } - if (methodName == 'checkedGenerics') { - return checkedGenerics; - } - if (methodName == 'genericsList') { - return genericsList; - } - if (methodName == 'checkedGenericsList') { - return checkedGenericsList; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInRootPo( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - try { - var genericsElement = this.generics as dynamic; - var genericsIndex = - internalIds.indexOf(genericsElement.$__root__.id as String); - if (genericsIndex >= 0 && genericsIndex < closestIndex) { - closestIndex = genericsIndex; - closestValue = (ids) => - 'generics.${genericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var checkedGenericsElement = this.checkedGenerics as dynamic; - var checkedGenericsIndex = - internalIds.indexOf(checkedGenericsElement.$__root__.id as String); - if (checkedGenericsIndex >= 0 && checkedGenericsIndex < closestIndex) { - closestIndex = checkedGenericsIndex; - closestValue = (ids) => - 'checkedGenerics.${checkedGenericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - final genericsListElements = this.genericsList; - for (var elementIter = 0; - elementIter < genericsListElements.length; - elementIter++) { - try { - var genericsListElement = genericsListElements[elementIter] as dynamic; - var genericsListIndex = - internalIds.indexOf(genericsListElement.$__root__.id as String); - if (genericsListIndex >= 0 && genericsListIndex < closestIndex) { - closestIndex = genericsListIndex; - closestValue = (ids) => - 'genericsList[$elementIter].${genericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkedGenericsListElements = this.checkedGenericsList; - for (var elementIter = 0; - elementIter < checkedGenericsListElements.length; - elementIter++) { - try { - var checkedGenericsListElement = - checkedGenericsListElements[elementIter] as dynamic; - var checkedGenericsListIndex = internalIds - .indexOf(checkedGenericsListElement.$__root__.id as String); - if (checkedGenericsListIndex >= 0 && - checkedGenericsListIndex < closestIndex) { - closestIndex = checkedGenericsListIndex; - closestValue = (ids) => - 'checkedGenericsList[$elementIter].${checkedGenericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Generics get generics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'generics'); - } - final element = $__root__.createElement(ByTagName('x'), [], []); - final returnMe = Generics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'generics'); - } - return returnMe; - } - - CheckedGenerics get checkedGenerics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'checkedGenerics'); - } - final element = - $__root__.createElement(ByTagName('checked-generics'), [], []); - final returnMe = CheckedGenerics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'checkedGenerics'); - } - return returnMe; - } - - PageObjectList> get genericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'genericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('y'), [], []), - (PageLoaderElement e) => Generics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'genericsList'); - } - return returnMe; - } - - PageObjectList> get checkedGenericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPo', 'checkedGenericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('checked-generics'), [], []), - (PageLoaderElement e) => CheckedGenerics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPo', 'checkedGenericsList'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericsUsingMixin extends GenericsUsingMixin - with $$GenericsMixin, $$GenericsUsingMixin { - PageLoaderElement $__root__; - $GenericsUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericsUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericsUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericsMixin()); - getters.addAll(testCreatorGettersInGenericsUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericsMixin()); - methods.addAll(testCreatorMethodsInGenericsUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenericsUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInGenericsMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenericsUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInGenericsMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericsUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'GenericsUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericsUsingMixin on GenericsUsingMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericsUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericsUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericsUsingMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenericsUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$GenericsMixin on GenericsMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericsMixin() { - return {}; - } - - Map>> testCreatorMethodsInGenericsMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericsMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'typeDefParameter') { - return Function.apply( - typeDefParameter, positionalArguments, namedArguments); - } - if (methodName == 'exampleMethod') { - return Function.apply(exampleMethod, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenericsMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $GenericPairUsingMixin extends GenericPairUsingMixin - with $$GenericPairMixin, $$GenericPairUsingMixin { - PageLoaderElement $__root__; - $GenericPairUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $GenericPairUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "GenericPairUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenericPairMixin()); - getters.addAll(testCreatorGettersInGenericPairUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenericPairMixin()); - methods.addAll(testCreatorMethodsInGenericPairUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenericPairUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInGenericPairMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenericPairUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInGenericPairMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "GenericPairUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'GenericPairUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$GenericPairUsingMixin on GenericPairUsingMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPairUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericPairUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPairUsingMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenericPairUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$GenericPairMixin on GenericPairMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInGenericPairMixin() { - return {}; - } - - Map>> - testCreatorMethodsInGenericPairMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInGenericPairMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'exampleMethodMap') { - return Function.apply( - exampleMethodMap, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInGenericPairMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPoUsingMixin extends RootPoUsingMixin - with $$RootPoMixin, $$RootPoUsingMixin { - PageLoaderElement $__root__; - $RootPoUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPoUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPoUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPoMixin()); - getters.addAll(testCreatorGettersInRootPoUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPoMixin()); - methods.addAll(testCreatorMethodsInRootPoUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRootPoUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRootPoMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRootPoUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInRootPoMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPoUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPoUsingMixin\n\n${$__root__.toStringDeep()}'; -} - -mixin $$RootPoUsingMixin on RootPoUsingMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPoUsingMixin() { - return {}; - } - - Map>> - testCreatorMethodsInRootPoUsingMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPoUsingMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInRootPoUsingMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$RootPoMixin on RootPoMixin { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRootPoMixin() { - return {}; - } - - Map>> testCreatorMethodsInRootPoMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInRootPoMixin( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'generics') { - return generics; - } - if (methodName == 'checkedGenerics') { - return checkedGenerics; - } - if (methodName == 'genericsList') { - return genericsList; - } - if (methodName == 'checkedGenericsList') { - return checkedGenericsList; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInRootPoMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - try { - var genericsElement = this.generics as dynamic; - var genericsIndex = - internalIds.indexOf(genericsElement.$__root__.id as String); - if (genericsIndex >= 0 && genericsIndex < closestIndex) { - closestIndex = genericsIndex; - closestValue = (ids) => - 'generics.${genericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var checkedGenericsElement = this.checkedGenerics as dynamic; - var checkedGenericsIndex = - internalIds.indexOf(checkedGenericsElement.$__root__.id as String); - if (checkedGenericsIndex >= 0 && checkedGenericsIndex < closestIndex) { - closestIndex = checkedGenericsIndex; - closestValue = (ids) => - 'checkedGenerics.${checkedGenericsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - final genericsListElements = this.genericsList; - for (var elementIter = 0; - elementIter < genericsListElements.length; - elementIter++) { - try { - var genericsListElement = genericsListElements[elementIter] as dynamic; - var genericsListIndex = - internalIds.indexOf(genericsListElement.$__root__.id as String); - if (genericsListIndex >= 0 && genericsListIndex < closestIndex) { - closestIndex = genericsListIndex; - closestValue = (ids) => - 'genericsList[$elementIter].${genericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final checkedGenericsListElements = this.checkedGenericsList; - for (var elementIter = 0; - elementIter < checkedGenericsListElements.length; - elementIter++) { - try { - var checkedGenericsListElement = - checkedGenericsListElements[elementIter] as dynamic; - var checkedGenericsListIndex = internalIds - .indexOf(checkedGenericsListElement.$__root__.id as String); - if (checkedGenericsListIndex >= 0 && - checkedGenericsListIndex < closestIndex) { - closestIndex = checkedGenericsListIndex; - closestValue = (ids) => - 'checkedGenericsList[$elementIter].${checkedGenericsListElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - Generics get generics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'generics'); - } - final element = $__root__.createElement(ByTagName('x'), [], []); - final returnMe = Generics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'generics'); - } - return returnMe; - } - - CheckedGenerics get checkedGenerics { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'checkedGenerics'); - } - final element = - $__root__.createElement(ByTagName('checked-generics'), [], []); - final returnMe = CheckedGenerics.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'checkedGenerics'); - } - return returnMe; - } - - PageObjectList> get genericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'genericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('y'), [], []), - (PageLoaderElement e) => Generics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'genericsList'); - } - return returnMe; - } - - PageObjectList> get checkedGenericsList { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RootPoMixin', 'checkedGenericsList'); - } - final returnMe = PageObjectList>( - $__root__.createList(ByTagName('checked-generics'), [], []), - (PageLoaderElement e) => CheckedGenerics.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RootPoMixin', 'checkedGenericsList'); - } - return returnMe; - } -} diff --git a/test/examples/correct_null_safety/iterables.g.dart b/test/examples/correct_null_safety/iterables.g.dart index b8f025e3..4afb1756 100644 --- a/test/examples/correct_null_safety/iterables.g.dart +++ b/test/examples/correct_null_safety/iterables.g.dart @@ -9,78 +9,6 @@ part of 'iterables.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Iterables extends Iterables with $$Iterables { - PageLoaderElement $__root__; - $Iterables.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Iterables.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Iterables is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInIterables()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInIterables()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInIterables( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInIterables(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Iterables". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Iterables\n\n${$__root__.toStringDeep()}'; -} mixin $$Iterables on Iterables { late PageLoaderElement $__root__; @@ -160,78 +88,6 @@ mixin $$Iterables on Iterables { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerObject extends InnerObject with $$InnerObject { - PageLoaderElement $__root__; - $InnerObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInInnerObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInInnerObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'InnerObject\n\n${$__root__.toStringDeep()}'; -} mixin $$InnerObject on InnerObject { late PageLoaderElement $__root__; @@ -320,91 +176,6 @@ mixin $$InnerObject on InnerObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $IterablesUsingMixin extends IterablesUsingMixin - with $$IterablesMixin, $$IterablesUsingMixin { - PageLoaderElement $__root__; - $IterablesUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $IterablesUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "IterablesUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInIterablesMixin()); - getters.addAll(testCreatorGettersInIterablesUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInIterablesMixin()); - methods.addAll(testCreatorMethodsInIterablesUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInIterablesUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInIterablesMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInIterablesUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInIterablesMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "IterablesUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'IterablesUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$IterablesUsingMixin on IterablesUsingMixin { late PageLoaderElement $__root__; @@ -516,92 +287,6 @@ mixin $$IterablesMixin on IterablesMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerObjectUsingMixin extends InnerObjectUsingMixin - with $$InnerObjectMixin, $$InnerObjectUsingMixin { - PageLoaderElement $__root__; - $InnerObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerObjectMixin()); - getters.addAll(testCreatorGettersInInnerObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerObjectMixin()); - methods.addAll(testCreatorMethodsInInnerObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInInnerObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInInnerObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInInnerObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInInnerObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'InnerObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$InnerObjectUsingMixin on InnerObjectUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/list.g.dart b/test/examples/correct_null_safety/list.g.dart index 9686b3e5..6c5b5170 100644 --- a/test/examples/correct_null_safety/list.g.dart +++ b/test/examples/correct_null_safety/list.g.dart @@ -9,77 +9,6 @@ part of 'list.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Lists extends Lists with $$Lists { - PageLoaderElement $__root__; - $Lists.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Lists.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Lists is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInLists()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInLists()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInLists( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInLists(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Lists". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Lists\n\n${$__root__.toStringDeep()}'; -} mixin $$Lists on Lists { late PageLoaderElement $__root__; @@ -260,78 +189,6 @@ mixin $$Lists on Lists { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerListObject extends InnerListObject with $$InnerListObject { - PageLoaderElement $__root__; - $InnerListObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerListObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerListObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerListObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerListObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInInnerListObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInInnerListObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerListObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'InnerListObject\n\n${$__root__.toStringDeep()}'; -} mixin $$InnerListObject on InnerListObject { late PageLoaderElement $__root__; @@ -405,91 +262,6 @@ mixin $$InnerListObject on InnerListObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ListsUsingMixin extends ListsUsingMixin - with $$ListsMixin, $$ListsUsingMixin { - PageLoaderElement $__root__; - $ListsUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ListsUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ListsUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInListsMixin()); - getters.addAll(testCreatorGettersInListsUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInListsMixin()); - methods.addAll(testCreatorMethodsInListsUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInListsUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInListsMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInListsUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInListsMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ListsUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ListsUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ListsUsingMixin on ListsUsingMixin { late PageLoaderElement $__root__; @@ -702,93 +474,6 @@ mixin $$ListsMixin on ListsMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $InnerListObjectUsingMixin extends InnerListObjectUsingMixin - with $$InnerListObjectMixin, $$InnerListObjectUsingMixin { - PageLoaderElement $__root__; - $InnerListObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $InnerListObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "InnerListObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInInnerListObjectMixin()); - getters.addAll(testCreatorGettersInInnerListObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInInnerListObjectMixin()); - methods.addAll(testCreatorMethodsInInnerListObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInInnerListObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInInnerListObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInInnerListObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInInnerListObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "InnerListObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'InnerListObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$InnerListObjectUsingMixin on InnerListObjectUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/mouse.g.dart b/test/examples/correct_null_safety/mouse.g.dart index 27de33f1..74069e73 100644 --- a/test/examples/correct_null_safety/mouse.g.dart +++ b/test/examples/correct_null_safety/mouse.g.dart @@ -9,78 +9,6 @@ part of 'mouse.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MouseObject extends MouseObject with $$MouseObject { - PageLoaderElement $__root__; - $MouseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MouseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MouseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMouseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMouseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInMouseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInMouseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MouseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'MouseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$MouseObject on MouseObject { late PageLoaderElement $__root__; @@ -125,92 +53,6 @@ mixin $$MouseObject on MouseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MouseObjectUsingMixin extends MouseObjectUsingMixin - with $$MouseObjectMixin, $$MouseObjectUsingMixin { - PageLoaderElement $__root__; - $MouseObjectUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MouseObjectUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MouseObjectUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMouseObjectMixin()); - getters.addAll(testCreatorGettersInMouseObjectUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMouseObjectMixin()); - methods.addAll(testCreatorMethodsInMouseObjectUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInMouseObjectUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInMouseObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInMouseObjectUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInMouseObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MouseObjectUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'MouseObjectUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$MouseObjectUsingMixin on MouseObjectUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/multiple_in_file.g.dart b/test/examples/correct_null_safety/multiple_in_file.g.dart index 16d49d3d..a59b5fc8 100644 --- a/test/examples/correct_null_safety/multiple_in_file.g.dart +++ b/test/examples/correct_null_safety/multiple_in_file.g.dart @@ -9,77 +9,6 @@ part of 'multiple_in_file.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $A extends A with $$A { - PageLoaderElement $__root__; - $A.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $A.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "A is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInA()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInA()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInA( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInA(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "A". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'A\n\n${$__root__.toStringDeep()}'; -} mixin $$A on A { late PageLoaderElement $__root__; @@ -137,77 +66,6 @@ mixin $$A on A { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $B extends B with $$B { - PageLoaderElement $__root__; - $B.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $B.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "B is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInB()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInB()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInB( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInB(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "B". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'B\n\n${$__root__.toStringDeep()}'; -} mixin $$B on B { late PageLoaderElement $__root__; @@ -264,77 +122,6 @@ mixin $$B on B { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $C extends C with $$C { - PageLoaderElement $__root__; - $C.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $C.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "C is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInC()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInC()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInC( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInC(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "C". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'C\n\n${$__root__.toStringDeep()}'; -} mixin $$C on C { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/nested.g.dart b/test/examples/correct_null_safety/nested.g.dart index d23fab6e..ba3321b4 100644 --- a/test/examples/correct_null_safety/nested.g.dart +++ b/test/examples/correct_null_safety/nested.g.dart @@ -9,78 +9,6 @@ part of 'nested.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Nested extends Nested with $$Nested { - PageLoaderElement $__root__; - $Nested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Nested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Nested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInNested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInNested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Nested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Nested\n\n${$__root__.toStringDeep()}'; -} mixin $$Nested on Nested { late PageLoaderElement $__root__; @@ -140,91 +68,6 @@ mixin $$Nested on Nested { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NestedUsingMixin extends NestedUsingMixin - with $$NestedMixin, $$NestedUsingMixin { - PageLoaderElement $__root__; - $NestedUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NestedUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NestedUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNestedMixin()); - getters.addAll(testCreatorGettersInNestedUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNestedMixin()); - methods.addAll(testCreatorMethodsInNestedUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInNestedUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInNestedMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInNestedUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInNestedMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NestedUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NestedUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$NestedUsingMixin on NestedUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/null_element.g.dart b/test/examples/correct_null_safety/null_element.g.dart index b9ffef6c..b4c4d25f 100644 --- a/test/examples/correct_null_safety/null_element.g.dart +++ b/test/examples/correct_null_safety/null_element.g.dart @@ -9,78 +9,6 @@ part of 'null_element.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRoot extends ParentRoot with $$ParentRoot { - PageLoaderElement $__root__; - $ParentRoot.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRoot.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRoot is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInParentRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInParentRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRoot". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ParentRoot\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRoot on ParentRoot { late PageLoaderElement $__root__; @@ -185,78 +113,6 @@ mixin $$ParentRoot on ParentRoot { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NullPO extends NullPO with $$NullPO { - PageLoaderElement $__root__; - $NullPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NullPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NullPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNullPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNullPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInNullPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInNullPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NullPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NullPO\n\n${$__root__.toStringDeep()}'; -} mixin $$NullPO on NullPO { late PageLoaderElement $__root__; @@ -288,78 +144,6 @@ mixin $$NullPO on NullPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} mixin $$Generics on Generics { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/parameters.g.dart b/test/examples/correct_null_safety/parameters.g.dart index f6782ebf..113082e1 100644 --- a/test/examples/correct_null_safety/parameters.g.dart +++ b/test/examples/correct_null_safety/parameters.g.dart @@ -9,132 +9,6 @@ part of 'parameters.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Parameters extends Parameters with $$Parameters { - PageLoaderElement $__root__; - $Parameters.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Parameters.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Parameters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParameters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParameters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInParameters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInParameters(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Parameters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String testOptionalPositionalParam( - [String first = 'a', String second = 'b']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testOptionalPositionalParam'); - } - final returnMe = super.testOptionalPositionalParam(first, second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testOptionalPositionalParam'); - } - return returnMe; - } - - String testMixedOptionalPositionalParam(String x, - [String first = 'a', String second = 'b']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testMixedOptionalPositionalParam'); - } - final returnMe = super.testMixedOptionalPositionalParam(x, first, second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testMixedOptionalPositionalParam'); - } - return returnMe; - } - - String testOptionalNamedParam({String first = 'a', String second = 'b'}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Parameters', 'testOptionalNamedParam'); - } - final returnMe = super.testOptionalNamedParam(first: first, second: second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Parameters', 'testOptionalNamedParam'); - } - return returnMe; - } - - String testMixedOptionalNamedParam(String x, - {String first = 'a', String second = 'b'}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'Parameters', 'testMixedOptionalNamedParam'); - } - final returnMe = - super.testMixedOptionalNamedParam(x, first: first, second: second); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'Parameters', 'testMixedOptionalNamedParam'); - } - return returnMe; - } - - String toStringDeep() => 'Parameters\n\n${$__root__.toStringDeep()}'; -} mixin $$Parameters on Parameters { late PageLoaderElement $__root__; @@ -182,92 +56,6 @@ mixin $$Parameters on Parameters { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParametersUsingMixin extends ParametersUsingMixin - with $$ParametersMixin, $$ParametersUsingMixin { - PageLoaderElement $__root__; - $ParametersUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParametersUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParametersUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParametersMixin()); - getters.addAll(testCreatorGettersInParametersUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParametersMixin()); - methods.addAll(testCreatorMethodsInParametersUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInParametersUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInParametersMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInParametersUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInParametersMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParametersUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'ParametersUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ParametersUsingMixin on ParametersUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/root.g.dart b/test/examples/correct_null_safety/root.g.dart index bdc9ea01..7563584f 100644 --- a/test/examples/correct_null_safety/root.g.dart +++ b/test/examples/correct_null_safety/root.g.dart @@ -9,78 +9,6 @@ part of 'root.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRoot extends ParentRoot with $$ParentRoot { - PageLoaderElement $__root__; - $ParentRoot.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRoot.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRoot is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInParentRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInParentRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRoot". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ParentRoot\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRoot on ParentRoot { late PageLoaderElement $__root__; @@ -138,77 +66,6 @@ mixin $$ParentRoot on ParentRoot { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Root extends Root with $$Root { - PageLoaderElement $__root__; - $Root.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Root.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Root is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRoot()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRoot()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRoot( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRoot(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Root". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Root\n\n${$__root__.toStringDeep()}'; -} mixin $$Root on Root { late PageLoaderElement $__root__; @@ -290,92 +147,6 @@ mixin $$Root on Root { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ParentRootUsingMixin extends ParentRootUsingMixin - with $$ParentRootMixin, $$ParentRootUsingMixin { - PageLoaderElement $__root__; - $ParentRootUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ParentRootUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ParentRootUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInParentRootMixin()); - getters.addAll(testCreatorGettersInParentRootUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInParentRootMixin()); - methods.addAll(testCreatorMethodsInParentRootUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInParentRootUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInParentRootMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInParentRootUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInParentRootMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ParentRootUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'ParentRootUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$ParentRootUsingMixin on ParentRootUsingMixin { late PageLoaderElement $__root__; @@ -466,91 +237,6 @@ mixin $$ParentRootMixin on ParentRootMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootUsingMixin extends RootUsingMixin - with $$RootMixin, $$RootUsingMixin { - PageLoaderElement $__root__; - $RootUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootMixin()); - getters.addAll(testCreatorGettersInRootUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootMixin()); - methods.addAll(testCreatorMethodsInRootUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRootUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRootMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRootUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInRootMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$RootUsingMixin on RootUsingMixin { late PageLoaderElement $__root__; diff --git a/test/examples/correct_null_safety/unannotated.g.dart b/test/examples/correct_null_safety/unannotated.g.dart index ed830495..41f345f9 100644 --- a/test/examples/correct_null_safety/unannotated.g.dart +++ b/test/examples/correct_null_safety/unannotated.g.dart @@ -9,210 +9,6 @@ part of 'unannotated.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Unannotated extends Unannotated with $$Unannotated { - PageLoaderElement $__root__; - $Unannotated.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Unannotated.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Unannotated is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInUnannotated()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInUnannotated()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInUnannotated( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInUnannotated(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Unannotated". Requires @CheckTag annotation in order for "tagName" to be generated.'; - bool get isFieldSet { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'isFieldSet'); - } - final returnMe = super.isFieldSet; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'isFieldSet'); - } - return returnMe; - } - - set myField(bool setValue) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'myField'); - } - super.myField = setValue; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'myField'); - } - return; - } - - String noParameters() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'noParameters'); - } - final returnMe = super.noParameters(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'noParameters'); - } - return returnMe; - } - - String _privateMethod(String s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', '_privateMethod'); - } - final returnMe = super._privateMethod(s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', '_privateMethod'); - } - return returnMe; - } - - String oneParameter(String privateMe) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'oneParameter'); - } - final returnMe = super.oneParameter(privateMe); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'oneParameter'); - } - return returnMe; - } - - int twoParameters(int a, int b) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'twoParameters'); - } - final returnMe = super.twoParameters(a, b); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'twoParameters'); - } - return returnMe; - } - - String? _privateMethodNullable(String? s) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', '_privateMethodNullable'); - } - final returnMe = super._privateMethodNullable(s); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', '_privateMethodNullable'); - } - return returnMe; - } - - String? oneParameterNullable(String? privateMe) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'oneParameterNullable'); - } - final returnMe = super.oneParameterNullable(privateMe); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'oneParameterNullable'); - } - return returnMe; - } - - int? twoParametersNullable(int? a, int b) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'twoParametersNullable'); - } - final returnMe = super.twoParametersNullable(a, b); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'twoParametersNullable'); - } - return returnMe; - } - - String typeDefParameter(MyTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'typeDefParameter'); - } - return returnMe; - } - - void noReturnType() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'noReturnType'); - } - super.noReturnType(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'noReturnType'); - } - return; - } - - List generateTypedList() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Unannotated', 'generateTypedList'); - } - final returnMe = super.generateTypedList(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Unannotated', 'generateTypedList'); - } - return returnMe; - } - - String toStringDeep() => 'Unannotated\n\n${$__root__.toStringDeep()}'; -} mixin $$Unannotated on Unannotated { late PageLoaderElement $__root__; @@ -277,92 +73,6 @@ mixin $$Unannotated on Unannotated { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $UnannotatedUsingMixin extends UnannotatedUsingMixin - with $$UnannotatedMixin, $$UnannotatedUsingMixin { - PageLoaderElement $__root__; - $UnannotatedUsingMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $UnannotatedUsingMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "UnannotatedUsingMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInUnannotatedMixin()); - getters.addAll(testCreatorGettersInUnannotatedUsingMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInUnannotatedMixin()); - methods.addAll(testCreatorMethodsInUnannotatedUsingMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInUnannotatedUsingMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInUnannotatedMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInUnannotatedUsingMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInUnannotatedMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "UnannotatedUsingMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'UnannotatedUsingMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$UnannotatedUsingMixin on UnannotatedUsingMixin { late PageLoaderElement $__root__; diff --git a/test/src/annotations.g.dart b/test/src/annotations.g.dart index 26d1f891..083387a3 100644 --- a/test/src/annotations.g.dart +++ b/test/src/annotations.g.dart @@ -10,82 +10,9 @@ part of 'annotations.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BaseObject extends BaseObject with $$BaseObject { - PageLoaderElement $__root__; - $BaseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BaseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BaseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBaseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBaseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBaseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBaseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BaseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BaseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$BaseObject on BaseObject { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBaseObject() { return {}; @@ -223,82 +150,9 @@ mixin $$BaseObject on BaseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PseudoBaseObject extends PseudoBaseObject with $$PseudoBaseObject { - PageLoaderElement $__root__; - $PseudoBaseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PseudoBaseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PseudoBaseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPseudoBaseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPseudoBaseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPseudoBaseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPseudoBaseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PseudoBaseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PseudoBaseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$PseudoBaseObject on PseudoBaseObject { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPseudoBaseObject() { return {}; @@ -408,79 +262,9 @@ mixin $$PseudoBaseObject on PseudoBaseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TableForCheckTag extends TableForCheckTag with $$TableForCheckTag { - PageLoaderElement $__root__; - $TableForCheckTag.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('table')]); - } - factory $TableForCheckTag.lookup(PageLoaderSource source) => - $TableForCheckTag.create(source.byTag('table')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTableForCheckTag()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTableForCheckTag()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTableForCheckTag( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTableForCheckTag(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'table'; - String toStringDeep() => 'TableForCheckTag\n\n${$__root__.toStringDeep()}'; -} mixin $$TableForCheckTag on TableForCheckTag { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInTableForCheckTag() { return {}; @@ -576,82 +360,9 @@ mixin $$TableForCheckTag on TableForCheckTag { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BaseEnsureObject extends BaseEnsureObject with $$BaseEnsureObject { - PageLoaderElement $__root__; - $BaseEnsureObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BaseEnsureObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BaseEnsureObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBaseEnsureObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBaseEnsureObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBaseEnsureObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBaseEnsureObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BaseEnsureObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BaseEnsureObject\n\n${$__root__.toStringDeep()}'; -} mixin $$BaseEnsureObject on BaseEnsureObject { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBaseEnsureObject() { return {}; @@ -735,79 +446,9 @@ mixin $$BaseEnsureObject on BaseEnsureObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TableForEnsureTag extends TableForEnsureTag with $$TableForEnsureTag { - PageLoaderElement $__root__; - $TableForEnsureTag.create(PageLoaderElement currentContext) - : $__root__ = currentContext.createElement(EnsureTag('table'), [], []) { - $__root__.addCheckers([EnsureTag('table')]); - } - factory $TableForEnsureTag.lookup(PageLoaderSource source) => - $TableForEnsureTag.create(source.byTag('table')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTableForEnsureTag()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTableForEnsureTag()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTableForEnsureTag( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTableForEnsureTag(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'table'; - String toStringDeep() => 'TableForEnsureTag\n\n${$__root__.toStringDeep()}'; -} mixin $$TableForEnsureTag on TableForEnsureTag { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInTableForEnsureTag() { return {}; @@ -878,79 +519,9 @@ mixin $$TableForEnsureTag on TableForEnsureTag { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckTagFails extends CheckTagFails with $$CheckTagFails { - PageLoaderElement $__root__; - $CheckTagFails.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('inconceivable')]); - } - factory $CheckTagFails.lookup(PageLoaderSource source) => - $CheckTagFails.create(source.byTag('inconceivable')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckTagFails()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckTagFails()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCheckTagFails( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCheckTagFails(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'inconceivable'; - String toStringDeep() => 'CheckTagFails\n\n${$__root__.toStringDeep()}'; -} mixin $$CheckTagFails on CheckTagFails { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInCheckTagFails() { return {}; @@ -1005,80 +576,9 @@ mixin $$CheckTagFails on CheckTagFails { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagFails extends EnsureTagFails with $$EnsureTagFails { - PageLoaderElement $__root__; - $EnsureTagFails.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('inconceivable'), [], []) { - $__root__.addCheckers([EnsureTag('inconceivable')]); - } - factory $EnsureTagFails.lookup(PageLoaderSource source) => - $EnsureTagFails.create(source.byTag('inconceivable')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEnsureTagFails()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEnsureTagFails()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagFails( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInEnsureTagFails(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'inconceivable'; - String toStringDeep() => 'EnsureTagFails\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagFails on EnsureTagFails { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInEnsureTagFails() { return {}; @@ -1133,85 +633,9 @@ mixin $$EnsureTagFails on EnsureTagFails { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForWithAttributeTest extends PageForWithAttributeTest - with $$PageForWithAttributeTest { - PageLoaderElement $__root__; - $PageForWithAttributeTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForWithAttributeTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForWithAttributeTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForWithAttributeTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForWithAttributeTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForWithAttributeTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForWithAttributeTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForWithAttributeTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForWithAttributeTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForWithAttributeTest on PageForWithAttributeTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForWithAttributeTest() { return {}; @@ -1267,84 +691,9 @@ mixin $$PageForWithAttributeTest on PageForWithAttributeTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForWithClassTest extends PageForWithClassTest - with $$PageForWithClassTest { - PageLoaderElement $__root__; - $PageForWithClassTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForWithClassTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForWithClassTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForWithClassTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForWithClassTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForWithClassTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForWithClassTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForWithClassTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForWithClassTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForWithClassTest on PageForWithClassTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForWithClassTest() { return {}; @@ -1400,82 +749,9 @@ mixin $$PageForWithClassTest on PageForWithClassTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $DebugIds extends DebugIds with $$DebugIds { - PageLoaderElement $__root__; - $DebugIds.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $DebugIds.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "DebugIds is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDebugIds()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDebugIds()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInDebugIds( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInDebugIds(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "DebugIds". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'DebugIds\n\n${$__root__.toStringDeep()}'; -} mixin $$DebugIds on DebugIds { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInDebugIds() { return {}; @@ -1657,82 +933,9 @@ mixin $$DebugIds on DebugIds { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TestIds extends TestIds with $$TestIds { - PageLoaderElement $__root__; - $TestIds.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $TestIds.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "TestIds is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTestIds()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTestIds()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTestIds( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTestIds(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "TestIds". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'TestIds\n\n${$__root__.toStringDeep()}'; -} mixin $$TestIds on TestIds { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInTestIds() { return {}; diff --git a/test/src/attributes.g.dart b/test/src/attributes.g.dart index 6c91d508..697b56c2 100644 --- a/test/src/attributes.g.dart +++ b/test/src/attributes.g.dart @@ -10,85 +10,9 @@ part of 'attributes.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForAttributesTests extends PageForAttributesTests - with $$PageForAttributesTests { - PageLoaderElement $__root__; - $PageForAttributesTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForAttributesTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForAttributesTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForAttributesTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForAttributesTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForAttributesTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForAttributesTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForAttributesTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForAttributesTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForAttributesTests on PageForAttributesTests { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForAttributesTests() { return {}; diff --git a/test/src/basic.g.dart b/test/src/basic.g.dart index 4419df3b..67f7d8f7 100644 --- a/test/src/basic.g.dart +++ b/test/src/basic.g.dart @@ -11,146 +11,8 @@ part of 'basic.dart'; // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -mixin $$MixinPO on MixinPO { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInMixinPO() { - return { - 'mixinDivText': 'String', - 'getterMessage': 'String', - }; - } - - Map>> testCreatorMethodsInMixinPO() { - return {}; - } - - dynamic testCreatorInvokeMethodInMixinPO( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'mixinDivText') { - return mixinDivText; - } - if (methodName == 'getterMessage') { - return getterMessage; - } - if (methodName == 'methodMessage') { - return Function.apply(methodMessage, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInMixinPO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var _mixinDivIndex = internalIds.indexOf(this._mixinDiv.id); - if (_mixinDivIndex >= 0 && _mixinDivIndex < closestIndex) { - closestIndex = _mixinDivIndex; - closestValue = (_) => - '_mixinDiv.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get _mixinDiv { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('MixinPO', '_mixinDiv'); - } - final element = $__root__.createElement(ById('mixin-div'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('MixinPO', '_mixinDiv'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForExistsTest extends PageForExistsTest with $$PageForExistsTest { - PageLoaderElement $__root__; - $PageForExistsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForExistsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForExistsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForExistsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForExistsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForExistsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForExistsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForExistsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForExistsTest\n\n${$__root__.toStringDeep()}'; -} - mixin $$PageForExistsTest on PageForExistsTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForExistsTest() { return {}; @@ -255,84 +117,9 @@ mixin $$PageForExistsTest on PageForExistsTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForVisibilityTest extends PageForVisibilityTest - with $$PageForVisibilityTest { - PageLoaderElement $__root__; - $PageForVisibilityTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForVisibilityTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForVisibilityTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForVisibilityTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForVisibilityTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForVisibilityTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForVisibilityTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForVisibilityTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForVisibilityTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForVisibilityTest on PageForVisibilityTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForVisibilityTest() { return {}; @@ -413,86 +200,9 @@ mixin $$PageForVisibilityTest on PageForVisibilityTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForClassAnnotationTest extends PageForClassAnnotationTest - with $$PageForClassAnnotationTest { - PageLoaderElement $__root__; - $PageForClassAnnotationTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForClassAnnotationTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForClassAnnotationTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForClassAnnotationTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForClassAnnotationTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForClassAnnotationTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForClassAnnotationTest(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForClassAnnotationTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForClassAnnotationTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForClassAnnotationTest on PageForClassAnnotationTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForClassAnnotationTest() { return {}; @@ -548,96 +258,9 @@ mixin $$PageForClassAnnotationTest on PageForClassAnnotationTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPrivateFieldsTest extends PageForPrivateFieldsTest - with $$PageForPrivateFieldsTest { - PageLoaderElement $__root__; - $PageForPrivateFieldsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPrivateFieldsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPrivateFieldsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPrivateFieldsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPrivateFieldsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPrivateFieldsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForPrivateFieldsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPrivateFieldsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Table get table { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForPrivateFieldsTest', 'table'); - } - final returnMe = super.table; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForPrivateFieldsTest', 'table'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForPrivateFieldsTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPrivateFieldsTest on PageForPrivateFieldsTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForPrivateFieldsTest() { return {}; @@ -706,82 +329,9 @@ mixin $$PageForPrivateFieldsTest on PageForPrivateFieldsTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForFocusTest extends PageForFocusTest with $$PageForFocusTest { - PageLoaderElement $__root__; - $PageForFocusTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForFocusTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForFocusTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForFocusTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForFocusTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForFocusTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForFocusTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForFocusTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForFocusTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForFocusTest on PageForFocusTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForFocusTest() { return {}; @@ -836,82 +386,9 @@ mixin $$PageForFocusTest on PageForFocusTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForNbspTest extends PageForNbspTest with $$PageForNbspTest { - PageLoaderElement $__root__; - $PageForNbspTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForNbspTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForNbspTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForNbspTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForNbspTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForNbspTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForNbspTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForNbspTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForNbspTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForNbspTest on PageForNbspTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForNbspTest() { return {}; @@ -966,81 +443,9 @@ mixin $$PageForNbspTest on PageForNbspTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Basic extends Basic with $$Basic { - PageLoaderElement $__root__; - $Basic.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Basic.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Basic is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasic()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasic()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBasic( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBasic(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Basic". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Basic\n\n${$__root__.toStringDeep()}'; -} mixin $$Basic on Basic { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBasic() { return {}; @@ -1097,82 +502,9 @@ mixin $$Basic on Basic { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $OuterNested extends OuterNested with $$OuterNested { - PageLoaderElement $__root__; - $OuterNested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $OuterNested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "OuterNested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInOuterNested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInOuterNested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInOuterNested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInOuterNested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "OuterNested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'OuterNested\n\n${$__root__.toStringDeep()}'; -} mixin $$OuterNested on OuterNested { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInOuterNested() { return {}; @@ -1227,82 +559,9 @@ mixin $$OuterNested on OuterNested { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $DebugId extends DebugId with $$DebugId { - PageLoaderElement $__root__; - $DebugId.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $DebugId.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "DebugId is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDebugId()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDebugId()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInDebugId( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInDebugId(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "DebugId". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'DebugId\n\n${$__root__.toStringDeep()}'; -} mixin $$DebugId on DebugId { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInDebugId() { return {}; @@ -1356,82 +615,9 @@ mixin $$DebugId on DebugId { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Display extends Display with $$Display { - PageLoaderElement $__root__; - $Display.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Display.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Display is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDisplay()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDisplay()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInDisplay( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInDisplay(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Display". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Display\n\n${$__root__.toStringDeep()}'; -} mixin $$Display on Display { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInDisplay() { return {}; @@ -1487,7 +673,7 @@ mixin $$Display on Display { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$ClassMixinPO on ClassMixinPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInClassMixinPO() { return { @@ -1551,95 +737,9 @@ mixin $$ClassMixinPO on ClassMixinPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $POWithClassMixinPO extends POWithClassMixinPO - with $$ClassMixinPO, $$POWithClassMixinPO { - PageLoaderElement $__root__; - $POWithClassMixinPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $POWithClassMixinPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "POWithClassMixinPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInClassMixinPO()); - getters.addAll(testCreatorGettersInPOWithClassMixinPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInClassMixinPO()); - methods.addAll(testCreatorMethodsInPOWithClassMixinPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPOWithClassMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInClassMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPOWithClassMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInClassMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "POWithClassMixinPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'POWithClassMixinPO\n\n${$__root__.toStringDeep()}'; -} mixin $$POWithClassMixinPO on POWithClassMixinPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPOWithClassMixinPO() { return {}; @@ -1669,116 +769,96 @@ mixin $$POWithClassMixinPO on POWithClassMixinPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $POWithMixinPO extends POWithMixinPO with $$MixinPO, $$POWithMixinPO { - PageLoaderElement $__root__; - $POWithMixinPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $POWithMixinPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "POWithMixinPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMixinPO()); - getters.addAll(testCreatorGettersInPOWithMixinPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMixinPO()); - methods.addAll(testCreatorMethodsInPOWithMixinPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPOWithMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - try { - return testCreatorInvokeMethodInMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} +mixin $$POWithMixinPO on POWithMixinPO { + /*late*/ PageLoaderElement $__root__; + PageLoaderElement get $root => $__root__; + Map testCreatorGettersInPOWithMixinPO() { + return {}; + } + + Map>> + testCreatorMethodsInPOWithMixinPO() { + return {}; + } + dynamic testCreatorInvokeMethodInPOWithMixinPO( + String methodName, List positionalArguments, + [Map /*?*/ namedArguments]) { throw 'METHOD NOT FOUND. This method' ' failed to be generated during test creator codegen.'; } - String /*?*/ findChain(List rawInternalIds, + Map) /*?*/ > findChainInPOWithMixinPO( + List internalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - var closestIndex = internalIds.length; String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPOWithMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; + return {closestIndex: closestValue}; } - - static String get tagName => - throw '"tagName" is not defined by Page Object "POWithMixinPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'POWithMixinPO\n\n${$__root__.toStringDeep()}'; } -mixin $$POWithMixinPO on POWithMixinPO { -/*late*/ PageLoaderElement $__root__; +// ignore_for_file: unused_field, non_constant_identifier_names +// ignore_for_file: overridden_fields, annotate_overrides +// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package + +mixin $$MixinPO on MixinPO { + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; - Map testCreatorGettersInPOWithMixinPO() { - return {}; + Map testCreatorGettersInMixinPO() { + return { + 'mixinDivText': 'String', + 'getterMessage': 'String', + }; } - Map>> - testCreatorMethodsInPOWithMixinPO() { + Map>> testCreatorMethodsInMixinPO() { return {}; } - dynamic testCreatorInvokeMethodInPOWithMixinPO( + dynamic testCreatorInvokeMethodInMixinPO( String methodName, List positionalArguments, [Map /*?*/ namedArguments]) { + if (methodName == 'mixinDivText') { + return mixinDivText; + } + if (methodName == 'getterMessage') { + return getterMessage; + } + if (methodName == 'methodMessage') { + return Function.apply(methodMessage, positionalArguments, namedArguments); + } throw 'METHOD NOT FOUND. This method' ' failed to be generated during test creator codegen.'; } - Map) /*?*/ > findChainInPOWithMixinPO( + Map) /*?*/ > findChainInMixinPO( List internalIds, [String action = 'default']) { var closestIndex = internalIds.length; String Function(List) /*?*/ closestValue; + try { + var _mixinDivIndex = internalIds.indexOf(this._mixinDiv.id); + if (_mixinDivIndex >= 0 && _mixinDivIndex < closestIndex) { + closestIndex = _mixinDivIndex; + closestValue = (_) => + '_mixinDiv.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; + } + } catch (_) { + // Ignored. + } return {closestIndex: closestValue}; } + + PageLoaderElement get _mixinDiv { + for (final __listener in $__root__.listeners) { + __listener.startPageObjectMethod('MixinPO', '_mixinDiv'); + } + final element = $__root__.createElement(ById('mixin-div'), [], []); + final returnMe = element; + for (final __listener in $__root__.listeners) { + __listener.endPageObjectMethod('MixinPO', '_mixinDiv'); + } + return returnMe; + } } diff --git a/test/src/cache_invalidation.g.dart b/test/src/cache_invalidation.g.dart index de8c94b6..6376ea93 100644 --- a/test/src/cache_invalidation.g.dart +++ b/test/src/cache_invalidation.g.dart @@ -10,82 +10,9 @@ part of 'cache_invalidation.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CacheInvalidation extends CacheInvalidation with $$CacheInvalidation { - PageLoaderElement $__root__; - $CacheInvalidation.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $CacheInvalidation.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "CacheInvalidation is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCacheInvalidation()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCacheInvalidation()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCacheInvalidation( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCacheInvalidation(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "CacheInvalidation". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'CacheInvalidation\n\n${$__root__.toStringDeep()}'; -} mixin $$CacheInvalidation on CacheInvalidation { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInCacheInvalidation() { return {}; @@ -168,82 +95,9 @@ mixin $$CacheInvalidation on CacheInvalidation { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $_Nested extends _Nested with $$_Nested { - PageLoaderElement $__root__; - $_Nested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $_Nested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "_Nested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersIn_Nested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsIn_Nested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodIn_Nested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainIn_Nested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "_Nested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => '_Nested\n\n${$__root__.toStringDeep()}'; -} mixin $$_Nested on _Nested { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersIn_Nested() { return {}; diff --git a/test/src/constructors.g.dart b/test/src/constructors.g.dart index 4edb51c1..8e0e1f5c 100644 --- a/test/src/constructors.g.dart +++ b/test/src/constructors.g.dart @@ -10,82 +10,9 @@ part of 'constructors.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BasePO extends BasePO with $$BasePO { - PageLoaderElement $__root__; - $BasePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BasePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BasePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBasePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBasePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BasePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BasePO\n\n${$__root__.toStringDeep()}'; -} mixin $$BasePO on BasePO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBasePO() { return {}; @@ -142,134 +69,9 @@ mixin $$BasePO on BasePO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BCustomTagPO extends BCustomTagPO with $$BCustomTagPO { - PageLoaderElement $__root__; - $BCustomTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag(BCustomTagPO.tagName)]); - } - factory $BCustomTagPO.lookup(PageLoaderSource source) => - $BCustomTagPO.create(source.byTag(BCustomTagPO.tagName)); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBCustomTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBCustomTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBCustomTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBCustomTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = BCustomTagPO.tagName; - PageLoaderElement get rootElement { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'rootElement'); - } - final returnMe = super.rootElement; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'rootElement'); - } - return returnMe; - } - - PageUtils get _utils { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', '_utils'); - } - final returnMe = super._utils; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', '_utils'); - } - return returnMe; - } - - CCustomTagPO get cTagFromPLE { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'cTagFromPLE'); - } - final returnMe = super.cTagFromPLE; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'cTagFromPLE'); - } - return returnMe; - } - - CCustomTagPO get cTagFromUtils { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'cTagFromUtils'); - } - final returnMe = super.cTagFromUtils; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'cTagFromUtils'); - } - return returnMe; - } - - NoLookupPO get noLookupPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'noLookupPO'); - } - final returnMe = super.noLookupPO; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'noLookupPO'); - } - return returnMe; - } - - String toStringDeep() => 'BCustomTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$BCustomTagPO on BCustomTagPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBCustomTagPO() { return {}; @@ -386,90 +188,9 @@ mixin $$BCustomTagPO on BCustomTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CCustomTagPO extends CCustomTagPO with $$CCustomTagPO { - PageLoaderElement $__root__; - $CCustomTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag(CCustomTagPO.tagName)]); - } - factory $CCustomTagPO.lookup(PageLoaderSource source) => - $CCustomTagPO.create(source.byTag(CCustomTagPO.tagName)); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCCustomTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCCustomTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCCustomTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCCustomTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = CCustomTagPO.tagName; - String get innerText { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CCustomTagPO', 'innerText'); - } - final returnMe = super.innerText; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CCustomTagPO', 'innerText'); - } - return returnMe; - } - - String toStringDeep() => 'CCustomTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$CCustomTagPO on CCustomTagPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInCCustomTagPO() { return { @@ -526,82 +247,9 @@ mixin $$CCustomTagPO on CCustomTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NoLookupPO extends NoLookupPO with $$NoLookupPO { - PageLoaderElement $__root__; - $NoLookupPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NoLookupPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NoLookupPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNoLookupPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNoLookupPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInNoLookupPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInNoLookupPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NoLookupPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NoLookupPO\n\n${$__root__.toStringDeep()}'; -} mixin $$NoLookupPO on NoLookupPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInNoLookupPO() { return {}; diff --git a/test/src/custom_events.g.dart b/test/src/custom_events.g.dart index 0c4b3984..101e258c 100644 --- a/test/src/custom_events.g.dart +++ b/test/src/custom_events.g.dart @@ -10,85 +10,9 @@ part of 'custom_events.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForCustomEventsTest extends PageForCustomEventsTest - with $$PageForCustomEventsTest { - PageLoaderElement $__root__; - $PageForCustomEventsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForCustomEventsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForCustomEventsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForCustomEventsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForCustomEventsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForCustomEventsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForCustomEventsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForCustomEventsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForCustomEventsTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForCustomEventsTest on PageForCustomEventsTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForCustomEventsTest() { return {}; diff --git a/test/src/findchain.g.dart b/test/src/findchain.g.dart deleted file mode 100644 index 8591e147..00000000 --- a/test/src/findchain.g.dart +++ /dev/null @@ -1,914 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND -// @dart=2.9 - -part of 'findchain.dart'; - -// ************************************************************************** -// PageObjectGenerator -// ************************************************************************** - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForFindChainTests extends PageForFindChainTests - with $$PageForFindChainTests { - PageLoaderElement $__root__; - $PageForFindChainTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForFindChainTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForFindChainTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForFindChainTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForFindChainTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForFindChainTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForFindChainTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForFindChainTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - OuterPO get firstOuter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'firstOuter'); - } - final returnMe = super.firstOuter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'firstOuter'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForFindChainTests\n\n${$__root__.toStringDeep()}'; -} - -mixin $$PageForFindChainTests on PageForFindChainTests { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInPageForFindChainTests() { - return {}; - } - - Map>> - testCreatorMethodsInPageForFindChainTests() { - return {}; - } - - dynamic testCreatorInvokeMethodInPageForFindChainTests( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'custom') { - return custom; - } - if (methodName == 'table') { - return table; - } - if (methodName == 'inputs') { - return inputs; - } - if (methodName == 'outers') { - return outers; - } - if (methodName == 'customPOs') { - return customPOs; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > - findChainInPageForFindChainTests(List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - // Do not know the type. Try it out and ignore if not successful. - var firstOuterElement = this.firstOuter as dynamic; - var firstOuterIndex = - internalIds.indexOf(firstOuterElement.$__root__.id as String); - if (firstOuterIndex >= 0 && firstOuterIndex < closestIndex) { - closestIndex = firstOuterIndex; - closestValue = (ids) => - 'firstOuter.${firstOuterElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var customElement = this.custom as dynamic; - var customIndex = - internalIds.indexOf(customElement.$__root__.id as String); - if (customIndex >= 0 && customIndex < closestIndex) { - closestIndex = customIndex; - closestValue = (ids) => 'custom.${customElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - try { - var tableElement = this.table as dynamic; - var tableIndex = internalIds.indexOf(tableElement.$__root__.id as String); - if (tableIndex >= 0 && tableIndex < closestIndex) { - closestIndex = tableIndex; - closestValue = (ids) => 'table.${tableElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - final outersElements = this.outers; - for (var elementIter = 0; - elementIter < outersElements.length; - elementIter++) { - try { - var outersElement = outersElements[elementIter] as dynamic; - var outersIndex = - internalIds.indexOf(outersElement.$__root__.id as String); - if (outersIndex >= 0 && outersIndex < closestIndex) { - closestIndex = outersIndex; - closestValue = (ids) => - 'outers[$elementIter].${outersElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final customPOsElements = this.customPOs; - for (var elementIter = 0; - elementIter < customPOsElements.length; - elementIter++) { - try { - var customPOsElement = customPOsElements[elementIter] as dynamic; - var customPOsIndex = - internalIds.indexOf(customPOsElement.$__root__.id as String); - if (customPOsIndex >= 0 && customPOsIndex < closestIndex) { - closestIndex = customPOsIndex; - closestValue = (ids) => - 'customPOs[$elementIter].${customPOsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - final inputsElements = this.inputs; - for (var elementIter = 0; - elementIter < inputsElements.length; - elementIter++) { - try { - var inputsIndex = internalIds.indexOf(inputsElements[elementIter].id); - if (inputsIndex >= 0 && inputsIndex < closestIndex) { - closestIndex = inputsIndex; - closestValue = (_) => - 'inputs[$elementIter].${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - CustomPO get custom { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'custom'); - } - final element = $__root__.createElement(ById('button-1'), [], []); - final returnMe = CustomPO.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'custom'); - } - return returnMe; - } - - TablePO get table { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'table'); - } - final element = $__root__.createElement(ById('table1'), [], []); - final returnMe = TablePO.create(element); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'table'); - } - return returnMe; - } - - PageObjectList get inputs { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'inputs'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('input'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'inputs'); - } - return returnMe; - } - - PageObjectList get outers { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'outers'); - } - final returnMe = PageObjectList( - $__root__.createList(ByClass('outer-div'), [], []), - (PageLoaderElement e) => OuterPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'outers'); - } - return returnMe; - } - - PageObjectList get customPOs { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'customPOs'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('button'), [], []), - (PageLoaderElement e) => CustomPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'customPOs'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CustomPO extends CustomPO with $$CustomPO { - PageLoaderElement $__root__; - $CustomPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('button')]); - } - factory $CustomPO.lookup(PageLoaderSource source) => - $CustomPO.create(source.byTag('button')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCustomPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCustomPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInCustomPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInCustomPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'button'; - String toStringDeep() => 'CustomPO\n\n${$__root__.toStringDeep()}'; -} - -mixin $$CustomPO on CustomPO { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInCustomPO() { - return {}; - } - - Map>> testCreatorMethodsInCustomPO() { - return {}; - } - - dynamic testCreatorInvokeMethodInCustomPO( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInCustomPO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - return {closestIndex: closestValue}; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $OuterPO extends OuterPO with $$OuterMixin, $$OuterPO { - PageLoaderElement $__root__; - $OuterPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $OuterPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "OuterPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInOuterMixin()); - getters.addAll(testCreatorGettersInOuterPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInOuterMixin()); - methods.addAll(testCreatorMethodsInOuterPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInOuterPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInOuterMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInOuterPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInOuterMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "OuterPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - PageLoaderElement get firstInner { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('OuterPO', 'firstInner'); - } - final returnMe = super.firstInner; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('OuterPO', 'firstInner'); - } - return returnMe; - } - - String toStringDeep() => 'OuterPO\n\n${$__root__.toStringDeep()}'; -} - -mixin $$OuterPO on OuterPO { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInOuterPO() { - return {}; - } - - Map>> testCreatorMethodsInOuterPO() { - return {}; - } - - dynamic testCreatorInvokeMethodInOuterPO( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'specialInner') { - return specialInner; - } - if (methodName == 'divDiv') { - return divDiv; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInOuterPO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - try { - var firstInnerIndex = internalIds.indexOf(this.firstInner.id); - if (firstInnerIndex >= 0 && firstInnerIndex < closestIndex) { - closestIndex = firstInnerIndex; - closestValue = (_) => - 'firstInner.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - try { - var specialInnerIndex = internalIds.indexOf(this.specialInner.id); - if (specialInnerIndex >= 0 && specialInnerIndex < closestIndex) { - closestIndex = specialInnerIndex; - closestValue = (_) => - 'specialInner.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - try { - var divDivIndex = internalIds.indexOf(this.divDiv.id); - if (divDivIndex >= 0 && divDivIndex < closestIndex) { - closestIndex = divDivIndex; - closestValue = (_) => - 'divDiv.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get specialInner { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('OuterPO', 'specialInner'); - } - final element = $__root__.createElement(ByClass('special'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('OuterPO', 'specialInner'); - } - return returnMe; - } - - PageLoaderElement get divDiv { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('OuterPO', 'divDiv'); - } - final element = $__root__.createElement(Global(ById('div')), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('OuterPO', 'divDiv'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package - -mixin $$OuterMixin on OuterMixin { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInOuterMixin() { - return {}; - } - - Map>> - testCreatorMethodsInOuterMixin() { - return {}; - } - - dynamic testCreatorInvokeMethodInOuterMixin( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'inners') { - return inners; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInOuterMixin( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - final innersElements = this.inners; - for (var elementIter = 0; - elementIter < innersElements.length; - elementIter++) { - try { - var innersIndex = internalIds.indexOf(innersElements[elementIter].id); - if (innersIndex >= 0 && innersIndex < closestIndex) { - closestIndex = innersIndex; - closestValue = (_) => - 'inners[$elementIter].${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - PageObjectList get inners { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('OuterMixin', 'inners'); - } - final returnMe = PageObjectList( - $__root__.createList(ByClass('inner-div'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('OuterMixin', 'inners'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TablePO extends TablePO with $$TablePO { - PageLoaderElement $__root__; - $TablePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $TablePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "TablePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTablePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTablePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTablePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTablePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "TablePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'TablePO\n\n${$__root__.toStringDeep()}'; -} - -mixin $$TablePO on TablePO { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInTablePO() { - return {}; - } - - Map>> testCreatorMethodsInTablePO() { - return {}; - } - - dynamic testCreatorInvokeMethodInTablePO( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'rows') { - return rows; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInTablePO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - final rowsElements = this.rows; - for (var elementIter = 0; - elementIter < rowsElements.length; - elementIter++) { - try { - var rowsElement = rowsElements[elementIter] as dynamic; - var rowsIndex = internalIds.indexOf(rowsElement.$__root__.id as String); - if (rowsIndex >= 0 && rowsIndex < closestIndex) { - closestIndex = rowsIndex; - closestValue = (ids) => - 'rows[$elementIter].${rowsElement.findChain(ids, action)}' - .replaceAll(RegExp('\\.\$'), ''); - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - PageObjectList get rows { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('TablePO', 'rows'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('tr'), [], []), - (PageLoaderElement e) => RowPO.create(e)); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('TablePO', 'rows'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RowPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RowPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {"value": "test", "click": "focus"}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RowPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} - -mixin $$RowPO on RowPO { -/*late*/ PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInRowPO() { - return {}; - } - - Map>> testCreatorMethodsInRowPO() { - return {}; - } - - dynamic testCreatorInvokeMethodInRowPO( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - if (methodName == 'cells') { - return cells; - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map) /*?*/ > findChainInRowPO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - final cellsElements = this.cells; - for (var elementIter = 0; - elementIter < cellsElements.length; - elementIter++) { - try { - var cellsIndex = internalIds.indexOf(cellsElements[elementIter].id); - if (cellsIndex >= 0 && cellsIndex < closestIndex) { - closestIndex = cellsIndex; - closestValue = (_) => - 'cells[$elementIter].${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - } - return {closestIndex: closestValue}; - } - - PageObjectList get cells { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RowPO', 'cells'); - } - final returnMe = PageObjectList( - $__root__.createList(ByTagName('td'), [], []), - (PageLoaderElement e) => e); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RowPO', 'cells'); - } - return returnMe; - } -} diff --git a/test/src/generics.g.dart b/test/src/generics.g.dart index 4ba7ded6..ef2c74f4 100644 --- a/test/src/generics.g.dart +++ b/test/src/generics.g.dart @@ -10,93 +10,9 @@ part of 'generics.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'typeDefParameter'); - } - return returnMe; - } - - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} mixin $$Generics on Generics { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInGenerics() { return {}; @@ -129,82 +45,9 @@ mixin $$Generics on Generics { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPo extends RootPo with $$RootPo { - PageLoaderElement $__root__; - $RootPo.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPo.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPo is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPo()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPo()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRootPo( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRootPo(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPo". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPo\n\n${$__root__.toStringDeep()}'; -} mixin $$RootPo on RootPo { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRootPo() { return {}; diff --git a/test/src/list.g.dart b/test/src/list.g.dart index 85799a59..0167846f 100644 --- a/test/src/list.g.dart +++ b/test/src/list.g.dart @@ -10,81 +10,9 @@ part of 'list.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Lists extends Lists with $$Lists { - PageLoaderElement $__root__; - $Lists.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Lists.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Lists is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInLists()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInLists()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInLists( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInLists(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Lists". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Lists\n\n${$__root__.toStringDeep()}'; -} mixin $$Lists on Lists { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInLists() { return {}; @@ -197,89 +125,9 @@ mixin $$Lists on Lists { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('tr')]); - } - factory $RowPO.lookup(PageLoaderSource source) => - $RowPO.create(source.byTag('tr')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'tr'; - bool get exists { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RowPO', 'exists'); - } - final returnMe = super.exists; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RowPO', 'exists'); - } - return returnMe; - } - - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} mixin $$RowPO on RowPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRowPO() { return { diff --git a/test/src/long_exception.g.dart b/test/src/long_exception.g.dart index 55d98a60..948f1f0d 100644 --- a/test/src/long_exception.g.dart +++ b/test/src/long_exception.g.dart @@ -10,82 +10,9 @@ part of 'long_exception.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MyPageObject extends MyPageObject with $$MyPageObject { - PageLoaderElement $__root__; - $MyPageObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MyPageObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MyPageObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMyPageObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMyPageObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInMyPageObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInMyPageObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MyPageObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'MyPageObject\n\n${$__root__.toStringDeep()}'; -} mixin $$MyPageObject on MyPageObject { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInMyPageObject() { return {}; diff --git a/test/src/mouse.g.dart b/test/src/mouse.g.dart index f7162ac7..cfaa6d2e 100644 --- a/test/src/mouse.g.dart +++ b/test/src/mouse.g.dart @@ -10,82 +10,9 @@ part of 'mouse.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForMouseTest extends PageForMouseTest with $$PageForMouseTest { - PageLoaderElement $__root__; - $PageForMouseTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForMouseTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForMouseTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForMouseTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForMouseTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForMouseTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForMouseTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForMouseTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForMouseTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForMouseTest on PageForMouseTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderMouse /*?*/ __mouse__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForMouseTest() { diff --git a/test/src/null_element.g.dart b/test/src/null_element.g.dart index 200c2723..993d6b6a 100644 --- a/test/src/null_element.g.dart +++ b/test/src/null_element.g.dart @@ -10,104 +10,9 @@ part of 'null_element.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BasePO extends BasePO with $$BasePO { - PageLoaderElement $__root__; - $BasePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BasePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BasePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInBasePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInBasePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BasePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - List get allRows { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BasePO', 'allRows'); - } - final returnMe = super.allRows; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BasePO', 'allRows'); - } - return returnMe; - } - - List get allRowPOs { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BasePO', 'allRowPOs'); - } - final returnMe = super.allRowPOs; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BasePO', 'allRowPOs'); - } - return returnMe; - } - - String toStringDeep() => 'BasePO\n\n${$__root__.toStringDeep()}'; -} mixin $$BasePO on BasePO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInBasePO() { return { @@ -358,82 +263,9 @@ mixin $$BasePO on BasePO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ButtonPO extends ButtonPO with $$ButtonPO { - PageLoaderElement $__root__; - $ButtonPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ButtonPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ButtonPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInButtonPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInButtonPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInButtonPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInButtonPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ButtonPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ButtonPO\n\n${$__root__.toStringDeep()}'; -} mixin $$ButtonPO on ButtonPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInButtonPO() { return {}; @@ -462,81 +294,9 @@ mixin $$ButtonPO on ButtonPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RowPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RowPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RowPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} mixin $$RowPO on RowPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRowPO() { return {}; diff --git a/test/src/page_utils.g.dart b/test/src/page_utils.g.dart index 2cc850d7..b9a4bae3 100644 --- a/test/src/page_utils.g.dart +++ b/test/src/page_utils.g.dart @@ -10,84 +10,9 @@ part of 'page_utils.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPageUtilsTests extends PageForPageUtilsTests - with $$PageForPageUtilsTests { - PageLoaderElement $__root__; - $PageForPageUtilsTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPageUtilsTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPageUtilsTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPageUtilsTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPageUtilsTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPageUtilsTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForPageUtilsTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPageUtilsTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForPageUtilsTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPageUtilsTests on PageForPageUtilsTests { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForPageUtilsTests() { return {}; diff --git a/test/src/pointer.g.dart b/test/src/pointer.g.dart index 71fa47b9..cc1d16e1 100644 --- a/test/src/pointer.g.dart +++ b/test/src/pointer.g.dart @@ -10,82 +10,9 @@ part of 'pointer.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPointerTest extends PageForPointerTest with $$PageForPointerTest { - PageLoaderElement $__root__; - $PageForPointerTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPointerTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPointerTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPointerTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPointerTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPointerTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForPointerTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPointerTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForPointerTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPointerTest on PageForPointerTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderPointer /*?*/ __pointer__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForPointerTest() { diff --git a/test/src/properties.g.dart b/test/src/properties.g.dart index 49667d2a..cf4fad1e 100644 --- a/test/src/properties.g.dart +++ b/test/src/properties.g.dart @@ -10,85 +10,9 @@ part of 'properties.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPropertiesTests extends PageForPropertiesTests - with $$PageForPropertiesTests { - PageLoaderElement $__root__; - $PageForPropertiesTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPropertiesTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPropertiesTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPropertiesTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPropertiesTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPropertiesTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForPropertiesTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPropertiesTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForPropertiesTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPropertiesTests on PageForPropertiesTests { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForPropertiesTests() { return {}; diff --git a/test/src/scroll.g.dart b/test/src/scroll.g.dart index 6df1339e..252be012 100644 --- a/test/src/scroll.g.dart +++ b/test/src/scroll.g.dart @@ -10,115 +10,9 @@ part of 'scroll.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ScrollPO extends ScrollPO with $$ScrollPO { - PageLoaderElement $__root__; - $ScrollPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ScrollPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ScrollPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInScrollPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInScrollPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInScrollPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInScrollPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ScrollPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - int get scrollLeft { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scrollLeft'); - } - final returnMe = super.scrollLeft; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scrollLeft'); - } - return returnMe; - } - - int get scrollTop { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scrollTop'); - } - final returnMe = super.scrollTop; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scrollTop'); - } - return returnMe; - } - - Future scroll({int x, int y}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scroll'); - } - final returnMe = super.scroll(x: x, y: y); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scroll'); - } - return returnMe; - } - - String toStringDeep() => 'ScrollPO\n\n${$__root__.toStringDeep()}'; -} mixin $$ScrollPO on ScrollPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInScrollPO() { return { diff --git a/test/src/shared_list_page_objects.g.dart b/test/src/shared_list_page_objects.g.dart index e4a97c26..8ccc2a36 100644 --- a/test/src/shared_list_page_objects.g.dart +++ b/test/src/shared_list_page_objects.g.dart @@ -10,82 +10,9 @@ part of 'shared_list_page_objects.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForSimpleTest extends PageForSimpleTest with $$PageForSimpleTest { - PageLoaderElement $__root__; - $PageForSimpleTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForSimpleTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForSimpleTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForSimpleTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForSimpleTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForSimpleTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForSimpleTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForSimpleTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForSimpleTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForSimpleTest on PageForSimpleTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForSimpleTest() { return {}; @@ -166,81 +93,9 @@ mixin $$PageForSimpleTest on PageForSimpleTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Table extends Table with $$Table { - PageLoaderElement $__root__; - $Table.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Table.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Table is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTable()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTable()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTable( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTable(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Table". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Table\n\n${$__root__.toStringDeep()}'; -} mixin $$Table on Table { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInTable() { return {}; @@ -344,81 +199,9 @@ mixin $$Table on Table { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Row extends Row with $$Row { - PageLoaderElement $__root__; - $Row.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Row.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Row is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRow()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRow()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRow( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRow(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Row". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Row\n\n${$__root__.toStringDeep()}'; -} mixin $$Row on Row { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRow() { return {}; diff --git a/test/src/shared_page_objects.g.dart b/test/src/shared_page_objects.g.dart index 58c5b411..f31082de 100644 --- a/test/src/shared_page_objects.g.dart +++ b/test/src/shared_page_objects.g.dart @@ -10,82 +10,9 @@ part of 'shared_page_objects.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForSimpleTest extends PageForSimpleTest with $$PageForSimpleTest { - PageLoaderElement $__root__; - $PageForSimpleTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForSimpleTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForSimpleTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForSimpleTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForSimpleTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForSimpleTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForSimpleTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForSimpleTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForSimpleTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForSimpleTest on PageForSimpleTest { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForSimpleTest() { return {}; @@ -141,92 +68,9 @@ mixin $$PageForSimpleTest on PageForSimpleTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Table extends Table with $$Table { - PageLoaderElement $__root__; - $Table.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Table.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Table is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTable()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTable()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInTable( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInTable(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Table". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future doSlowAction() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Table', 'doSlowAction'); - } - final returnMe = super.doSlowAction(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Table', 'doSlowAction'); - } - return returnMe; - } - - String toStringDeep() => 'Table\n\n${$__root__.toStringDeep()}'; -} mixin $$Table on Table { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInTable() { return {}; @@ -301,81 +145,9 @@ mixin $$Table on Table { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Row extends Row with $$Row { - PageLoaderElement $__root__; - $Row.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Row.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Row is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRow()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRow()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInRow( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInRow(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Row". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Row\n\n${$__root__.toStringDeep()}'; -} mixin $$Row on Row { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRow() { return {}; diff --git a/test/src/test_creator_getters.g.dart b/test/src/test_creator_getters.g.dart index a2337605..030eae67 100644 --- a/test/src/test_creator_getters.g.dart +++ b/test/src/test_creator_getters.g.dart @@ -10,123 +10,9 @@ part of 'test_creator_getters.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndActions extends PageObjectHasGettersAndActions - with $$PageObjectHasGettersAndActions { - PageLoaderElement $__root__; - $PageObjectHasGettersAndActions.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndActions.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndActions is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasGettersAndActions()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasGettersAndActions()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndActions( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectHasGettersAndActions(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndActions". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndActions', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasGettersAndActions', 'name'); - } - return returnMe; - } - - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasGettersAndActions', 'clear'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndActions\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndActions on PageObjectHasGettersAndActions { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasGettersAndActions() { return { @@ -198,132 +84,10 @@ mixin $$PageObjectHasGettersAndActions on PageObjectHasGettersAndActions { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersThatUseDifferentReturnTypes - extends PageObjectHasGettersThatUseDifferentReturnTypes - with $$PageObjectHasGettersThatUseDifferentReturnTypes { - PageLoaderElement $__root__; - $PageObjectHasGettersThatUseDifferentReturnTypes.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersThatUseDifferentReturnTypes.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersThatUseDifferentReturnTypes is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll( - testCreatorGettersInPageObjectHasGettersThatUseDifferentReturnTypes()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll( - testCreatorMethodsInPageObjectHasGettersThatUseDifferentReturnTypes()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersThatUseDifferentReturnTypes( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectHasGettersThatUseDifferentReturnTypes( - internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersThatUseDifferentReturnTypes". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'testContext'); - } - return returnMe; - } - - bool get exists { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'exists'); - } - final returnMe = super.exists; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'exists'); - } - return returnMe; - } - - int get size { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'size'); - } - final returnMe = super.size; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'size'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersThatUseDifferentReturnTypes\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersThatUseDifferentReturnTypes on PageObjectHasGettersThatUseDifferentReturnTypes { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasGettersThatUseDifferentReturnTypes() { @@ -429,96 +193,9 @@ mixin $$PageObjectHasGettersThatUseDifferentReturnTypes // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasNoGetters extends PageObjectHasNoGetters - with $$PageObjectHasNoGetters { - PageLoaderElement $__root__; - $PageObjectHasNoGetters.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasNoGetters.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasNoGetters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasNoGetters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasNoGetters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasNoGetters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageObjectHasNoGetters(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasNoGetters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectHasNoGetters', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasNoGetters', 'clear'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasNoGetters\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasNoGetters on PageObjectHasNoGetters { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasNoGetters() { return {}; @@ -580,117 +257,9 @@ mixin $$PageObjectHasNoGetters on PageObjectHasNoGetters { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithMixin extends PageObjectWithMixin - with $$PageObjectMixin, $$PageObjectWithMixin { - PageLoaderElement $__root__; - $PageObjectWithMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectWithMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'name'); - } - return returnMe; - } - - String toStringDeep() => 'PageObjectWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithMixin on PageObjectWithMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectWithMixin() { return { @@ -756,7 +325,7 @@ mixin $$PageObjectWithMixin on PageObjectWithMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$PageObjectMixin on PageObjectMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectMixin() { return { @@ -820,111 +389,9 @@ mixin $$PageObjectMixin on PageObjectMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithOverridingMixins extends PageObjectWithOverridingMixins - with $$PageObjectMixin, $$PageObjectWithOverridingMixins { - PageLoaderElement $__root__; - $PageObjectWithOverridingMixins.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithOverridingMixins.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithOverridingMixins is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithOverridingMixins()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithOverridingMixins()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithOverridingMixins( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectWithOverridingMixins(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithOverridingMixins". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get tabContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'tabContext'); - } - final returnMe = super.tabContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectWithOverridingMixins', 'tabContext'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectWithOverridingMixins\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithOverridingMixins on PageObjectWithOverridingMixins { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectWithOverridingMixins() { return { diff --git a/test/src/test_creator_invoke_method.g.dart b/test/src/test_creator_invoke_method.g.dart index e3b43c01..619be1fd 100644 --- a/test/src/test_creator_invoke_method.g.dart +++ b/test/src/test_creator_invoke_method.g.dart @@ -10,125 +10,9 @@ part of 'test_creator_invoke_method.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndMethods extends PageObjectHasGettersAndMethods - with $$PageObjectHasGettersAndMethods { - PageLoaderElement $__root__; - $PageObjectHasGettersAndMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasGettersAndMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasGettersAndMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectHasGettersAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get getter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'getter'); - } - final returnMe = super.getter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'getter'); - } - return returnMe; - } - - void emptyFn() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'emptyFn'); - } - super.emptyFn(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'emptyFn'); - } - return; - } - - Future complexFn(String str, int number, double float, bool boolean) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'complexFn'); - } - final returnMe = super.complexFn(str, number, float, boolean); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'complexFn'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndMethods on PageObjectHasGettersAndMethods { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasGettersAndMethods() { return { @@ -234,162 +118,10 @@ mixin $$PageObjectHasGettersAndMethods on PageObjectHasGettersAndMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndMethodsWithMixin - extends PageObjectHasGettersAndMethodsWithMixin - with - $$PageObjectMixinHasGettersAndMethods, - $$RightMostPageObjectMixin, - $$PageObjectHasGettersAndMethodsWithMixin { - PageLoaderElement $__root__; - $PageObjectHasGettersAndMethodsWithMixin.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndMethodsWithMixin.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndMethodsWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixinHasGettersAndMethods()); - getters.addAll(testCreatorGettersInRightMostPageObjectMixin()); - getters - .addAll(testCreatorGettersInPageObjectHasGettersAndMethodsWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixinHasGettersAndMethods()); - methods.addAll(testCreatorMethodsInRightMostPageObjectMixin()); - methods - .addAll(testCreatorMethodsInPageObjectHasGettersAndMethodsWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndMethodsWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRightMostPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixinHasGettersAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageObjectHasGettersAndMethodsWithMixin(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = - findChainInRightMostPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixinHasGettersAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndMethodsWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get getter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'getter'); - } - final returnMe = super.getter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'getter'); - } - return returnMe; - } - - void emptyFn() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'emptyFn'); - } - super.emptyFn(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'emptyFn'); - } - return; - } - - Future complexFn(String str, int number, double float, bool boolean) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'complexFn'); - } - final returnMe = super.complexFn(str, number, float, boolean); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'complexFn'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndMethodsWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndMethodsWithMixin on PageObjectHasGettersAndMethodsWithMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasGettersAndMethodsWithMixin() { @@ -502,7 +234,7 @@ mixin $$PageObjectHasGettersAndMethodsWithMixin mixin $$PageObjectMixinHasGettersAndMethods on PageObjectMixinHasGettersAndMethods { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectMixinHasGettersAndMethods() { @@ -616,7 +348,7 @@ mixin $$PageObjectMixinHasGettersAndMethods // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$RightMostPageObjectMixin on RightMostPageObjectMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInRightMostPageObjectMixin() { return {}; diff --git a/test/src/test_creator_methods.g.dart b/test/src/test_creator_methods.g.dart index 8d2be59d..3c0f9ae6 100644 --- a/test/src/test_creator_methods.g.dart +++ b/test/src/test_creator_methods.g.dart @@ -10,152 +10,9 @@ part of 'test_creator_methods.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasPropertiesAndMethods - extends PageObjectHasPropertiesAndMethods - with $$PageObjectHasPropertiesAndMethods { - PageLoaderElement $__root__; - $PageObjectHasPropertiesAndMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasPropertiesAndMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasPropertiesAndMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasPropertiesAndMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasPropertiesAndMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasPropertiesAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectHasPropertiesAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasPropertiesAndMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'name'); - } - return returnMe; - } - - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'clear'); - } - return returnMe; - } - - Future getLength() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'getLength'); - } - final returnMe = super.getLength(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'getLength'); - } - return returnMe; - } - - void badClear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'badClear'); - } - super.badClear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'badClear'); - } - return; - } - - String toStringDeep() => - 'PageObjectHasPropertiesAndMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasPropertiesAndMethods on PageObjectHasPropertiesAndMethods { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasPropertiesAndMethods() { return { @@ -235,171 +92,10 @@ mixin $$PageObjectHasPropertiesAndMethods on PageObjectHasPropertiesAndMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasMethodsWithDifferentParameters - extends PageObjectHasMethodsWithDifferentParameters - with $$PageObjectHasMethodsWithDifferentParameters { - PageLoaderElement $__root__; - $PageObjectHasMethodsWithDifferentParameters.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasMethodsWithDifferentParameters.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasMethodsWithDifferentParameters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll( - testCreatorGettersInPageObjectHasMethodsWithDifferentParameters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll( - testCreatorMethodsInPageObjectHasMethodsWithDifferentParameters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasMethodsWithDifferentParameters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectHasMethodsWithDifferentParameters( - internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasMethodsWithDifferentParameters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future click() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'click'); - } - final returnMe = super.click(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'click'); - } - return returnMe; - } - - Future type(int index, {String text}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'type'); - } - final returnMe = super.type(index, text: text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'type'); - } - return returnMe; - } - - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'cut'); - } - return returnMe; - } - - Future defaultString([String end = '23']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultString'); - } - final returnMe = super.defaultString(end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultString'); - } - return returnMe; - } - - Future defaultBool({bool end = true}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultBool'); - } - final returnMe = super.defaultBool(end: end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultBool'); - } - return returnMe; - } - - Future varm(var x) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'varm'); - } - final returnMe = super.varm(x); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'varm'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasMethodsWithDifferentParameters\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasMethodsWithDifferentParameters on PageObjectHasMethodsWithDifferentParameters { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasMethodsWithDifferentParameters() { @@ -473,85 +169,9 @@ mixin $$PageObjectHasMethodsWithDifferentParameters // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasNoMethods extends PageObjectHasNoMethods - with $$PageObjectHasNoMethods { - PageLoaderElement $__root__; - $PageObjectHasNoMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasNoMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasNoMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasNoMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasNoMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasNoMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageObjectHasNoMethods(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasNoMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageObjectHasNoMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasNoMethods on PageObjectHasNoMethods { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectHasNoMethods() { return {}; @@ -606,106 +226,9 @@ mixin $$PageObjectHasNoMethods on PageObjectHasNoMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithMixin extends PageObjectWithMixin - with $$PageObjectMixin, $$PageObjectWithMixin { - PageLoaderElement $__root__; - $PageObjectWithMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectWithMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'cut'); - } - return returnMe; - } - - String toStringDeep() => 'PageObjectWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithMixin on PageObjectWithMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectWithMixin() { return {}; @@ -770,7 +293,7 @@ mixin $$PageObjectWithMixin on PageObjectWithMixin { // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package mixin $$PageObjectMixin on PageObjectMixin { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectMixin() { return {}; @@ -830,133 +353,9 @@ mixin $$PageObjectMixin on PageObjectMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithOverridingMixins extends PageObjectWithOverridingMixins - with $$PageObjectMixin, $$PageObjectWithOverridingMixins { - PageLoaderElement $__root__; - $PageObjectWithOverridingMixins.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithOverridingMixins.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithOverridingMixins is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithOverridingMixins()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithOverridingMixins()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithOverridingMixins( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageObjectWithOverridingMixins(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithOverridingMixins". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithOverridingMixins', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'cut'); - } - return returnMe; - } - - Future click() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'click'); - } - final returnMe = super.click(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'click'); - } - return returnMe; - } - - Future varm(var x) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'varm'); - } - final returnMe = super.varm(x); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'varm'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectWithOverridingMixins\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithOverridingMixins on PageObjectWithOverridingMixins { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageObjectWithOverridingMixins() { return {}; diff --git a/test/src/typing.g.dart b/test/src/typing.g.dart index bbac2ad8..603791cb 100644 --- a/test/src/typing.g.dart +++ b/test/src/typing.g.dart @@ -10,85 +10,9 @@ part of 'typing.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTextAreaTypingText extends PageForTextAreaTypingText - with $$PageForTextAreaTypingText { - PageLoaderElement $__root__; - $PageForTextAreaTypingText.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTextAreaTypingText.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTextAreaTypingText is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTextAreaTypingText()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTextAreaTypingText()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTextAreaTypingText( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = - findChainInPageForTextAreaTypingText(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTextAreaTypingText". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForTextAreaTypingText\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTextAreaTypingText on PageForTextAreaTypingText { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForTextAreaTypingText() { return {}; @@ -143,82 +67,9 @@ mixin $$PageForTextAreaTypingText on PageForTextAreaTypingText { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTypingTests extends PageForTypingTests with $$PageForTypingTests { - PageLoaderElement $__root__; - $PageForTypingTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTypingTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTypingTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTypingTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTypingTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTypingTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForTypingTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTypingTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForTypingTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTypingTests on PageForTypingTests { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForTypingTests() { return {}; @@ -273,114 +124,10 @@ mixin $$PageForTypingTests on PageForTypingTests { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTypingTestsWithFocusAndBlur - extends PageForTypingTestsWithFocusAndBlur - with $$PageForTypingTestsWithFocusAndBlur { - PageLoaderElement $__root__; - $PageForTypingTestsWithFocusAndBlur.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTypingTestsWithFocusAndBlur.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTypingTestsWithFocusAndBlur is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTypingTestsWithFocusAndBlur()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTypingTestsWithFocusAndBlur()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTypingTestsWithFocusAndBlur( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInPageForTypingTestsWithFocusAndBlur(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTypingTestsWithFocusAndBlur". Requires @CheckTag annotation in order for "tagName" to be generated.'; - int get focusCount { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'focusCount'); - } - final returnMe = super.focusCount; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'focusCount'); - } - return returnMe; - } - - int get blurCount { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'blurCount'); - } - final returnMe = super.blurCount; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'blurCount'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForTypingTestsWithFocusAndBlur\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTypingTestsWithFocusAndBlur on PageForTypingTestsWithFocusAndBlur { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInPageForTypingTestsWithFocusAndBlur() { return { @@ -497,82 +244,9 @@ mixin $$PageForTypingTestsWithFocusAndBlur // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $KeyboardListenerPO extends KeyboardListenerPO with $$KeyboardListenerPO { - PageLoaderElement $__root__; - $KeyboardListenerPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $KeyboardListenerPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "KeyboardListenerPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInKeyboardListenerPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInKeyboardListenerPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInKeyboardListenerPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInKeyboardListenerPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "KeyboardListenerPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'KeyboardListenerPO\n\n${$__root__.toStringDeep()}'; -} mixin $$KeyboardListenerPO on KeyboardListenerPO { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInKeyboardListenerPO() { return {}; diff --git a/test/src/webdriver_only.g.dart b/test/src/webdriver_only.g.dart index 9fb5cc46..cec2a65b 100644 --- a/test/src/webdriver_only.g.dart +++ b/test/src/webdriver_only.g.dart @@ -10,82 +10,9 @@ part of 'webdriver_only.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $WebDriverOnly extends WebDriverOnly with $$WebDriverOnly { - PageLoaderElement $__root__; - $WebDriverOnly.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $WebDriverOnly.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "WebDriverOnly is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInWebDriverOnly()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInWebDriverOnly()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map /*?*/ namedArguments]) { - try { - return testCreatorInvokeMethodInWebDriverOnly( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String /*?*/ findChain(List rawInternalIds, - [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List) /*?*/ closestValue; - MapEntry) /*?*/ > chain; - chain = findChainInWebDriverOnly(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue /*!*/ (internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "WebDriverOnly". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'WebDriverOnly\n\n${$__root__.toStringDeep()}'; -} mixin $$WebDriverOnly on WebDriverOnly { -/*late*/ PageLoaderElement $__root__; + /*late*/ PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; Map testCreatorGettersInWebDriverOnly() { return {}; diff --git a/test/src_null_safety/annotations.g.dart b/test/src_null_safety/annotations.g.dart index 1096915c..240c745d 100644 --- a/test/src_null_safety/annotations.g.dart +++ b/test/src_null_safety/annotations.g.dart @@ -9,78 +9,6 @@ part of 'annotations.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BaseObject extends BaseObject with $$BaseObject { - PageLoaderElement $__root__; - $BaseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BaseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BaseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBaseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBaseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBaseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBaseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BaseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BaseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$BaseObject on BaseObject { late PageLoaderElement $__root__; @@ -220,78 +148,6 @@ mixin $$BaseObject on BaseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PseudoBaseObject extends PseudoBaseObject with $$PseudoBaseObject { - PageLoaderElement $__root__; - $PseudoBaseObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PseudoBaseObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PseudoBaseObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPseudoBaseObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPseudoBaseObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPseudoBaseObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPseudoBaseObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PseudoBaseObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PseudoBaseObject\n\n${$__root__.toStringDeep()}'; -} mixin $$PseudoBaseObject on PseudoBaseObject { late PageLoaderElement $__root__; @@ -404,75 +260,6 @@ mixin $$PseudoBaseObject on PseudoBaseObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TableForCheckTag extends TableForCheckTag with $$TableForCheckTag { - PageLoaderElement $__root__; - $TableForCheckTag.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('table')]); - } - factory $TableForCheckTag.lookup(PageLoaderSource source) => - $TableForCheckTag.create(source.byTag('table')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTableForCheckTag()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTableForCheckTag()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTableForCheckTag( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTableForCheckTag(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'table'; - String toStringDeep() => 'TableForCheckTag\n\n${$__root__.toStringDeep()}'; -} mixin $$TableForCheckTag on TableForCheckTag { late PageLoaderElement $__root__; @@ -571,78 +358,6 @@ mixin $$TableForCheckTag on TableForCheckTag { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BaseEnsureObject extends BaseEnsureObject with $$BaseEnsureObject { - PageLoaderElement $__root__; - $BaseEnsureObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BaseEnsureObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BaseEnsureObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBaseEnsureObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBaseEnsureObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBaseEnsureObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBaseEnsureObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BaseEnsureObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BaseEnsureObject\n\n${$__root__.toStringDeep()}'; -} mixin $$BaseEnsureObject on BaseEnsureObject { late PageLoaderElement $__root__; @@ -729,75 +444,6 @@ mixin $$BaseEnsureObject on BaseEnsureObject { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TableForEnsureTag extends TableForEnsureTag with $$TableForEnsureTag { - PageLoaderElement $__root__; - $TableForEnsureTag.create(PageLoaderElement currentContext) - : $__root__ = currentContext.createElement(EnsureTag('table'), [], []) { - $__root__.addCheckers([EnsureTag('table')]); - } - factory $TableForEnsureTag.lookup(PageLoaderSource source) => - $TableForEnsureTag.create(source.byTag('table')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTableForEnsureTag()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTableForEnsureTag()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTableForEnsureTag( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTableForEnsureTag(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'table'; - String toStringDeep() => 'TableForEnsureTag\n\n${$__root__.toStringDeep()}'; -} mixin $$TableForEnsureTag on TableForEnsureTag { late PageLoaderElement $__root__; @@ -871,75 +517,6 @@ mixin $$TableForEnsureTag on TableForEnsureTag { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CheckTagFails extends CheckTagFails with $$CheckTagFails { - PageLoaderElement $__root__; - $CheckTagFails.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('inconceivable')]); - } - factory $CheckTagFails.lookup(PageLoaderSource source) => - $CheckTagFails.create(source.byTag('inconceivable')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCheckTagFails()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCheckTagFails()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCheckTagFails( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCheckTagFails(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'inconceivable'; - String toStringDeep() => 'CheckTagFails\n\n${$__root__.toStringDeep()}'; -} mixin $$CheckTagFails on CheckTagFails { late PageLoaderElement $__root__; @@ -996,76 +573,6 @@ mixin $$CheckTagFails on CheckTagFails { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $EnsureTagFails extends EnsureTagFails with $$EnsureTagFails { - PageLoaderElement $__root__; - $EnsureTagFails.create(PageLoaderElement currentContext) - : $__root__ = - currentContext.createElement(EnsureTag('inconceivable'), [], []) { - $__root__.addCheckers([EnsureTag('inconceivable')]); - } - factory $EnsureTagFails.lookup(PageLoaderSource source) => - $EnsureTagFails.create(source.byTag('inconceivable')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInEnsureTagFails()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInEnsureTagFails()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInEnsureTagFails( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInEnsureTagFails(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'inconceivable'; - String toStringDeep() => 'EnsureTagFails\n\n${$__root__.toStringDeep()}'; -} mixin $$EnsureTagFails on EnsureTagFails { late PageLoaderElement $__root__; @@ -1122,81 +629,6 @@ mixin $$EnsureTagFails on EnsureTagFails { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForWithAttributeTest extends PageForWithAttributeTest - with $$PageForWithAttributeTest { - PageLoaderElement $__root__; - $PageForWithAttributeTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForWithAttributeTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForWithAttributeTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForWithAttributeTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForWithAttributeTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForWithAttributeTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForWithAttributeTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForWithAttributeTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForWithAttributeTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForWithAttributeTest on PageForWithAttributeTest { late PageLoaderElement $__root__; @@ -1255,80 +687,6 @@ mixin $$PageForWithAttributeTest on PageForWithAttributeTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForWithClassTest extends PageForWithClassTest - with $$PageForWithClassTest { - PageLoaderElement $__root__; - $PageForWithClassTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForWithClassTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForWithClassTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForWithClassTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForWithClassTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForWithClassTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForWithClassTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForWithClassTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForWithClassTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForWithClassTest on PageForWithClassTest { late PageLoaderElement $__root__; @@ -1387,78 +745,6 @@ mixin $$PageForWithClassTest on PageForWithClassTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $DebugIds extends DebugIds with $$DebugIds { - PageLoaderElement $__root__; - $DebugIds.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $DebugIds.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "DebugIds is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDebugIds()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDebugIds()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInDebugIds( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInDebugIds(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "DebugIds". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'DebugIds\n\n${$__root__.toStringDeep()}'; -} mixin $$DebugIds on DebugIds { late PageLoaderElement $__root__; @@ -1643,78 +929,6 @@ mixin $$DebugIds on DebugIds { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TestIds extends TestIds with $$TestIds { - PageLoaderElement $__root__; - $TestIds.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $TestIds.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "TestIds is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTestIds()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTestIds()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTestIds( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTestIds(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "TestIds". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'TestIds\n\n${$__root__.toStringDeep()}'; -} mixin $$TestIds on TestIds { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/attributes.g.dart b/test/src_null_safety/attributes.g.dart index 613c5ef6..c982599c 100644 --- a/test/src_null_safety/attributes.g.dart +++ b/test/src_null_safety/attributes.g.dart @@ -9,81 +9,6 @@ part of 'attributes.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForAttributesTests extends PageForAttributesTests - with $$PageForAttributesTests { - PageLoaderElement $__root__; - $PageForAttributesTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForAttributesTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForAttributesTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForAttributesTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForAttributesTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForAttributesTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForAttributesTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForAttributesTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForAttributesTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForAttributesTests on PageForAttributesTests { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/basic.g.dart b/test/src_null_safety/basic.g.dart index 4cb0ddd2..58eb462d 100644 --- a/test/src_null_safety/basic.g.dart +++ b/test/src_null_safety/basic.g.dart @@ -10,143 +10,6 @@ part of 'basic.dart'; // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -mixin $$MixinPO on MixinPO { - late PageLoaderElement $__root__; - PageLoaderElement get $root => $__root__; - Map testCreatorGettersInMixinPO() { - return { - 'mixinDivText': 'String', - 'getterMessage': 'String', - }; - } - - Map>> testCreatorMethodsInMixinPO() { - return {}; - } - - dynamic testCreatorInvokeMethodInMixinPO( - String methodName, List positionalArguments, - [Map? namedArguments]) { - if (methodName == 'mixinDivText') { - return mixinDivText; - } - if (methodName == 'getterMessage') { - return getterMessage; - } - if (methodName == 'methodMessage') { - return Function.apply(methodMessage, positionalArguments, namedArguments); - } - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - Map)?> findChainInMixinPO( - List internalIds, - [String action = 'default']) { - var closestIndex = internalIds.length; - String Function(List)? closestValue; - try { - var _mixinDivIndex = internalIds.indexOf(this._mixinDiv.id); - if (_mixinDivIndex >= 0 && _mixinDivIndex < closestIndex) { - closestIndex = _mixinDivIndex; - closestValue = (_) => - '_mixinDiv.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; - } - } catch (_) { - // Ignored. - } - return {closestIndex: closestValue}; - } - - PageLoaderElement get _mixinDiv { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('MixinPO', '_mixinDiv'); - } - final element = $__root__.createElement(ById('mixin-div'), [], []); - final returnMe = element; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('MixinPO', '_mixinDiv'); - } - return returnMe; - } -} - -// ignore_for_file: unused_field, non_constant_identifier_names -// ignore_for_file: overridden_fields, annotate_overrides -// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForExistsTest extends PageForExistsTest with $$PageForExistsTest { - PageLoaderElement $__root__; - $PageForExistsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForExistsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForExistsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForExistsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForExistsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForExistsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForExistsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForExistsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForExistsTest\n\n${$__root__.toStringDeep()}'; -} - mixin $$PageForExistsTest on PageForExistsTest { late PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; @@ -253,80 +116,6 @@ mixin $$PageForExistsTest on PageForExistsTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForVisibilityTest extends PageForVisibilityTest - with $$PageForVisibilityTest { - PageLoaderElement $__root__; - $PageForVisibilityTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForVisibilityTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForVisibilityTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForVisibilityTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForVisibilityTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForVisibilityTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForVisibilityTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForVisibilityTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForVisibilityTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForVisibilityTest on PageForVisibilityTest { late PageLoaderElement $__root__; @@ -410,82 +199,6 @@ mixin $$PageForVisibilityTest on PageForVisibilityTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForClassAnnotationTest extends PageForClassAnnotationTest - with $$PageForClassAnnotationTest { - PageLoaderElement $__root__; - $PageForClassAnnotationTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForClassAnnotationTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForClassAnnotationTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForClassAnnotationTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForClassAnnotationTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForClassAnnotationTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForClassAnnotationTest(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForClassAnnotationTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForClassAnnotationTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForClassAnnotationTest on PageForClassAnnotationTest { late PageLoaderElement $__root__; @@ -544,92 +257,6 @@ mixin $$PageForClassAnnotationTest on PageForClassAnnotationTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPrivateFieldsTest extends PageForPrivateFieldsTest - with $$PageForPrivateFieldsTest { - PageLoaderElement $__root__; - $PageForPrivateFieldsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPrivateFieldsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPrivateFieldsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPrivateFieldsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPrivateFieldsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPrivateFieldsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForPrivateFieldsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPrivateFieldsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Table get table { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForPrivateFieldsTest', 'table'); - } - final returnMe = super.table; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForPrivateFieldsTest', 'table'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForPrivateFieldsTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPrivateFieldsTest on PageForPrivateFieldsTest { late PageLoaderElement $__root__; @@ -701,78 +328,6 @@ mixin $$PageForPrivateFieldsTest on PageForPrivateFieldsTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForFocusTest extends PageForFocusTest with $$PageForFocusTest { - PageLoaderElement $__root__; - $PageForFocusTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForFocusTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForFocusTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForFocusTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForFocusTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForFocusTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForFocusTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForFocusTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForFocusTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForFocusTest on PageForFocusTest { late PageLoaderElement $__root__; @@ -830,78 +385,6 @@ mixin $$PageForFocusTest on PageForFocusTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForNbspTest extends PageForNbspTest with $$PageForNbspTest { - PageLoaderElement $__root__; - $PageForNbspTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForNbspTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForNbspTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForNbspTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForNbspTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForNbspTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForNbspTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForNbspTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForNbspTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForNbspTest on PageForNbspTest { late PageLoaderElement $__root__; @@ -959,77 +442,6 @@ mixin $$PageForNbspTest on PageForNbspTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Basic extends Basic with $$Basic { - PageLoaderElement $__root__; - $Basic.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Basic.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Basic is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasic()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasic()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBasic( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBasic(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Basic". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Basic\n\n${$__root__.toStringDeep()}'; -} mixin $$Basic on Basic { late PageLoaderElement $__root__; @@ -1089,78 +501,6 @@ mixin $$Basic on Basic { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $OuterNested extends OuterNested with $$OuterNested { - PageLoaderElement $__root__; - $OuterNested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $OuterNested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "OuterNested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInOuterNested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInOuterNested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInOuterNested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInOuterNested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "OuterNested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'OuterNested\n\n${$__root__.toStringDeep()}'; -} mixin $$OuterNested on OuterNested { late PageLoaderElement $__root__; @@ -1217,78 +557,6 @@ mixin $$OuterNested on OuterNested { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $DebugId extends DebugId with $$DebugId { - PageLoaderElement $__root__; - $DebugId.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $DebugId.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "DebugId is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDebugId()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDebugId()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInDebugId( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInDebugId(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "DebugId". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'DebugId\n\n${$__root__.toStringDeep()}'; -} mixin $$DebugId on DebugId { late PageLoaderElement $__root__; @@ -1345,78 +613,6 @@ mixin $$DebugId on DebugId { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Display extends Display with $$Display { - PageLoaderElement $__root__; - $Display.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Display.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Display is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInDisplay()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInDisplay()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInDisplay( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInDisplay(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Display". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Display\n\n${$__root__.toStringDeep()}'; -} mixin $$Display on Display { late PageLoaderElement $__root__; @@ -1538,91 +734,6 @@ mixin $$ClassMixinPO on ClassMixinPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $POWithClassMixinPO extends POWithClassMixinPO - with $$ClassMixinPO, $$POWithClassMixinPO { - PageLoaderElement $__root__; - $POWithClassMixinPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $POWithClassMixinPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "POWithClassMixinPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInClassMixinPO()); - getters.addAll(testCreatorGettersInPOWithClassMixinPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInClassMixinPO()); - methods.addAll(testCreatorMethodsInPOWithClassMixinPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPOWithClassMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInClassMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPOWithClassMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInClassMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "POWithClassMixinPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'POWithClassMixinPO\n\n${$__root__.toStringDeep()}'; -} mixin $$POWithClassMixinPO on POWithClassMixinPO { late PageLoaderElement $__root__; @@ -1655,114 +766,95 @@ mixin $$POWithClassMixinPO on POWithClassMixinPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $POWithMixinPO extends POWithMixinPO with $$MixinPO, $$POWithMixinPO { - PageLoaderElement $__root__; - $POWithMixinPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $POWithMixinPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "POWithMixinPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMixinPO()); - getters.addAll(testCreatorGettersInPOWithMixinPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMixinPO()); - methods.addAll(testCreatorMethodsInPOWithMixinPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPOWithMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - try { - return testCreatorInvokeMethodInMixinPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} +mixin $$POWithMixinPO on POWithMixinPO { + late PageLoaderElement $__root__; + PageLoaderElement get $root => $__root__; + Map testCreatorGettersInPOWithMixinPO() { + return {}; + } + Map>> testCreatorMethodsInPOWithMixinPO() { + return {}; + } + + dynamic testCreatorInvokeMethodInPOWithMixinPO( + String methodName, List positionalArguments, + [Map? namedArguments]) { throw 'METHOD NOT FOUND. This method' ' failed to be generated during test creator codegen.'; } - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - + Map)?> findChainInPOWithMixinPO( + List internalIds, + [String action = 'default']) { var closestIndex = internalIds.length; String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPOWithMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInMixinPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; + return {closestIndex: closestValue}; } - - static String get tagName => - throw '"tagName" is not defined by Page Object "POWithMixinPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'POWithMixinPO\n\n${$__root__.toStringDeep()}'; } -mixin $$POWithMixinPO on POWithMixinPO { +// ignore_for_file: unused_field, non_constant_identifier_names +// ignore_for_file: overridden_fields, annotate_overrides +// ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package + +mixin $$MixinPO on MixinPO { late PageLoaderElement $__root__; PageLoaderElement get $root => $__root__; - Map testCreatorGettersInPOWithMixinPO() { - return {}; + Map testCreatorGettersInMixinPO() { + return { + 'mixinDivText': 'String', + 'getterMessage': 'String', + }; } - Map>> testCreatorMethodsInPOWithMixinPO() { + Map>> testCreatorMethodsInMixinPO() { return {}; } - dynamic testCreatorInvokeMethodInPOWithMixinPO( + dynamic testCreatorInvokeMethodInMixinPO( String methodName, List positionalArguments, [Map? namedArguments]) { + if (methodName == 'mixinDivText') { + return mixinDivText; + } + if (methodName == 'getterMessage') { + return getterMessage; + } + if (methodName == 'methodMessage') { + return Function.apply(methodMessage, positionalArguments, namedArguments); + } throw 'METHOD NOT FOUND. This method' ' failed to be generated during test creator codegen.'; } - Map)?> findChainInPOWithMixinPO( + Map)?> findChainInMixinPO( List internalIds, [String action = 'default']) { var closestIndex = internalIds.length; String Function(List)? closestValue; + try { + var _mixinDivIndex = internalIds.indexOf(this._mixinDiv.id); + if (_mixinDivIndex >= 0 && _mixinDivIndex < closestIndex) { + closestIndex = _mixinDivIndex; + closestValue = (_) => + '_mixinDiv.${PageObject.defaultCode[action] ?? PageObject.defaultCode['default']}'; + } + } catch (_) { + // Ignored. + } return {closestIndex: closestValue}; } + + PageLoaderElement get _mixinDiv { + for (final __listener in $__root__.listeners) { + __listener.startPageObjectMethod('MixinPO', '_mixinDiv'); + } + final element = $__root__.createElement(ById('mixin-div'), [], []); + final returnMe = element; + for (final __listener in $__root__.listeners) { + __listener.endPageObjectMethod('MixinPO', '_mixinDiv'); + } + return returnMe; + } } diff --git a/test/src_null_safety/cache_invalidation.g.dart b/test/src_null_safety/cache_invalidation.g.dart index 2d8b4dfd..c29647f8 100644 --- a/test/src_null_safety/cache_invalidation.g.dart +++ b/test/src_null_safety/cache_invalidation.g.dart @@ -9,78 +9,6 @@ part of 'cache_invalidation.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CacheInvalidation extends CacheInvalidation with $$CacheInvalidation { - PageLoaderElement $__root__; - $CacheInvalidation.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $CacheInvalidation.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "CacheInvalidation is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCacheInvalidation()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCacheInvalidation()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCacheInvalidation( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCacheInvalidation(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "CacheInvalidation". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'CacheInvalidation\n\n${$__root__.toStringDeep()}'; -} mixin $$CacheInvalidation on CacheInvalidation { late PageLoaderElement $__root__; @@ -166,78 +94,6 @@ mixin $$CacheInvalidation on CacheInvalidation { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $_Nested extends _Nested with $$_Nested { - PageLoaderElement $__root__; - $_Nested.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $_Nested.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "_Nested is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersIn_Nested()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsIn_Nested()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodIn_Nested( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainIn_Nested(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "_Nested". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => '_Nested\n\n${$__root__.toStringDeep()}'; -} mixin $$_Nested on _Nested { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/constructors.g.dart b/test/src_null_safety/constructors.g.dart index ab38289e..4a52dd1a 100644 --- a/test/src_null_safety/constructors.g.dart +++ b/test/src_null_safety/constructors.g.dart @@ -9,78 +9,6 @@ part of 'constructors.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BasePO extends BasePO with $$BasePO { - PageLoaderElement $__root__; - $BasePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BasePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BasePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBasePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBasePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BasePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'BasePO\n\n${$__root__.toStringDeep()}'; -} mixin $$BasePO on BasePO { late PageLoaderElement $__root__; @@ -140,130 +68,6 @@ mixin $$BasePO on BasePO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BCustomTagPO extends BCustomTagPO with $$BCustomTagPO { - PageLoaderElement $__root__; - $BCustomTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag(BCustomTagPO.tagName)]); - } - factory $BCustomTagPO.lookup(PageLoaderSource source) => - $BCustomTagPO.create(source.byTag(BCustomTagPO.tagName)); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBCustomTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBCustomTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBCustomTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBCustomTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = BCustomTagPO.tagName; - PageLoaderElement get rootElement { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'rootElement'); - } - final returnMe = super.rootElement; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'rootElement'); - } - return returnMe; - } - - PageUtils get _utils { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', '_utils'); - } - final returnMe = super._utils; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', '_utils'); - } - return returnMe; - } - - CCustomTagPO get cTagFromPLE { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'cTagFromPLE'); - } - final returnMe = super.cTagFromPLE; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'cTagFromPLE'); - } - return returnMe; - } - - CCustomTagPO get cTagFromUtils { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'cTagFromUtils'); - } - final returnMe = super.cTagFromUtils; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'cTagFromUtils'); - } - return returnMe; - } - - NoLookupPO get noLookupPO { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BCustomTagPO', 'noLookupPO'); - } - final returnMe = super.noLookupPO; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BCustomTagPO', 'noLookupPO'); - } - return returnMe; - } - - String toStringDeep() => 'BCustomTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$BCustomTagPO on BCustomTagPO { late PageLoaderElement $__root__; @@ -382,86 +186,6 @@ mixin $$BCustomTagPO on BCustomTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CCustomTagPO extends CCustomTagPO with $$CCustomTagPO { - PageLoaderElement $__root__; - $CCustomTagPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag(CCustomTagPO.tagName)]); - } - factory $CCustomTagPO.lookup(PageLoaderSource source) => - $CCustomTagPO.create(source.byTag(CCustomTagPO.tagName)); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCCustomTagPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCCustomTagPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCCustomTagPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCCustomTagPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = CCustomTagPO.tagName; - String get innerText { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('CCustomTagPO', 'innerText'); - } - final returnMe = super.innerText; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('CCustomTagPO', 'innerText'); - } - return returnMe; - } - - String toStringDeep() => 'CCustomTagPO\n\n${$__root__.toStringDeep()}'; -} mixin $$CCustomTagPO on CCustomTagPO { late PageLoaderElement $__root__; @@ -520,78 +244,6 @@ mixin $$CCustomTagPO on CCustomTagPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $NoLookupPO extends NoLookupPO with $$NoLookupPO { - PageLoaderElement $__root__; - $NoLookupPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $NoLookupPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "NoLookupPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInNoLookupPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInNoLookupPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInNoLookupPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInNoLookupPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "NoLookupPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'NoLookupPO\n\n${$__root__.toStringDeep()}'; -} mixin $$NoLookupPO on NoLookupPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/custom_events.g.dart b/test/src_null_safety/custom_events.g.dart index 973045fd..c3778704 100644 --- a/test/src_null_safety/custom_events.g.dart +++ b/test/src_null_safety/custom_events.g.dart @@ -9,81 +9,6 @@ part of 'custom_events.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForCustomEventsTest extends PageForCustomEventsTest - with $$PageForCustomEventsTest { - PageLoaderElement $__root__; - $PageForCustomEventsTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForCustomEventsTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForCustomEventsTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForCustomEventsTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForCustomEventsTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForCustomEventsTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForCustomEventsTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForCustomEventsTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForCustomEventsTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForCustomEventsTest on PageForCustomEventsTest { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/findchain.g.dart b/test/src_null_safety/findchain.g.dart index 6aab9cd2..643e4b5d 100644 --- a/test/src_null_safety/findchain.g.dart +++ b/test/src_null_safety/findchain.g.dart @@ -9,91 +9,6 @@ part of 'findchain.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForFindChainTests extends PageForFindChainTests - with $$PageForFindChainTests { - PageLoaderElement $__root__; - $PageForFindChainTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForFindChainTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForFindChainTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForFindChainTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForFindChainTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForFindChainTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForFindChainTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForFindChainTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - OuterPO get firstOuter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageForFindChainTests', 'firstOuter'); - } - final returnMe = super.firstOuter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageForFindChainTests', 'firstOuter'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForFindChainTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForFindChainTests on PageForFindChainTests { late PageLoaderElement $__root__; @@ -292,75 +207,6 @@ mixin $$PageForFindChainTests on PageForFindChainTests { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $CustomPO extends CustomPO with $$CustomPO { - PageLoaderElement $__root__; - $CustomPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('button')]); - } - factory $CustomPO.lookup(PageLoaderSource source) => - $CustomPO.create(source.byTag('button')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInCustomPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInCustomPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInCustomPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInCustomPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'button'; - String toStringDeep() => 'CustomPO\n\n${$__root__.toStringDeep()}'; -} mixin $$CustomPO on CustomPO { late PageLoaderElement $__root__; @@ -392,101 +238,6 @@ mixin $$CustomPO on CustomPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $OuterPO extends OuterPO with $$OuterMixin, $$OuterPO { - PageLoaderElement $__root__; - $OuterPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $OuterPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "OuterPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInOuterMixin()); - getters.addAll(testCreatorGettersInOuterPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInOuterMixin()); - methods.addAll(testCreatorMethodsInOuterPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInOuterPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInOuterMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInOuterPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInOuterMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "OuterPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - PageLoaderElement get firstInner { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('OuterPO', 'firstInner'); - } - final returnMe = super.firstInner; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('OuterPO', 'firstInner'); - } - return returnMe; - } - - String toStringDeep() => 'OuterPO\n\n${$__root__.toStringDeep()}'; -} mixin $$OuterPO on OuterPO { late PageLoaderElement $__root__; @@ -640,78 +391,6 @@ mixin $$OuterMixin on OuterMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $TablePO extends TablePO with $$TablePO { - PageLoaderElement $__root__; - $TablePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $TablePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "TablePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTablePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTablePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTablePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTablePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "TablePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'TablePO\n\n${$__root__.toStringDeep()}'; -} mixin $$TablePO on TablePO { late PageLoaderElement $__root__; @@ -776,77 +455,6 @@ mixin $$TablePO on TablePO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RowPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RowPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {"value": "test", "click": "focus"}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RowPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} mixin $$RowPO on RowPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/generics.g.dart b/test/src_null_safety/generics.g.dart index 8647a71c..aa7a02ee 100644 --- a/test/src_null_safety/generics.g.dart +++ b/test/src_null_safety/generics.g.dart @@ -9,89 +9,6 @@ part of 'generics.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Generics extends Generics with $$Generics { - PageLoaderElement $__root__; - $Generics.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Generics.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Generics is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInGenerics()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInGenerics()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInGenerics( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInGenerics(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Generics". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String typeDefParameter(T thing, MyGenericTypeDef typeDef) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Generics', 'typeDefParameter'); - } - final returnMe = super.typeDefParameter(thing, typeDef); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Generics', 'typeDefParameter'); - } - return returnMe; - } - - String toStringDeep() => 'Generics\n\n${$__root__.toStringDeep()}'; -} mixin $$Generics on Generics { late PageLoaderElement $__root__; @@ -127,78 +44,6 @@ mixin $$Generics on Generics { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RootPo extends RootPo with $$RootPo { - PageLoaderElement $__root__; - $RootPo.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RootPo.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RootPo is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRootPo()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRootPo()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRootPo( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRootPo(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RootPo". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RootPo\n\n${$__root__.toStringDeep()}'; -} mixin $$RootPo on RootPo { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/list.g.dart b/test/src_null_safety/list.g.dart index c57be379..b3622ca6 100644 --- a/test/src_null_safety/list.g.dart +++ b/test/src_null_safety/list.g.dart @@ -9,77 +9,6 @@ part of 'list.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Lists extends Lists with $$Lists { - PageLoaderElement $__root__; - $Lists.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Lists.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Lists is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInLists()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInLists()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInLists( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInLists(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Lists". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Lists\n\n${$__root__.toStringDeep()}'; -} mixin $$Lists on Lists { late PageLoaderElement $__root__; @@ -195,85 +124,6 @@ mixin $$Lists on Lists { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([CheckTag('tr')]); - } - factory $RowPO.lookup(PageLoaderSource source) => - $RowPO.create(source.byTag('tr')); - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static const String tagName = 'tr'; - bool get exists { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('RowPO', 'exists'); - } - final returnMe = super.exists; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('RowPO', 'exists'); - } - return returnMe; - } - - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} mixin $$RowPO on RowPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/long_exception.g.dart b/test/src_null_safety/long_exception.g.dart index ac67abcc..4740b2e8 100644 --- a/test/src_null_safety/long_exception.g.dart +++ b/test/src_null_safety/long_exception.g.dart @@ -9,78 +9,6 @@ part of 'long_exception.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $MyPageObject extends MyPageObject with $$MyPageObject { - PageLoaderElement $__root__; - $MyPageObject.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $MyPageObject.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "MyPageObject is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInMyPageObject()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInMyPageObject()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInMyPageObject( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInMyPageObject(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "MyPageObject". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'MyPageObject\n\n${$__root__.toStringDeep()}'; -} mixin $$MyPageObject on MyPageObject { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/mouse.g.dart b/test/src_null_safety/mouse.g.dart index a9f28b47..7d816fa5 100644 --- a/test/src_null_safety/mouse.g.dart +++ b/test/src_null_safety/mouse.g.dart @@ -9,78 +9,6 @@ part of 'mouse.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForMouseTest extends PageForMouseTest with $$PageForMouseTest { - PageLoaderElement $__root__; - $PageForMouseTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForMouseTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForMouseTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForMouseTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForMouseTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForMouseTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForMouseTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForMouseTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForMouseTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForMouseTest on PageForMouseTest { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/null_element.g.dart b/test/src_null_safety/null_element.g.dart index d6f2050c..7cea4d8a 100644 --- a/test/src_null_safety/null_element.g.dart +++ b/test/src_null_safety/null_element.g.dart @@ -9,100 +9,6 @@ part of 'null_element.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $BasePO extends BasePO with $$BasePO { - PageLoaderElement $__root__; - $BasePO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $BasePO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "BasePO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInBasePO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInBasePO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInBasePO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInBasePO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "BasePO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - List get allRows { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BasePO', 'allRows'); - } - final returnMe = super.allRows; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BasePO', 'allRows'); - } - return returnMe; - } - - List get allRowPOs { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('BasePO', 'allRowPOs'); - } - final returnMe = super.allRowPOs; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('BasePO', 'allRowPOs'); - } - return returnMe; - } - - String toStringDeep() => 'BasePO\n\n${$__root__.toStringDeep()}'; -} mixin $$BasePO on BasePO { late PageLoaderElement $__root__; @@ -356,78 +262,6 @@ mixin $$BasePO on BasePO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ButtonPO extends ButtonPO with $$ButtonPO { - PageLoaderElement $__root__; - $ButtonPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ButtonPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ButtonPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInButtonPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInButtonPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInButtonPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInButtonPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ButtonPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'ButtonPO\n\n${$__root__.toStringDeep()}'; -} mixin $$ButtonPO on ButtonPO { late PageLoaderElement $__root__; @@ -459,77 +293,6 @@ mixin $$ButtonPO on ButtonPO { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $RowPO extends RowPO with $$RowPO { - PageLoaderElement $__root__; - $RowPO.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $RowPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "RowPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRowPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRowPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRowPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRowPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "RowPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'RowPO\n\n${$__root__.toStringDeep()}'; -} mixin $$RowPO on RowPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/page_utils.g.dart b/test/src_null_safety/page_utils.g.dart index c1e44d70..ac64862b 100644 --- a/test/src_null_safety/page_utils.g.dart +++ b/test/src_null_safety/page_utils.g.dart @@ -9,80 +9,6 @@ part of 'page_utils.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPageUtilsTests extends PageForPageUtilsTests - with $$PageForPageUtilsTests { - PageLoaderElement $__root__; - $PageForPageUtilsTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPageUtilsTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPageUtilsTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPageUtilsTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPageUtilsTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPageUtilsTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForPageUtilsTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPageUtilsTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForPageUtilsTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPageUtilsTests on PageForPageUtilsTests { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/pointer.g.dart b/test/src_null_safety/pointer.g.dart index 83d053e8..169cd9e0 100644 --- a/test/src_null_safety/pointer.g.dart +++ b/test/src_null_safety/pointer.g.dart @@ -9,78 +9,6 @@ part of 'pointer.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPointerTest extends PageForPointerTest with $$PageForPointerTest { - PageLoaderElement $__root__; - $PageForPointerTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPointerTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPointerTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPointerTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPointerTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPointerTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForPointerTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPointerTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForPointerTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPointerTest on PageForPointerTest { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/properties.g.dart b/test/src_null_safety/properties.g.dart index 63f2b868..305a3205 100644 --- a/test/src_null_safety/properties.g.dart +++ b/test/src_null_safety/properties.g.dart @@ -9,81 +9,6 @@ part of 'properties.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForPropertiesTests extends PageForPropertiesTests - with $$PageForPropertiesTests { - PageLoaderElement $__root__; - $PageForPropertiesTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForPropertiesTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForPropertiesTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForPropertiesTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForPropertiesTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForPropertiesTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForPropertiesTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForPropertiesTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForPropertiesTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForPropertiesTests on PageForPropertiesTests { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/scroll.g.dart b/test/src_null_safety/scroll.g.dart index 40478434..b6e51aec 100644 --- a/test/src_null_safety/scroll.g.dart +++ b/test/src_null_safety/scroll.g.dart @@ -9,111 +9,6 @@ part of 'scroll.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $ScrollPO extends ScrollPO with $$ScrollPO { - PageLoaderElement $__root__; - $ScrollPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $ScrollPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "ScrollPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInScrollPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInScrollPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInScrollPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInScrollPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "ScrollPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - int get scrollLeft { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scrollLeft'); - } - final returnMe = super.scrollLeft; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scrollLeft'); - } - return returnMe; - } - - int get scrollTop { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scrollTop'); - } - final returnMe = super.scrollTop; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scrollTop'); - } - return returnMe; - } - - Future scroll({int? x, int? y}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('ScrollPO', 'scroll'); - } - final returnMe = super.scroll(x: x, y: y); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('ScrollPO', 'scroll'); - } - return returnMe; - } - - String toStringDeep() => 'ScrollPO\n\n${$__root__.toStringDeep()}'; -} mixin $$ScrollPO on ScrollPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/shared_list_page_objects.g.dart b/test/src_null_safety/shared_list_page_objects.g.dart index e5b5dfb2..4c218c32 100644 --- a/test/src_null_safety/shared_list_page_objects.g.dart +++ b/test/src_null_safety/shared_list_page_objects.g.dart @@ -9,78 +9,6 @@ part of 'shared_list_page_objects.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForSimpleTest extends PageForSimpleTest with $$PageForSimpleTest { - PageLoaderElement $__root__; - $PageForSimpleTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForSimpleTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForSimpleTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForSimpleTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForSimpleTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForSimpleTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForSimpleTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForSimpleTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForSimpleTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForSimpleTest on PageForSimpleTest { late PageLoaderElement $__root__; @@ -164,77 +92,6 @@ mixin $$PageForSimpleTest on PageForSimpleTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Table extends Table with $$Table { - PageLoaderElement $__root__; - $Table.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Table.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Table is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTable()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTable()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTable( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTable(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Table". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Table\n\n${$__root__.toStringDeep()}'; -} mixin $$Table on Table { late PageLoaderElement $__root__; @@ -341,77 +198,6 @@ mixin $$Table on Table { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Row extends Row with $$Row { - PageLoaderElement $__root__; - $Row.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Row.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Row is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRow()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRow()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRow( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRow(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Row". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Row\n\n${$__root__.toStringDeep()}'; -} mixin $$Row on Row { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/shared_page_objects.g.dart b/test/src_null_safety/shared_page_objects.g.dart index 3c7195a8..8d2d1b94 100644 --- a/test/src_null_safety/shared_page_objects.g.dart +++ b/test/src_null_safety/shared_page_objects.g.dart @@ -9,78 +9,6 @@ part of 'shared_page_objects.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForSimpleTest extends PageForSimpleTest with $$PageForSimpleTest { - PageLoaderElement $__root__; - $PageForSimpleTest.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForSimpleTest.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForSimpleTest is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForSimpleTest()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForSimpleTest()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForSimpleTest( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForSimpleTest(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForSimpleTest". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForSimpleTest\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForSimpleTest on PageForSimpleTest { late PageLoaderElement $__root__; @@ -139,88 +67,6 @@ mixin $$PageForSimpleTest on PageForSimpleTest { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Table extends Table with $$Table { - PageLoaderElement $__root__; - $Table.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Table.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Table is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInTable()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInTable()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInTable( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInTable(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Table". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future doSlowAction() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('Table', 'doSlowAction'); - } - final returnMe = super.doSlowAction(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('Table', 'doSlowAction'); - } - return returnMe; - } - - String toStringDeep() => 'Table\n\n${$__root__.toStringDeep()}'; -} mixin $$Table on Table { late PageLoaderElement $__root__; @@ -298,77 +144,6 @@ mixin $$Table on Table { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $Row extends Row with $$Row { - PageLoaderElement $__root__; - $Row.create(PageLoaderElement currentContext) : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $Row.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "Row is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInRow()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInRow()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInRow( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInRow(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "Row". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'Row\n\n${$__root__.toStringDeep()}'; -} mixin $$Row on Row { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/test_creator_getters.g.dart b/test/src_null_safety/test_creator_getters.g.dart index 6af1b711..af5711cf 100644 --- a/test/src_null_safety/test_creator_getters.g.dart +++ b/test/src_null_safety/test_creator_getters.g.dart @@ -9,119 +9,6 @@ part of 'test_creator_getters.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndActions extends PageObjectHasGettersAndActions - with $$PageObjectHasGettersAndActions { - PageLoaderElement $__root__; - $PageObjectHasGettersAndActions.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndActions.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndActions is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasGettersAndActions()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasGettersAndActions()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndActions( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectHasGettersAndActions(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndActions". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndActions', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasGettersAndActions', 'name'); - } - return returnMe; - } - - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndActions', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasGettersAndActions', 'clear'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndActions\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndActions on PageObjectHasGettersAndActions { late PageLoaderElement $__root__; @@ -196,127 +83,6 @@ mixin $$PageObjectHasGettersAndActions on PageObjectHasGettersAndActions { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersThatUseDifferentReturnTypes - extends PageObjectHasGettersThatUseDifferentReturnTypes - with $$PageObjectHasGettersThatUseDifferentReturnTypes { - PageLoaderElement $__root__; - $PageObjectHasGettersThatUseDifferentReturnTypes.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersThatUseDifferentReturnTypes.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersThatUseDifferentReturnTypes is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll( - testCreatorGettersInPageObjectHasGettersThatUseDifferentReturnTypes()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll( - testCreatorMethodsInPageObjectHasGettersThatUseDifferentReturnTypes()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersThatUseDifferentReturnTypes( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectHasGettersThatUseDifferentReturnTypes( - internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersThatUseDifferentReturnTypes". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'testContext'); - } - return returnMe; - } - - bool get exists { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'exists'); - } - final returnMe = super.exists; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'exists'); - } - return returnMe; - } - - int get size { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'size'); - } - final returnMe = super.size; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersThatUseDifferentReturnTypes', 'size'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersThatUseDifferentReturnTypes\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersThatUseDifferentReturnTypes on PageObjectHasGettersThatUseDifferentReturnTypes { @@ -426,92 +192,6 @@ mixin $$PageObjectHasGettersThatUseDifferentReturnTypes // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasNoGetters extends PageObjectHasNoGetters - with $$PageObjectHasNoGetters { - PageLoaderElement $__root__; - $PageObjectHasNoGetters.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasNoGetters.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasNoGetters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasNoGetters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasNoGetters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasNoGetters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageObjectHasNoGetters(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasNoGetters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectHasNoGetters', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectHasNoGetters', 'clear'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasNoGetters\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasNoGetters on PageObjectHasNoGetters { late PageLoaderElement $__root__; @@ -576,113 +256,6 @@ mixin $$PageObjectHasNoGetters on PageObjectHasNoGetters { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithMixin extends PageObjectWithMixin - with $$PageObjectMixin, $$PageObjectWithMixin { - PageLoaderElement $__root__; - $PageObjectWithMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectWithMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'name'); - } - return returnMe; - } - - String toStringDeep() => 'PageObjectWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithMixin on PageObjectWithMixin { late PageLoaderElement $__root__; @@ -815,107 +388,6 @@ mixin $$PageObjectMixin on PageObjectMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithOverridingMixins extends PageObjectWithOverridingMixins - with $$PageObjectMixin, $$PageObjectWithOverridingMixins { - PageLoaderElement $__root__; - $PageObjectWithOverridingMixins.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithOverridingMixins.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithOverridingMixins is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithOverridingMixins()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithOverridingMixins()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithOverridingMixins( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectWithOverridingMixins(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithOverridingMixins". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get tabContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'tabContext'); - } - final returnMe = super.tabContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectWithOverridingMixins', 'tabContext'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectWithOverridingMixins\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithOverridingMixins on PageObjectWithOverridingMixins { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/test_creator_invoke_method.g.dart b/test/src_null_safety/test_creator_invoke_method.g.dart index 9676cec1..cc4322cd 100644 --- a/test/src_null_safety/test_creator_invoke_method.g.dart +++ b/test/src_null_safety/test_creator_invoke_method.g.dart @@ -9,121 +9,6 @@ part of 'test_creator_invoke_method.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndMethods extends PageObjectHasGettersAndMethods - with $$PageObjectHasGettersAndMethods { - PageLoaderElement $__root__; - $PageObjectHasGettersAndMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasGettersAndMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasGettersAndMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectHasGettersAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get getter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'getter'); - } - final returnMe = super.getter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'getter'); - } - return returnMe; - } - - void emptyFn() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'emptyFn'); - } - super.emptyFn(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'emptyFn'); - } - return; - } - - Future complexFn(String str, int number, double float, bool boolean) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'complexFn'); - } - final returnMe = super.complexFn(str, number, float, boolean); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethods', 'complexFn'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndMethods on PageObjectHasGettersAndMethods { late PageLoaderElement $__root__; @@ -232,157 +117,6 @@ mixin $$PageObjectHasGettersAndMethods on PageObjectHasGettersAndMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasGettersAndMethodsWithMixin - extends PageObjectHasGettersAndMethodsWithMixin - with - $$PageObjectMixinHasGettersAndMethods, - $$RightMostPageObjectMixin, - $$PageObjectHasGettersAndMethodsWithMixin { - PageLoaderElement $__root__; - $PageObjectHasGettersAndMethodsWithMixin.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasGettersAndMethodsWithMixin.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasGettersAndMethodsWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixinHasGettersAndMethods()); - getters.addAll(testCreatorGettersInRightMostPageObjectMixin()); - getters - .addAll(testCreatorGettersInPageObjectHasGettersAndMethodsWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixinHasGettersAndMethods()); - methods.addAll(testCreatorMethodsInRightMostPageObjectMixin()); - methods - .addAll(testCreatorMethodsInPageObjectHasGettersAndMethodsWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasGettersAndMethodsWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInRightMostPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixinHasGettersAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageObjectHasGettersAndMethodsWithMixin(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = - findChainInRightMostPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixinHasGettersAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasGettersAndMethodsWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get getter { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'getter'); - } - final returnMe = super.getter; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'getter'); - } - return returnMe; - } - - void emptyFn() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'emptyFn'); - } - super.emptyFn(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'emptyFn'); - } - return; - } - - Future complexFn(String str, int number, double float, bool boolean) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'complexFn'); - } - final returnMe = super.complexFn(str, number, float, boolean); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasGettersAndMethodsWithMixin', 'complexFn'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasGettersAndMethodsWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasGettersAndMethodsWithMixin on PageObjectHasGettersAndMethodsWithMixin { diff --git a/test/src_null_safety/test_creator_methods.g.dart b/test/src_null_safety/test_creator_methods.g.dart index 2ea9914f..5c7d520c 100644 --- a/test/src_null_safety/test_creator_methods.g.dart +++ b/test/src_null_safety/test_creator_methods.g.dart @@ -9,148 +9,6 @@ part of 'test_creator_methods.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasPropertiesAndMethods - extends PageObjectHasPropertiesAndMethods - with $$PageObjectHasPropertiesAndMethods { - PageLoaderElement $__root__; - $PageObjectHasPropertiesAndMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasPropertiesAndMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasPropertiesAndMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasPropertiesAndMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasPropertiesAndMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasPropertiesAndMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectHasPropertiesAndMethods(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasPropertiesAndMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String get testContext { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'testContext'); - } - final returnMe = super.testContext; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'testContext'); - } - return returnMe; - } - - String get name { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'name'); - } - final returnMe = super.name; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'name'); - } - return returnMe; - } - - Future clear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'clear'); - } - final returnMe = super.clear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'clear'); - } - return returnMe; - } - - Future getLength() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'getLength'); - } - final returnMe = super.getLength(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'getLength'); - } - return returnMe; - } - - void badClear(String text) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'badClear'); - } - super.badClear(text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasPropertiesAndMethods', 'badClear'); - } - return; - } - - String toStringDeep() => - 'PageObjectHasPropertiesAndMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasPropertiesAndMethods on PageObjectHasPropertiesAndMethods { late PageLoaderElement $__root__; @@ -233,166 +91,6 @@ mixin $$PageObjectHasPropertiesAndMethods on PageObjectHasPropertiesAndMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasMethodsWithDifferentParameters - extends PageObjectHasMethodsWithDifferentParameters - with $$PageObjectHasMethodsWithDifferentParameters { - PageLoaderElement $__root__; - $PageObjectHasMethodsWithDifferentParameters.create( - PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasMethodsWithDifferentParameters.lookup( - PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasMethodsWithDifferentParameters is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll( - testCreatorGettersInPageObjectHasMethodsWithDifferentParameters()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll( - testCreatorMethodsInPageObjectHasMethodsWithDifferentParameters()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasMethodsWithDifferentParameters( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectHasMethodsWithDifferentParameters( - internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasMethodsWithDifferentParameters". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future click() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'click'); - } - final returnMe = super.click(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'click'); - } - return returnMe; - } - - Future type(int index, {String? text}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'type'); - } - final returnMe = super.type(index, text: text); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'type'); - } - return returnMe; - } - - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'cut'); - } - return returnMe; - } - - Future defaultString([String end = '23']) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultString'); - } - final returnMe = super.defaultString(end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultString'); - } - return returnMe; - } - - Future defaultBool({bool end = true}) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultBool'); - } - final returnMe = super.defaultBool(end: end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'defaultBool'); - } - return returnMe; - } - - Future varm(var x) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'varm'); - } - final returnMe = super.varm(x); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageObjectHasMethodsWithDifferentParameters', 'varm'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectHasMethodsWithDifferentParameters\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasMethodsWithDifferentParameters on PageObjectHasMethodsWithDifferentParameters { @@ -470,81 +168,6 @@ mixin $$PageObjectHasMethodsWithDifferentParameters // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectHasNoMethods extends PageObjectHasNoMethods - with $$PageObjectHasNoMethods { - PageLoaderElement $__root__; - $PageObjectHasNoMethods.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectHasNoMethods.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectHasNoMethods is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectHasNoMethods()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectHasNoMethods()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectHasNoMethods( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageObjectHasNoMethods(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectHasNoMethods". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageObjectHasNoMethods\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectHasNoMethods on PageObjectHasNoMethods { late PageLoaderElement $__root__; @@ -602,102 +225,6 @@ mixin $$PageObjectHasNoMethods on PageObjectHasNoMethods { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithMixin extends PageObjectWithMixin - with $$PageObjectMixin, $$PageObjectWithMixin { - PageLoaderElement $__root__; - $PageObjectWithMixin.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithMixin.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithMixin is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithMixin()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithMixin()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectWithMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithMixin". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithMixin', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithMixin', 'cut'); - } - return returnMe; - } - - String toStringDeep() => 'PageObjectWithMixin\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithMixin on PageObjectWithMixin { late PageLoaderElement $__root__; @@ -825,129 +352,6 @@ mixin $$PageObjectMixin on PageObjectMixin { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageObjectWithOverridingMixins extends PageObjectWithOverridingMixins - with $$PageObjectMixin, $$PageObjectWithOverridingMixins { - PageLoaderElement $__root__; - $PageObjectWithOverridingMixins.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageObjectWithOverridingMixins.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageObjectWithOverridingMixins is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageObjectMixin()); - getters.addAll(testCreatorGettersInPageObjectWithOverridingMixins()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageObjectMixin()); - methods.addAll(testCreatorMethodsInPageObjectWithOverridingMixins()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageObjectWithOverridingMixins( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - try { - return testCreatorInvokeMethodInPageObjectMixin( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageObjectWithOverridingMixins(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - chain = findChainInPageObjectMixin(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageObjectWithOverridingMixins". Requires @CheckTag annotation in order for "tagName" to be generated.'; - Future cut(int start, [int end = 12]) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod('PageObjectWithOverridingMixins', 'cut'); - } - final returnMe = super.cut(start, end); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'cut'); - } - return returnMe; - } - - Future click() { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'click'); - } - final returnMe = super.click(); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'click'); - } - return returnMe; - } - - Future varm(var x) { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageObjectWithOverridingMixins', 'varm'); - } - final returnMe = super.varm(x); - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod('PageObjectWithOverridingMixins', 'varm'); - } - return returnMe; - } - - String toStringDeep() => - 'PageObjectWithOverridingMixins\n\n${$__root__.toStringDeep()}'; -} mixin $$PageObjectWithOverridingMixins on PageObjectWithOverridingMixins { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/typing.g.dart b/test/src_null_safety/typing.g.dart index bf845795..5c9cfa4b 100644 --- a/test/src_null_safety/typing.g.dart +++ b/test/src_null_safety/typing.g.dart @@ -9,81 +9,6 @@ part of 'typing.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTextAreaTypingText extends PageForTextAreaTypingText - with $$PageForTextAreaTypingText { - PageLoaderElement $__root__; - $PageForTextAreaTypingText.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTextAreaTypingText.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTextAreaTypingText is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTextAreaTypingText()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTextAreaTypingText()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTextAreaTypingText( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = - findChainInPageForTextAreaTypingText(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTextAreaTypingText". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => - 'PageForTextAreaTypingText\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTextAreaTypingText on PageForTextAreaTypingText { late PageLoaderElement $__root__; @@ -141,78 +66,6 @@ mixin $$PageForTextAreaTypingText on PageForTextAreaTypingText { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTypingTests extends PageForTypingTests with $$PageForTypingTests { - PageLoaderElement $__root__; - $PageForTypingTests.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTypingTests.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTypingTests is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTypingTests()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTypingTests()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTypingTests( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForTypingTests(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTypingTests". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'PageForTypingTests\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTypingTests on PageForTypingTests { late PageLoaderElement $__root__; @@ -270,109 +123,6 @@ mixin $$PageForTypingTests on PageForTypingTests { // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $PageForTypingTestsWithFocusAndBlur - extends PageForTypingTestsWithFocusAndBlur - with $$PageForTypingTestsWithFocusAndBlur { - PageLoaderElement $__root__; - $PageForTypingTestsWithFocusAndBlur.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $PageForTypingTestsWithFocusAndBlur.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "PageForTypingTestsWithFocusAndBlur is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInPageForTypingTestsWithFocusAndBlur()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInPageForTypingTestsWithFocusAndBlur()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInPageForTypingTestsWithFocusAndBlur( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInPageForTypingTestsWithFocusAndBlur(internalIds, action) - .entries - .first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "PageForTypingTestsWithFocusAndBlur". Requires @CheckTag annotation in order for "tagName" to be generated.'; - int get focusCount { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'focusCount'); - } - final returnMe = super.focusCount; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'focusCount'); - } - return returnMe; - } - - int get blurCount { - for (final __listener in $__root__.listeners) { - __listener.startPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'blurCount'); - } - final returnMe = super.blurCount; - for (final __listener in $__root__.listeners) { - __listener.endPageObjectMethod( - 'PageForTypingTestsWithFocusAndBlur', 'blurCount'); - } - return returnMe; - } - - String toStringDeep() => - 'PageForTypingTestsWithFocusAndBlur\n\n${$__root__.toStringDeep()}'; -} mixin $$PageForTypingTestsWithFocusAndBlur on PageForTypingTestsWithFocusAndBlur { @@ -493,78 +243,6 @@ mixin $$PageForTypingTestsWithFocusAndBlur // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $KeyboardListenerPO extends KeyboardListenerPO with $$KeyboardListenerPO { - PageLoaderElement $__root__; - $KeyboardListenerPO.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $KeyboardListenerPO.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "KeyboardListenerPO is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInKeyboardListenerPO()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInKeyboardListenerPO()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInKeyboardListenerPO( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInKeyboardListenerPO(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "KeyboardListenerPO". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'KeyboardListenerPO\n\n${$__root__.toStringDeep()}'; -} mixin $$KeyboardListenerPO on KeyboardListenerPO { late PageLoaderElement $__root__; diff --git a/test/src_null_safety/webdriver_only.g.dart b/test/src_null_safety/webdriver_only.g.dart index 9bb2970d..2f8c69fc 100644 --- a/test/src_null_safety/webdriver_only.g.dart +++ b/test/src_null_safety/webdriver_only.g.dart @@ -9,78 +9,6 @@ part of 'webdriver_only.dart'; // ignore_for_file: unused_field, non_constant_identifier_names // ignore_for_file: overridden_fields, annotate_overrides // ignore_for_file: prefer_final_locals, deprecated_member_use_from_same_package -class $WebDriverOnly extends WebDriverOnly with $$WebDriverOnly { - PageLoaderElement $__root__; - $WebDriverOnly.create(PageLoaderElement currentContext) - : $__root__ = currentContext { - $__root__.addCheckers([]); - } - factory $WebDriverOnly.lookup(PageLoaderSource source) => - throw "'lookup' constructor for class " - "WebDriverOnly is not generated and can only be used on Page Object " - "classes that have @CheckTag annotation."; - String testCreatorGetters() { - final getters = {}; - getters.addAll(testCreatorGettersInWebDriverOnly()); - return json.encode(getters); - } - - String testCreatorMethods() { - final methods = >>{}; - methods.addAll(testCreatorMethodsInWebDriverOnly()); - return json.encode(methods); - } - - dynamic testCreatorInvokeMethod( - String methodName, List positionalArguments, - [Map? namedArguments]) { - try { - return testCreatorInvokeMethodInWebDriverOnly( - methodName, positionalArguments, namedArguments); - } catch (_) {} - - throw 'METHOD NOT FOUND. This method' - ' failed to be generated during test creator codegen.'; - } - - String? findChain(List rawInternalIds, [String action = 'default']) { - final internalIds = rawInternalIds.cast(); - final code = {}; - - final actionCode = code[action]; - if (actionCode != null) { - return actionCode; - } - - final thisElementIndex = internalIds.indexOf($__root__.id); - final rootNotFound = thisElementIndex < 0; - - if (thisElementIndex >= 0) { - internalIds.removeRange(thisElementIndex, internalIds.length); - } - - var closestIndex = internalIds.length; - String Function(List)? closestValue; - MapEntry)?> chain; - chain = findChainInWebDriverOnly(internalIds, action).entries.first; - if (chain.key < closestIndex) { - closestIndex = chain.key; - closestValue = chain.value; - } - if (closestIndex < internalIds.length) { - final value = closestValue!(internalIds); - return code[value] ?? value; - } - - return rootNotFound - ? null - : PageObject.defaultCode[action] ?? PageObject.defaultCode['default']; - } - - static String get tagName => - throw '"tagName" is not defined by Page Object "WebDriverOnly". Requires @CheckTag annotation in order for "tagName" to be generated.'; - String toStringDeep() => 'WebDriverOnly\n\n${$__root__.toStringDeep()}'; -} mixin $$WebDriverOnly on WebDriverOnly { late PageLoaderElement $__root__;