These are chat archives for mojotech/pioneer

14th
Oct 2014
Dominik Guzei
@DominikGuzei
Oct 14 2014 09:45
@samccone how do you handle step definitions where you dont interact with selenium-webdriver but only do some server stuff (inserting in db etc.) You still return an Promise?
Sam Saccone
@samccone
Oct 14 2014 12:59
thats correct @DominikGuzei
always return promises :)
Dominik Guzei
@DominikGuzei
Oct 14 2014 13:00
do you use something like Q for that?
Sam Saccone
@samccone
Oct 14 2014 13:04
yeah or bluebird or when or native promises
blue bird is nice for this stuff tho
just Promise.resolve(foo)
Dominik Guzei
@DominikGuzei
Oct 14 2014 13:04
ok thanks – will look into that :-)
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:14
@samccone do you know what the problem could be: When I run the tests, everything becomes green immediately and then the webdriver promise times out and the process is exited with the exception
Sam Saccone
@samccone
Oct 14 2014 20:14
woah
ha that sounds insane
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:15
it doesn't get caught
Sam Saccone
@samccone
Oct 14 2014 20:15
did you add something to beforeEach ?
or before?
or after?
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:15
no
Sam Saccone
@samccone
Oct 14 2014 20:15
is this something new
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:16
but yeah, I had to use a custom version of the support code index.coffee
Sam Saccone
@samccone
Oct 14 2014 20:16
hmm
i am guessing it might be in that
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:16
where does cucumber actually catch the exceptions?
@_inFlow = (code, callback) ->
    $.createFlow (flow) =>
      flow.execute => code.call this
    .then _.partial(callback, null), (error) -> throw error
Sam Saccone
@samccone
Oct 14 2014 20:19
sooo
the inflow bit
is so we can add before and after hooks
not something you should use
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:19
My exception is thrown here: node_modules/selenium-webdriver/lib/webdriver/promise.js:1643
ah sorry
you are right, this has nothing todo with my problem
Sam Saccone
@samccone
Oct 14 2014 20:20
heh
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:22
because it isnt thrown in a Before or After hook
Sam Saccone
@samccone
Oct 14 2014 20:22
hmm ok
what is the actual error?
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:22
I20141014-22:13:40.725(2)?     Given I am viewing the leaderboard example
I20141014-22:13:40.769(2)?     Given "Grace Hopper" has a score of 10
I20141014-22:13:40.809(2)?     When I give "Grace Hopper" 5 points
I20141014-22:13:40.855(2)?     Then "Grace Hopper" should have a score of 15
I20141014-22:13:40.856(2)? 
I20141014-22:13:40.856(2)? 1 scenario (1 passed)
I20141014-22:13:40.856(2)? 4 steps (4 passed)
I20141014-22:13:40.856(2)? 
W20141014-22:13:43.449(2)? (STDERR) 
W20141014-22:13:43.449(2)? (STDERR) /Users/dominik/Dropbox/work/projects/opensource/meteor-packages/pioneer/.npm/package/node_modules/pioneer/node_modules/selenium-webdriver/lib/webdriver/promise.js:1643
W20141014-22:13:43.450(2)? (STDERR)       throw error;
W20141014-22:13:43.450(2)? (STDERR)             ^
W20141014-22:13:43.450(2)? (STDERR) AssertionError: expected '10' to equal '15'
Sam Saccone
@samccone
Oct 14 2014 20:23
oh so that is an expected error
right¿
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:23
yeah
but the feature should fail
Sam Saccone
@samccone
Oct 14 2014 20:23
did you forget to return?
in your step
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:24
@Then /^"([^"]*)" should have a score of (\d+)$/, (name, score) ->

    leaderBoard = new @Widgets.LeaderBoard()
    leaderBoard.getPlayerScore(name).should.eventually.equal score
Sam Saccone
@samccone
Oct 14 2014 20:24
yeah that seems right
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:24
the strange thing is that i just skips right through
could this happen if I ever forget to return a promise?
in some other step
Sam Saccone
@samccone
Oct 14 2014 20:24
not skipping over all of them
this seems like a more general issue
i am guessing it is higher up in something you changed...
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:25
yeah its probably because I have to adjust your pioneer code here and there
Sam Saccone
@samccone
Oct 14 2014 20:25
that seems like it might be the issue
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:26
could the problem be that my steps run within a Fiber?
Sam Saccone
@samccone
Oct 14 2014 20:30
esh
hahahah
you are running with fibers
yes
that could totallllllly be it
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:31
Fibers + Promises = best friends?
Sam Saccone
@samccone
Oct 14 2014 20:32
HHAHAHAH
i literally just laughed
in my office
that will… not work
ha
that is totally the problem
:) I actually tried that a while ago
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:33
fuck :-)
Sam Saccone
@samccone
Oct 14 2014 20:33
HA
you shoul read up on threads
and callbacks
:)
very different things
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:34
yeah i am pretty new into Fibers and Promises
Sam Saccone
@samccone
Oct 14 2014 20:34
:)
Fibers === Threads
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:35
I just confirmed it – it works when I remove the fiber code
Sam Saccone
@samccone
Oct 14 2014 20:35
heh
Dominik Guzei
@DominikGuzei
Oct 14 2014 20:35
thanks for rubber ducking :-D
Sam Saccone
@samccone
Oct 14 2014 20:36
hehehe
np np