@testspectra/matchers 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -867,6 +867,46 @@ export interface SingleElementProxy extends ElementReceiverAssertions<Promise<vo
867
867
  * @returns Promise resolving to the closest matching ancestor, or null if none found.
868
868
  */
869
869
  closest(selector: string): Promise<SingleElementProxy | null>;
870
+ /**
871
+ * Returns the direct children of this element as a collection, optionally filtered by selector.
872
+ *
873
+ * Cross-platform: uses the DOM `children` on web and the accessibility-tree child links on
874
+ * Android, so the same chained call works on both targets (the filter selector is expressed in
875
+ * each platform's own language — CSS on web, `~id`/class on Android).
876
+ *
877
+ * @param selector Optional selector each child must match to be included.
878
+ * @returns A collection proxy over the matching children.
879
+ *
880
+ * @example
881
+ * ```ts
882
+ * await Spectra.get('ul').children('li').shouldHaveLength(3);
883
+ * ```
884
+ */
885
+ children(selector?: string): CollectionProxy;
886
+ /**
887
+ * Returns the siblings of this element (same parent, excluding the element itself) as a
888
+ * collection, optionally filtered by selector.
889
+ *
890
+ * Cross-platform: parent's children on web, accessibility-tree siblings on Android.
891
+ *
892
+ * @param selector Optional selector each sibling must match to be included.
893
+ * @returns A collection proxy over the matching siblings.
894
+ *
895
+ * @example
896
+ * ```ts
897
+ * await Spectra.get('label').siblings('[data-ui-section~="field.error"]').first().shouldBeVisible();
898
+ * ```
899
+ */
900
+ siblings(selector?: string): CollectionProxy;
901
+ /**
902
+ * Returns the element's next sibling — or the first following sibling matching `selector` when
903
+ * a selector is supplied. Cross-platform: `nextElementSibling` on web, tree sibling order on
904
+ * Android.
905
+ *
906
+ * @param selector Optional selector the following sibling must match.
907
+ * @returns A proxy for the resolved sibling (fails on use when none exists).
908
+ */
909
+ next(selector?: string): SingleElementProxy;
870
910
  /**
871
911
  * Returns the inner text content of the element.
872
912
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/matchers",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Canonical TypeScript contracts and ambient type definitions for TestSpectra",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/types.ts CHANGED
@@ -1057,6 +1057,49 @@ export interface SingleElementProxy extends ElementReceiverAssertions<Promise<vo
1057
1057
  */
1058
1058
  closest(selector: string): Promise<SingleElementProxy | null>;
1059
1059
 
1060
+ /**
1061
+ * Returns the direct children of this element as a collection, optionally filtered by selector.
1062
+ *
1063
+ * Cross-platform: uses the DOM `children` on web and the accessibility-tree child links on
1064
+ * Android, so the same chained call works on both targets (the filter selector is expressed in
1065
+ * each platform's own language — CSS on web, `~id`/class on Android).
1066
+ *
1067
+ * @param selector Optional selector each child must match to be included.
1068
+ * @returns A collection proxy over the matching children.
1069
+ *
1070
+ * @example
1071
+ * ```ts
1072
+ * await Spectra.get('ul').children('li').shouldHaveLength(3);
1073
+ * ```
1074
+ */
1075
+ children(selector?: string): CollectionProxy;
1076
+
1077
+ /**
1078
+ * Returns the siblings of this element (same parent, excluding the element itself) as a
1079
+ * collection, optionally filtered by selector.
1080
+ *
1081
+ * Cross-platform: parent's children on web, accessibility-tree siblings on Android.
1082
+ *
1083
+ * @param selector Optional selector each sibling must match to be included.
1084
+ * @returns A collection proxy over the matching siblings.
1085
+ *
1086
+ * @example
1087
+ * ```ts
1088
+ * await Spectra.get('label').siblings('[data-ui-section~="field.error"]').first().shouldBeVisible();
1089
+ * ```
1090
+ */
1091
+ siblings(selector?: string): CollectionProxy;
1092
+
1093
+ /**
1094
+ * Returns the element's next sibling — or the first following sibling matching `selector` when
1095
+ * a selector is supplied. Cross-platform: `nextElementSibling` on web, tree sibling order on
1096
+ * Android.
1097
+ *
1098
+ * @param selector Optional selector the following sibling must match.
1099
+ * @returns A proxy for the resolved sibling (fails on use when none exists).
1100
+ */
1101
+ next(selector?: string): SingleElementProxy;
1102
+
1060
1103
  /**
1061
1104
  * Returns the inner text content of the element.
1062
1105
  *
Binary file
Binary file