1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-06-27 00:41:09 +02:00

Updated pagination iterator (#338)

* Updated pagination iterator

* Added e2e test

* Fixed e2e tests
This commit is contained in:
Tim Voronov
2019-07-23 12:44:30 -04:00
committed by GitHub
parent 22382a0f61
commit 14c487ca46
7 changed files with 102 additions and 27 deletions

View File

@ -92,16 +92,16 @@ func (i *PagingIterator) Next(ctx context.Context) (core.Value, core.Value, erro
return values.ZeroInt, values.ZeroInt, nil
}
clicked, err := i.document.ClickBySelector(ctx, i.selector)
if !i.document.ExistsBySelector(ctx, i.selector) {
return values.ZeroInt, values.ZeroInt, core.ErrNoMoreData
}
_, err := i.document.ClickBySelector(ctx, i.selector)
if err != nil {
return values.None, values.None, err
}
if clicked {
return i.pos, i.pos, nil
}
// terminate
return values.None, values.None, nil
return i.pos, i.pos, nil
}