01:48
aslakhellesoy joined
02:15
aslakhellesoy joined
02:17
ashley_moran joined
03:32
<robholland>
tomtt: hey :)
03:44
aslakhellesoy joined
04:01
<robholland>
aslakhellesoy: hey, seen my direct http call thread on the capybara ml? thoughts?
04:01
<aslakhellesoy>
robholland: have seen it, but haven't given it much thought
04:02
<aslakhellesoy>
robholland: do your proposed changes only work with rack-test?
04:03
<robholland>
yes, the other drivers don't support direct http calls
04:03
<robholland>
(because they emulate drivers)
04:03
<robholland>
er, browsers
04:03
<aslakhellesoy>
so why not just rely on the rack-test API for HTTP?
04:03
<aslakhellesoy>
i.e. let the user use that
04:03
<aslakhellesoy>
user being the programmer
04:03
<robholland>
because the capybara step definitions are useful when testing apis for us
04:04
<robholland>
and I don't want to change the language to avoid the capybara ones
04:04
<robholland>
and with the addition of those methods, I don't have to write any further code
04:04
<robholland>
it's all pragmastism rather than"design"
04:04
<robholland>
Not the best patch tbh, should have made sure it was specifically the direct call methods
04:05
<robholland>
The delegation stuff is just a tidy up obviously
04:05
<robholland>
And the cache change is actually a separate (although required) change for the direct calls to work
04:05
<robholland>
It actually has another benefit in that it prevents building the repsonse unless a step needs it
04:06
<robholland>
Perhaps a @api patch is cleaner
04:06
<aslakhellesoy>
The change is fairly small. Not a big deal that you clean up delegators in the same changeset.
04:06
<aslakhellesoy>
I think it would make sense to add this to Capybara.
04:06
<robholland>
A nod on the ml would be nice *puppy dog eyes*
04:07
<aslakhellesoy>
As long as the documentation clearly states that this is doing things the user can't do.
04:07
<aslakhellesoy>
robholland: will do
04:09
joshkalderimis joined
04:09
<aslakhellesoy>
robholland: but if you're testing an API that, say, returns JSON. How would Capybara handle the result?
04:10
<aslakhellesoy>
You can get the body allright, but wouldn't it also try to fit it into a Nokogiri DOM?
04:10
<aslakhellesoy>
(and blow up)?
04:10
<robholland>
Seemingly not, in that those stories pass
04:15
<aslakhellesoy>
robholland: I would add a test that tries to click a link after getting a JSON resource.
04:15
<aslakhellesoy>
-And verify that the error you get is something along the lines of "The last response was not HTML, but application/json."
04:17
<aslakhellesoy>
Only #body (and maybe #headers) should work after a non-html response.
04:17
<robholland>
That is a different issue though right?
04:17
<robholland>
I mean, any link could result in a non-html response
04:27
<aslakhellesoy>
robholland: true. so capybara should probably be behaving that way regardless of whether your change is merged in or not.
04:28
<robholland>
indeed
04:38
jschoolcraft joined
05:55
<mfojtik>
hi, just quick question, is there any way howto disable automatic loading of support/*/*.rb files ?
06:08
<aslakhellesoy>
mfojtik: explicitly --require what you want loaded
06:08
<aslakhellesoy>
--help for more
07:42
<flov>
Anybody has some experience using capybara ?
07:45
<flov>
i have some trouble using the selectors. It just doesnt find that input field
07:45
<flov>
i always get a Capybara::ElementNotFound exception Aaaargh
07:46
<robholland>
What does the step look like?
07:56
<robholland>
flov: the label for the field is "Confirm it"
07:56
<robholland>
Not Password Confirmation
07:56
<flov>
well yes, ok, but if i set it to password_confirmation it doesnt give me a passing step neither
07:58
<flov>
also, capybara just goes over the labels to select the input field? the error message says cannot fill in, no text field, text area or password field with *id, name, or label* 'Password Confirmation'
07:58
<robholland>
that's because the field name is person[password_confirmation]
07:58
<robholland>
And the id is person_password_confirmation
07:58
<robholland>
Read the source :)
08:02
<flov>
sorry, but which source? The Readme on github doesnt really explain how the fill_in method works
08:02
<robholland>
The source code to the page
08:03
<robholland>
You can use any of: 'person[password_confirmation]' or 'person_password_confirmation' or 'Confirm It'
08:03
<robholland>
'Confirm it' sorry (lower case i)
08:04
<robholland>
It does what the error messages says, it tries what you've given it against the id, name and label for the field
08:04
<robholland>
None of which are "Password Confirmation" or "password_confirmation"
08:08
<flov>
robholland: well, i tried confirm it before but it just doesnt work
08:09
<flov>
cannot fill in, no text field, text area or password field with id, name, or label 'Confirm It' found (Capybara::ElementNotFound)
08:09
<robholland>
Lower case i
08:09
<robholland>
Confirm it
08:10
<flov>
cannot fill in, no text field, text area or password field with id, name, or label 'Confirm it' found (Capybara::ElementNotFound)
08:10
<flov>
but person[password_confirmation] worked
08:12
<robholland>
You're label tag is incorrect
08:12
<robholland>
for="person_confirm_it"
08:13
<robholland>
If you fixed that, 'Confirm it' would work
08:13
<robholland>
The label tag currently points to a nonexistent field name
08:17
<flov>
ah, so the for attribute of the label tag points to the id tag of the input field?
08:17
<robholland>
Yes. That is it's purpose
08:18
<robholland>
Otherwise there would be no way to link a label with an input
08:18
<flov>
well, you could take the next input attribute from the label tag on
08:19
<flov>
i would be glad if that would be explained somewhere in the Readme of capybara. Did you actually read the code of capybara in order to understand whats happening?
08:19
<robholland>
Hmm? The fact a label's for attribute must point to a valid input is nothing to do with capybara
08:19
<robholland>
It's a requirement of HTML
08:21
<flov>
ok, i didnt know what the label tag was actually about
08:23
<flov>
robholland: thank you very much you saved my day :) i appreciate your help
09:26
<kurkale6ka>
Hi, I keep having this error: The WWW constant is deprecated, please switch to the new top-level Mechanize
10:34
aslakhellesoy joined
11:14
<GitHub63>
gherkin: 07eof-event 03ghnatiuk * 12b24c5 (15 files in 8 dirs): change message to eof and add to java
11:14
<GitHub63>
gherkin: 07eof-event 03ghnatiuk * 296fd24 (4 files in 4 dirs): parser should allow empty feature files
11:14
<GitHub63>
gherkin: 07eof-event 03aslakhellesoy * 2be4701 (26 files in 6 dirs): Add Eof() event to C#
11:15
<GitHub120>
cucumber: 07treetop-behaves_like_gherkin 03aslakhellesoy * 5f4e051 (20 files in 5 dirs): Treetop parser pretty much conforms to the Gherkin API. Getting closer to drop in the Gherkin parser.
11:15
<GitHub120>
cucumber: 07treetop-behaves_like_gherkin 03aslakhellesoy * c50324e (8 files in 2 dirs): Remove the old build methods in the Treetop parser.
11:35
<ghnatiuk>
aslakhellesoy: hey
11:36
<ghnatiuk>
but I removed the 'eof' from the 'Expected one of ...' parsing error message for ruby and java
11:36
<ghnatiuk>
seemed like a strange thing to claim is expected
11:37
<aslakhellesoy>
ghnatiuk: I might have missed something there.
11:37
<aslakhellesoy>
so we don't need to expect the eof you mean?
11:37
<ghnatiuk>
i think (based on the spec changes) that C# will still claim it's looking for eof
11:38
<ghnatiuk>
well, up for debate :) "Expecting one of scenario, scenario_outline, eof, examples..."
11:38
<ghnatiuk>
vs. leaving out the eof from that message
11:38
<GitHub77>
cucumber: 07treetop-behaves_like_gherkin 03aslakhellesoy * 62eaca4 (4 files in 1 dirs): Use eof event -
http://bit.ly/b9puS4
11:39
<aslakhellesoy>
Oh I see. Yes, that's a minor detail we should fix in C#
11:40
<aslakhellesoy>
I just pushed some code that makes Treetop behave (I think) exactly like Gherkin
11:40
<aslakhellesoy>
About to see if I can drive Cucumber with Gherkin now.
11:40
<aslakhellesoy>
Really excited
11:40
<mabes>
that is awesome
11:41
<msassak>
go go go go
11:41
<aslakhellesoy>
I felt really dirty when I refactored treetop and the ast
11:41
<msassak>
preeeetty crufty in there
11:41
<aslakhellesoy>
hell yeah
11:41
<aslakhellesoy>
refs going left and right in all directions.
11:41
<aslakhellesoy>
but it seems to work :-)
11:42
<aslakhellesoy>
ahh shit
11:42
<msassak>
what's wrong?
11:43
<aslakhellesoy>
we have to move the filters into the builder too - they're stuck in treetop
11:43
<aslakhellesoy>
you know, only build ast based on tag and line filters
11:43
<aslakhellesoy>
if present
11:44
<aslakhellesoy>
well, shouldn't bee too much work
11:44
<aslakhellesoy>
famous last words
11:44
<lucasbz>
hey, can someone help me out on sth?
11:44
<msassak>
lucasbz don't ask to ask :-)
11:46
<lucasbz>
ok, using webrat's visit on a step when I'm rendering the corresponding view, I get an 'undefined method' error, it seems that this is happeing due to me using 'form_for :user' + text_field :name
11:46
<lucasbz>
did I made myself any clear?
11:47
<aslakhellesoy>
aaaaaaaarrrrrrrgghhh
11:47
<* aslakhellesoy>
is just talking to himself
11:48
<aslakhellesoy>
ghnatiuk: now we need to cache a lot more in the builder
11:48
<msassak>
lucasbz can you gist the backtrace, feature and step definition?
11:48
<ghnatiuk>
ugh. I can hardly wait for a new ast.
11:48
<ghnatiuk>
that we can just apply filters to
11:48
<aslakhellesoy>
yeh
11:49
<msassak>
lucasbz err not the step def, but the view that's not being rendered
11:54
<msassak>
have you run the migrations in the cucumber environment?
11:55
<lucasbz>
hmm maybe not, dammit!
11:55
<msassak>
is that it?
11:56
<aslakhellesoy>
so regarding filtering - cucumber has historically done it in 2 different ways
11:56
<lucasbz>
yeah! unfortunately, or not...
11:57
<lucasbz>
thank you again ;)
11:57
<aslakhellesoy>
currently, if a filter is present (--tags, --name or a colon line number) the AST is only built up to match those
11:57
<msassak>
lucasbz cool glad to be of help
11:58
<aslakhellesoy>
previously (about a year ago) we'd always build the entire AST, but filter during traversal/execution
11:58
<aslakhellesoy>
I don't remember why we switched
11:58
<aslakhellesoy>
Probably performance related
11:58
<msassak>
that would be my guess
11:58
<aslakhellesoy>
It seems unnecessary to build nodes that never get executed
11:59
<aslakhellesoy>
So I'm thinking we should go with the current approach
11:59
<aslakhellesoy>
i.e. construct the builder with a filter, and ask the filter whether or not to create a node when we get events.
11:59
<aslakhellesoy>
wdyt?
11:59
<msassak>
i think that's best right now
12:00
<aslakhellesoy>
ok, i'll go with that
12:00
<msassak>
stick to how it is, rather than rewriting and integrating new things
12:01
<aslakhellesoy>
msassak: you talkin to me?
12:01
<msassak>
aslakhellesoy: yes, sorry :-)
12:01
<aslakhellesoy>
hehe
12:01
<msassak>
more rambling out loud, i suppose
12:07
<aslakhellesoy>
msassak: nono, i need to hear it :-)
12:22
<aslakhellesoy>
which means that row 10 and 11 should be omitted
12:22
<aslakhellesoy>
and the entire Examples section of row 13 and below
12:23
<aslakhellesoy>
That's a little tricky with a Gherkin based builder :-/
12:24
<aslakhellesoy>
Oh, the scenario at line 3 should also be excluded
12:26
<aslakhellesoy>
Maybe we can have 2 chained Gherkin builders?
12:26
<aslakhellesoy>
A first one that stacks up all events and replays it to a 2nd one that builds the AST?
12:27
<aslakhellesoy>
The 1st one could do the filtering before replaying the events maybe
12:27
<aslakhellesoy>
wdyt?
12:28
<aslakhellesoy>
this filtering/replaying listener could go into gherkin...
12:28
<ghnatiuk>
yeah, I think passing the builder through a second filter is a good idea
12:28
<aslakhellesoy>
filter_listener = Gherkin::FilterListener(tags=..., lines=..., names=..., listener)
12:28
<ghnatiuk>
applying that to the treetop output
12:28
<ghnatiuk>
in theory
12:29
<ghnatiuk>
should leave it unchanged since treetop is filtering while parsing
12:29
<aslakhellesoy>
ghnatiuk: it's trivial to remove the filtering from treetop
12:29
<ghnatiuk>
oh, in gherkin itself?
12:29
<aslakhellesoy>
-but we'd need a filtering listener in gherkin
12:30
<ghnatiuk>
why not in cucumber?
12:30
<ghnatiuk>
ultimately that's where filtering will happen, I think
12:30
<aslakhellesoy>
ghnatiuk: it could be in cucumber too
12:30
<ghnatiuk>
gherkin's fast enough that i think it will (down the road) make sense to build the entire ast, then throw parts of it out
12:30
<aslakhellesoy>
-but i imagine other gherkin bases tools (SpecFlow) would want filtering too
12:31
<aslakhellesoy>
so if we keep it in gherkin it's easier to port
12:32
<ghnatiuk>
seems to me like the idea of tagged/filtered things is pretty abstract
12:33
<ghnatiuk>
gherkin would have to get a whole lot smarter to know what tags applied to
12:33
<aslakhellesoy>
we already have gherkin/tools/pretty_listener.rb
12:33
<aslakhellesoy>
I'm thinking gherkin/tools/filter_listener.rb
12:34
<aslakhellesoy>
on :eof it replays events, just filtered
12:36
<* ghnatiuk>
thinking
12:37
<ghnatiuk>
that would mean implementing all the fancy tag logic in gherkin, right?
12:40
<aslakhellesoy>
the tag expr is converted to booleans and evaled :-D
12:40
<ghnatiuk>
aslakhellesoy: That got cleaned up!
12:44
<ghnatiuk>
aslakhellesoy: I really want to be able to ultimately do FeatureSuite.filter ...
12:44
<aslakhellesoy>
ghnatiuk: how do you mean?
12:44
<ghnatiuk>
it doesn't feel right to me, ATM, for gherkin to be concerned with that
12:44
<ghnatiuk>
well, ast_node.filter
12:45
<ghnatiuk>
and get back a new filtered ast
12:45
<aslakhellesoy>
ghnatiuk: well. imagine you have 200 feature files
12:45
<aslakhellesoy>
and you want an ast for only the stuff that has @foo
12:45
<aslakhellesoy>
you'd have to build a huge ast and filter that
12:45
<ghnatiuk>
that's like 2 seconds in gherkin, right :)
12:46
<aslakhellesoy>
ghnatiuk: there is also the ast building overhead which happens outside gherkin
12:46
<aslakhellesoy>
but it might not be a whole lot...
12:46
<ghnatiuk>
hah, strangely, when running the benchmarks, treetop w/o ast building takes more time than w/ ast building
12:47
<ghnatiuk>
or maybe it's building it in both cases...er
12:47
<aslakhellesoy>
any particular reason you want to build the full ast first and then filter it - as opposed to filter it while it's being built?
12:47
<ghnatiuk>
well, you can filter for other things than just tags
12:48
<aslakhellesoy>
yes, names based on regexp and line numbers for a particular file
12:48
<aslakhellesoy>
i mean - the end result is the same - a subset of the full asts
12:49
<aslakhellesoy>
how we get there doesn't seem important as far as usage goes
12:49
<aslakhellesoy>
i think it would be fairly troublesome to add back filtering inside the current cucumber ast
12:50
<aslakhellesoy>
it's already crufty as hell, and adding that in addition would be a nightmare
12:50
<aslakhellesoy>
so in order to finish the task i've started on i think it's simplest to go for filtering while building the ast
12:51
<msassak>
aslakhellesoy ghnatiuk what's the simplest thing that will work, right now?
12:52
<aslakhellesoy>
right now, adding filtering to the ast seems too hard, so filtering while building the ast seems simpler
12:52
<ghnatiuk>
Treetop already does it. Making gherkin do it too so it can be dropped in makes sense.
12:52
<aslakhellesoy>
treetop does it by looking ahead
12:53
<msassak>
i'm not sure it belongs in tools
12:53
<aslakhellesoy>
and we can't look ahead with gherkin
12:53
<msassak>
(speaking of adding it into gherkin)
12:53
<msassak>
but i think it would be a nice addition
12:53
<msassak>
the idea of chaining listeners is an attractive one, to me
12:53
<aslakhellesoy>
if we add it to gherkin i think it's a matter of moving cucumber's TagExpression and a special listener
12:54
<aslakhellesoy>
i think the listener will be fairly simple
12:55
<aslakhellesoy>
anyone up for pairing for an hour?
12:56
<msassak>
if i had my mac at work, sure, as it is... maybe
12:57
<ghnatiuk>
yeah, at day job currently :)
13:00
<aslakhellesoy>
ok, i'll get started then :-)
13:13
<GitHub53>
gherkin: 07filter-listener 03aslakhellesoy * fd3cf9d (0 files in 0 dirs): Start work on filter listener -
http://bit.ly/cjR1d2
13:14
<aslakhellesoy>
ghnatiuk: msassak there you go - that's the idea.
13:14
<aslakhellesoy>
of course, :eof will have to be a little smarter
13:15
<aslakhellesoy>
our pretty listener makes it a tad easier for us to write specs too
13:16
<msassak>
that's pretty much what i imagined
13:19
<GitHub39>
gherkin: 07filter-listener 03aslakhellesoy * a7c4700 (1 files in 1 dirs): Make a method that does the hard work -
http://bit.ly/cbXFMp
13:22
<nofxx>
noon, allow me a lil question, does "when I select" have a inverse op? Wanna deselect an item from a multiselect.
13:31
<aslakhellesoy>
nofxx: select is for <select> boxes
13:32
<aslakhellesoy>
are you trying to uncheck an <input type="checkbox"> ?
13:34
<aslakhellesoy>
nofxx: aaah you're using a <select multiple="multiple">?
13:37
<aslakhellesoy>
nofxx: Cucumber-Rails doesn't have that, but it would be easy to add:
13:38
<aslakhellesoy>
i'd be happy to merge it in if you change it
13:50
aslakhellesoy_ joined
14:12
bcardarella_ joined
14:25
aslakhellesoy joined
15:04
<flov>
arg! Can anybody tell me why i get this exception???
15:08
<ghnatiuk>
flov: it looks like Country is not actually a label for the country select field
15:08
<ghnatiuk>
so webrat doesn't know how to find the select box
15:09
<flov>
ghnatiuk: why? the id of the select field is the same as the for attribute of the label tag
15:11
<ghnatiuk>
hmm. source looks like (~ line 108) it's not a label
15:12
<ghnatiuk>
but I didn't look super hard. Have you tried using "Then show me the page" before that step?
15:12
<ghnatiuk>
often helps to see exactly what webrat is looking at
15:13
<flov>
yes its passing
15:13
<flov>
also i dont get an ElementNotFound exception but instead tells me that its examining a nil object
15:13
<flov>
btw: i use capybara
15:13
<flov>
its passing without the I Select...
15:15
<flov>
the given code on the domain is not the current one
15:15
<flov>
i was wondering :)
15:15
<ghnatiuk>
are those countries in a table that needs to be seeded for the cucumber environment?
15:15
<flov>
oh yes! Thats it. they are not in the db :)
15:16
<flov>
ghnatiuk: Thank you, i appreciate your help
15:16
<ghnatiuk>
flov: np.
15:25
aslakhellesoy joined
15:26
<aslakhellesoy>
ghnatiuk, could you do me a favour and answer Michał Nowotarski on the ML?
15:27
<aslakhellesoy>
I'm going to be busy the next days.
15:29
<* ghnatiuk>
reading
15:30
<nkabbara>
Hi, I'm trying to test a metal using cucumber, but it seems stubbing isn't extending all the way to the metal code. Any idea why? Thanks.
15:37
<ghnatiuk>
aslakhellesoy: I don't see a lot of advantage to the Path change
15:37
<ghnatiuk>
PageElement seems like an interesting idea for cucumber-rails
15:46
<ghnatiuk>
aslakhellesoy: Sure, I'll respond. gonna get out of the office first, though. way too nice outside to be away from windows.
16:29
aslakhellesoy joined
16:44
<flov>
\join #rubyonrails
17:03
aslakhellesoy joined
20:29
<bmcmanus>
so i've been messing with java for a few months but am starting a new rails app... what'd i miss with this whole webrat/capybara thing?
21:04
<bmcmanus>
trying to get cucumber working with rspec in rails3 and i'm getting "undefined method `have_content' for #<Cucumber::Rails::World:0x2071db0> (NoMethodError)"
21:05
<bmcmanus>
anyone know why it wouldn't recognize have_content?