Skip to content

Commit 8248f4b

Browse files
committed
improvement
1 parent 9cfab4f commit 8248f4b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@
150150
<dependency>
151151
<groupId>io.cucumber</groupId>
152152
<artifactId>cucumber-java</artifactId>
153-
<version>7.16.1</version>
153+
<version>7.18.1</version>
154154
<scope>test</scope>
155155
</dependency>
156156
<dependency>
157157
<groupId>io.cucumber</groupId>
158158
<artifactId>cucumber-spring</artifactId>
159-
<version>7.16.1</version>
159+
<version>7.18.1</version>
160160
<scope>test</scope>
161161
</dependency>
162162
<dependency>
163163
<groupId>io.cucumber</groupId>
164164
<artifactId>cucumber-junit</artifactId>
165-
<version>7.16.1</version>
165+
<version>7.18.1</version>
166166
<scope>test</scope>
167167
</dependency>
168168
<dependency>

src/main/java/com/sdl/selenium/extjs6/grid/Grid.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ public <V> List<List<String>> getLists(int rows, Options<V> options, List<Intege
353353
do {
354354
for (int i = 1; i <= rows; ++i) {
355355
if (canRead) {
356-
List<String> list = options.getCollector() == null ? collector(options, columnsList, this, i) : options.getCollector().apply(new Details<>(options, columnsList, this, i));
357-
listOfList.add(list);
356+
List<List<String>> lists = options.getCollector() == null ? collector(options, columnsList, this, i) : options.getCollector().apply(new Details<>(options, columnsList, this, i));
357+
listOfList.addAll(lists);
358358
} else {
359359
if (size == i + 1) {
360360
break;
@@ -389,13 +389,15 @@ public <V> List<List<String>> getLists(int rows, Options<V> options, List<Intege
389389
return listOfList;
390390
}
391391

392-
private <V> List<String> collector(Options<V> options, List<Integer> columnsList, Grid grid, int i) {
392+
private <V> List<List<String>> collector(Options<V> options, List<Integer> columnsList, Grid grid, int i) {
393393
Row row = new Row(grid).setTag("tr").setResultIdx(i);
394394
if (options.isExpand()) {
395395
row.setTemplate("visibility", "count(ancestor-or-self::*[contains(@class, 'x-grid-rowbody-tr')]) = 0").setVisibility(true);
396396
}
397+
List<List<String>> listOfList = new ArrayList<>();
397398
List<String> list = row.getValues(options, columnsList);
398-
return list;
399+
listOfList.add(list);
400+
return listOfList;
399401
}
400402

401403
@Override

src/main/java/com/sdl/selenium/extjs6/grid/Options.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Options<V> {
1616
private boolean expand;
1717
private Predicate<Integer> predicate;
1818
private Function<Cell, String> function;
19-
private Function<Details<V>, List<String>> collector;
19+
private Function<Details<V>, List<List<String>>> collector;
2020

2121
public Options(V type) {
2222
this.type = type;
@@ -33,12 +33,12 @@ public Options(V type, boolean expand, Predicate<Integer> predicate, Function<Ce
3333
this.expand = expand;
3434
}
3535

36-
public Options(V type, boolean expand, Predicate<Integer> predicate, Function<Cell, String> function, Function<Details<V>, List<String>> collector) {
36+
public Options(V type, boolean expand, Predicate<Integer> predicate, Function<Cell, String> function, Function<Details<V>, List<List<String>>> collector) {
3737
this(type, expand, predicate, function);
3838
this.collector = collector;
3939
}
4040

41-
public Options(V type, Function<Details<V>, List<String>> collector) {
41+
public Options(V type, Function<Details<V>, List<List<String>>> collector) {
4242
this(type);
4343
this.collector = collector;
4444
}

0 commit comments

Comments
 (0)