Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox changes, created its own GwtWidgetFinder. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

branflake2267
Copy link
Collaborator

See what you think of this...

  1. creates its own gwt widget finder
  2. added a search with out using a with

new ByNearestWidget(driver, com.sencha.gxt.widget.core.client.form.ComboBox.class)
)));
} else {
WebElement foundElement = elt.findElement(new FasterByChained(By.xpath(".//*"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed the search, so no with has to be used

Copy link
Owner

Choose a reason for hiding this comment

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

The basic problem I have with this is that it just finds the first ComboBox in the dom, not necessarily the first one the user sees. Could be invisible (not totally sure of this) could be on the main page (i.e. when the user is in a modal window - technically the one on the main page will come first), or they could be reordered on the page.

Helpful for testing individual components, but less good for describing the relationship of the elements in a full application.

If we were to go this route, I'd want to make it configurable globally, and off by default, to avoid possible confusion. Or, since the point here is to just find the first thing that matches, a GwtWidget.findFirst(Class<T extends GwtWidget) that returns T rather than a finder<T>. That could key off of @ForWidget and find the first (visible?) instance in the dom.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't mind which way you want to go. I tried searching for the combo by field in its latest config and it doesn't find it, so I thought I'd see what you thought. I think the last else should probably just say use a with* in the builder, otherwise it seems that I can't find a widget at all, and no such element is found, but maybe its operator error.

I was picturing something like this:
ComboBox combo = myFormWithOneCombo.find(ComboBox.class, driver).done();

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just a thought,

List<ComboBox> combo = window.findWidgets(ComboBox.class, driver).done();

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.

2 participants