Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

chore(elementArrayFinder): separate elementFinder into its own file #1633

Closed
wants to merge 1 commit into from

Conversation

hankduan
Copy link
Contributor

protractor.js is growing very big. This separates ElementFinder/ElementArrayFinder (which really don't belong to the protractor class) into its own file.
Also helps with unit testing in the future by injecting a mock ptor object.

@googlebot
Copy link

CLAs look good, thanks!

@@ -0,0 +1,944 @@
var util = require('util');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this can't be two files - one for ElementFinder and one for ElementArrayFinder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it could be two files. Just figured they're so tightly bound, it's easier to put them in one file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it would make things more complex don't bother, I was just thinking that it's easier conceptually for me to have one file per object to return.

If you're going to have one file for both, maybe a different file name though? The name elementArrayFinder.js suggests that someone might write var ElemenetArrayFinder = require('./elementArrayFinder.js'). I might try something like elementFinders.js.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it in one file (they are tightly bound) and call it element.js (matches what the test file is called, encompasses both)

@sjelin
Copy link
Contributor

sjelin commented Dec 12, 2014

LGTM

@juliemr
Copy link
Member

juliemr commented Dec 15, 2014

LGTM after file name change

@hankduan
Copy link
Contributor Author

Closed via 015cafc

@gd46
Copy link

gd46 commented Mar 6, 2016

Hi I was wondering if someone can explain the proper method of extending ElementFinder and ElementArrayFinder, I see this issue was merged in awhile ago, but Im using protractor 2.5.1, and I have experimented with the latest protractor and I can't seem to extend either unless I use the work around described in the linked issue.

@sjelin
Copy link
Contributor

sjelin commented Mar 15, 2016

Please ask support questions on Stack Overflow

@gd46
Copy link

gd46 commented May 6, 2016

Hi I have asked this question on StackOverflow with no luck. Can you please explain how I can override the selenium functions that are in ElementArrayFInder, WEB_ELEMENT_FUNCTIONS. I specifically looking to override the click function, but may in the future look at others.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants