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

Add missing text-like input types #548

Closed
mkutz opened this issue Dec 3, 2018 · 9 comments
Closed

Add missing text-like input types #548

mkutz opened this issue Dec 3, 2018 · 9 comments
Assignees
Milestone

Comments

@mkutz
Copy link

@mkutz mkutz commented Dec 3, 2018

Since there are already several implementations (e.g. SearchInput, TelInput or EmailInput, there should be a corresponding implementation for all types listed here.

Missing are

  • color not text-like, will be put in separate issue
  • datetime-local not text-like, will be put in separate issue
  • image not text-like, will be put in separate issue
  • month not text-like, will be put in separate issue
  • number
  • password
  • range not text-like, will be put in separate issue
  • time not text-like, will be put in separate issue
  • url
  • week not text-like, will be put in separate issue
@mkutz
Copy link
Author

@mkutz mkutz commented Dec 3, 2018

I'd provide a PR in the next days if nobody has any objections against this issue.

@erdi
Copy link
Member

@erdi erdi commented Dec 3, 2018

@mkutz
Copy link
Author

@mkutz mkutz commented Dec 4, 2018

I'm trying to write the needed tests and found the DateInputSpec as a template for the DateTimeLocalInputSpec. How can I execute that test? Is there a way to do it without Sauce Labs?

See 311dbfc

@erdi
Copy link
Member

@erdi erdi commented Dec 4, 2018

@mkutz
Copy link
Author

@mkutz mkutz commented Dec 4, 2018

Also, note that DateInputSpec is somewhat special - it caters for the fact
that the module it tests only works in a subset of browsers. For modules
handling controls that are supported in all browsers including HtmlUnit I’d
model the tests after specs like TextInputSpec.

I picked DateInputSpec for exactly that reason. The datetime-local input is not even supported by Firefox.

@mkutz
Copy link
Author

@mkutz mkutz commented Dec 7, 2018

I get the following error for the more "fancy" input types of ColorInput, DateTimeLocalInput, MonthInput, RangeInput and TimeInput:

org.openqa.selenium.InvalidElementStateException: invalid element state: Element must be user-editable in order to clear it.

I guess there is something missing in Selenium or in the browsers' web driver, rather then in Geb. What do you think @erdi?

I'd like to reduce the scope of this issue to the missing text-like input types (NumberInput, PasswordInput and UrlInput

@erdi
Copy link
Member

@erdi erdi commented Dec 7, 2018

It will be most likely due to this line: https://github.com/geb/geb/blob/3e0ada5065856a7ef1576eae5f25fdcf0e41bb7e/module/geb-core/src/main/groovy/geb/navigator/NonEmptyNavigator.groovy#L713. Note how I had to put in a special case for date inputs.

I'm more than happy for you to reduce the scope to NumberInput, PasswordInput and UrlInput because I know that the more fancy controls are not so straightforward to support - I experienced it when adding a module for date inputs. I wanted to suggest working on it one by one initially but didn't want to curb your enthusiasm...

@mkutz
Copy link
Author

@mkutz mkutz commented Dec 7, 2018

Just found the line. I'll check if that works.

I'll reduce the scope anyway and open one new issue per fancy input.

The commits I did I'll cherry-pick for other PR's.

@mkutz mkutz changed the title Add missing input types Add missing text-like input types Dec 7, 2018
@mkutz
Copy link
Author

@mkutz mkutz commented Dec 7, 2018

I had some trouble running the snippets on my machine:

org.openqa.selenium.WebDriverException: newSession
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'digital0507', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-12-generic', java.version: '1.8.0_191'
Driver info: driver.version: FirefoxDriver
remote stacktrace: stack backtrace:
   0:           0x4f388c - backtrace::backtrace::trace::h736111741fa0878e
   1:           0x4f38c2 - backtrace::capture::Backtrace::new::h63b8a5c0787510c9
   2:           0x442d88 - webdriver::error::WebDriverError::new::hea6d4dbf778b2b24
   3:           0x44cecc - geckodriver::marionette::MarionetteSession::response::h98d048d51a7ee2ba
   4:           0x42c729 - <webdriver::server::Dispatcher<T, U>>::run::hba9181b5aacf8f04
   5:           0x402c59 - std::sys_common::backtrace::__rust_begin_short_backtrace::h19de262639927233
   6:           0x40c065 - std::panicking::try::do_call::h6c1659fc4d01af51
   7:           0x5e38ec - panic_unwind::__rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
   8:           0x420d32 - <F as alloc::boxed::FnBox<A>>::call_box::h953e5f59694972c5
   9:           0x5dc00b - alloc::boxed::{{impl}}::call_once<(),()>
                        at /checkout/src/liballoc/boxed.rs:661
                         - std::sys_common::thread::start_thread
                        at /checkout/src/libstd/sys_common/thread.rs:21
                         - std::sys::imp::thread::{{impl}}::new::thread_start
                        at /checkout/src/libstd/sys/unix/thread.rs:84

Probably nothing related to my changed, so I created the PR anyway.

@erdi erdi closed this Dec 12, 2018
@erdi erdi added this to the 2.3 milestone Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants