by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:39
    christian-bromann labeled #5900
  • 13:39
    christian-bromann commented #5900
  • 13:30
    wswebcreation edited #5900
  • 13:00
    alinaIftode opened #5900
  • 12:58
    christian-bromann synchronize #5840
  • 12:58

    christian-bromann on cb-rewrite-wdio-logger

    some cleanups (compare)

  • 12:21
    christian-bromann labeled #5898
  • 12:21
    christian-bromann labeled #5898
  • 12:21
    christian-bromann labeled #5898
  • 12:21
    christian-bromann labeled #5898
  • 12:21
    christian-bromann commented #5898
  • 12:20
    christian-bromann closed #5899
  • 12:20
    christian-bromann commented #5899
  • 12:18
    payalsood edited #5899
  • 11:49
    christian-bromann synchronize #5840
  • 11:49

    christian-bromann on cb-rewrite-wdio-logger

    rewrite commands test (compare)

  • 11:40
    payalsood edited #5899
  • 11:37
    payalsood opened #5899
  • 10:11
    faizaaslam1 edited #5898
  • 10:11
    faizaaslam1 edited #5898
Christian Bromann
@christian-bromann
@slawomir-brzezinski-at-travcorp good practice is you initialise convenience methods in your before hook in your wdio.conf
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
Second question: the timeoutsImplicitWait . If I run it like browser.timeoutsImplicitWait(123).click(...). Does it affect just the click, or all the commands that run after, even not in the same access chain?
Christian Bromann
@christian-bromann
afaik all methods in your session
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
thanks
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
another one: the 'callback' in http://webdriver.io/api/protocol/timeoutsImplicitWait.html suggests that changing this setting is asynchonous
how do I set it in some initialization code (wdio.conf ?) so that my tests don't start until the timeoutsImplicitWait has finished
do the hooks support some sort of flagging when I'm done with the hook, say, by returning promise?
Leo Laskin
@llaskin
@christian-bromann so by using that boilerplate, that would be my js spec? and inside that I coudl call test1(), test2(), test3()?
Christian Bromann
@christian-bromann
@slawomir-brzezinski-at-travcorp yes, hooks support promises, so your test won’t start after that promise is fullfilled or rejected
@llaskin basically yes
but here is the thing why I don’t understand you don’t use BDD, let’s say one of your tests fails somewhere in the middle..you will have a hard time to figure out what exactly happened and where it broke and what feature broke whereas when you split your test in multiple it blocks and make use of before hooks to setup tests you can seperate them clearly and don’t make tests dependend on each other
I just can’t see the advantage of writing a huge chain of commands
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
@christian-bromann thanks. So returning a promise does the trick. I couldn't find this documented anywhere. Am I still missing some good documentation resource? Or am I just not looking well enough at http://webdriver.io/guide.html and http://webdriver.io/api.html
?
Christian Bromann
@christian-bromann
it is hidden but available: http://webdriver.io/guide/testrunner/configurationfile.html
Run functions before or after the test. If one of them return with a promise, WebdriverIO will wait until that promise got resolved to continue.
so it should actually be already documented in your wdio.conf.js :wink:
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
@christian-bromann Ahh perfect! Thanks for revealing that one!
@christian-bromann Thanks a lot. Have a good day!
Christian Bromann
@christian-bromann
you too
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
Oh. One last thing...
@christian-bromann I want to have the starting of the selenium-standalone somehow incorporated into my test run, so that there is just one command to execute
presently I need to run 'selenium-standalone start' in some other window
Christian Bromann
@christian-bromann
I would recommend to use https://github.com/vvo/selenium-standalone .. just start it in your onPrepare hook
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
How should I go about doing that, so that the selenium-standalone starts up before the tests and tears down afterwards?
Christian Bromann
@christian-bromann
right
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
what about multiple instances on same machine, when I use the .start, can I specify the port? Or better yet, can I delegate finding it to selenium standalone, so that it tells me what the port is?
Christian Bromann
@christian-bromann
start the server in your onPrepare hook and kill the server in onComplete
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
@christian-bromann (finiding it, I mean, finding any unused port)
Christian Bromann
@christian-bromann
well if you call start in initialses a selenium standalone usually on port 4444
and then it takes care about running chromedriver and whatnot for you
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
yep I saw that. I'm concerned that this may need to run on build servers, and ideally they should be able to build many jobs in parallel
Christian Bromann
@christian-bromann
onPrepare gets executed only once
whereas before gets executed per running capability test
onPrepare/onComplete are global hooks and before/after capability specific ones
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
but I don't want the limitation that I can only have one of this running on single machine
say, I've a CI build server, and it continually builds new versions from different branches
and the builds all run on the same machine
how do I vary the port?
Christian Bromann
@christian-bromann
ahh I see, well then it would make sense to run the server as a process in the background and not to start it everytime you kick of a build
or maybe do that and set the port to the current build number
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
well, but I want all the source projects to be self contained, I don't want any dependency
yeah, ok, I just don't know how to set it :)
where to make it not the default 4444
will look around
Christian Bromann
@christian-bromann
you can pass some options to as parameter to that start method (see https://github.com/vvo/selenium-standalone#seleniumstartopts-cb)
but your selenium infrastructure should be independent from your projects and tests
I recommend to have a global server running somewhere in the background
your projects are still self contained then
slawomir-brzezinski-at-travcorp
@slawomir-brzezinski-at-travcorp
this is too heavy for now, I don't control the build machines
Christian Bromann
@christian-bromann
I see ok