xeqi / kerodon

interaction and testing library for html based ring apps.
304 stars 22 forks source link

Pressing buttons #23

Closed strika closed 10 years ago

strika commented 10 years ago

Let me know if I'm missing something, but it looks like that press is working only with <input type="submit"> and not with <button>. Is there a way to interact with buttons?

Thanks.

strika commented 10 years ago

I believe this is fixed and can be closed.

glenjamin commented 10 years ago

Yup, i'm planning to add a bit more test coverage then publish a new version.

glenjamin commented 10 years ago

So, when fleshing out the testcases here I notice that the value attribute is being used to match <button> elements.

However, the value attribute on buttons does not control their visible UI, their content does.

@strika @Frozenlock @philandstuff - do you have some examples of html / tests you have that use the button element?

If I change to using the button content instead of value, will this break your tests?

The goal with kerodon is to interact as a user would, so i don't think button value is the right choice here. (there's some WIP on the buttons branch)

Frozenlock commented 10 years ago

The only way I used the press function is by giving it a specific button ID:

(-> (session server/app)
      ....
      (press [:#submit-new-project])
      ....
philandstuff commented 10 years ago

The button I wish to press looks like this:

<button class="button continue" type="submit">Continue</button>

In this case it might make sense to match the tag content? Would be happy to match by ID or class too.

glenjamin commented 10 years ago

Cheers for the input guys, I reckon I'll go ahead with the changes to make buttons match on content.

CSS selectors will continue to work as with the current patch

glenjamin commented 10 years ago

I've just pushed an update to this functionality in ac6dc2c91476cc37d90335030e189a697da32fac

If you get a chance, giving 0.4.0-SNAPSHOT a spin would be great.

https://clojars.org/kerodon/versions/0.4.0-SNAPSHOT

strika commented 10 years ago

Tested :+1: here https://github.com/strika/servisne.info/pull/13.

Thanks.

philandstuff commented 10 years ago

@glenjamin same here :+1:

glenjamin commented 10 years ago

0.4.0 released!

philandstuff commented 10 years ago

Hooray! :whale:

xeqi commented 10 years ago

:clap: