Skip to content

#672 fix lazy evaluation of page objects fields...#674

Merged
vinogradoff merged 3 commits into
masterfrom
fix-lazy-evaluzation-of-collection-get
Jan 18, 2018
Merged

#672 fix lazy evaluation of page objects fields...#674
vinogradoff merged 3 commits into
masterfrom
fix-lazy-evaluzation-of-collection-get

Conversation

@asolntsev
Copy link
Copy Markdown
Member

… declared as $$().get(index)

to achieve that, I added method WebElementsCollection.getElements()
and made some of WebElementsCollection implementations cache the result of getActualElements().

it allowed me to remove field actualElements from ElementsCollection, CollectionElement, SelenideElementIterator.
Thus method ElementsCollection.get(index) doesn't need to load the collection immediately, but just returns a "proxy" - CollectionElement.

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Checklist

  • Checkstyle and unit tests pass locally with my changes by running gradle check chrome htmlunit command
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

…(index)`

to achieve that, I added method `WebElementsCollection.getElements()`
and made some of `WebElementsCollection` implementations cache the result of `getActualElements()`.

it allowed me to remove field `actualElements` from `ElementsCollection`, `CollectionElement`, `SelenideElementIterator`.
Thus method `ElementsCollection.get(index)` doesn't need to load the collection immediately, but just returns a "proxy" - `CollectionElement`.
@BorisOsipov
Copy link
Copy Markdown
Collaborator

BorisOsipov commented Jan 17, 2018

Restart travise due error

@BorisOsipov BorisOsipov reopened this Jan 17, 2018
@BorisOsipov
Copy link
Copy Markdown
Collaborator

Some technical issues on travise today https://www.traviscistatus.com/

@vinogradoff
Copy link
Copy Markdown
Member

LazyEvaluationTest added, which still fails.

Hope it helps in fixing...

@BorisOsipov
Copy link
Copy Markdown
Collaborator

BorisOsipov commented Jan 17, 2018

LazyEvaluationTest added, which still fails.

Btw does test pass on 4.9?
@vinogradoff

@vinogradoff vinogradoff merged commit b4db1f5 into master Jan 18, 2018
@asolntsev asolntsev deleted the fix-lazy-evaluzation-of-collection-get branch January 18, 2018 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants