These are chat archives for Codeception/CodeceptJS

13th
May 2016
Rémi Benoit
@AltarBeastiful
May 13 2016 15:13
Hi all
Is it possible to output values to the console when running tests?
Adrian Lynch
@adrianblynch
May 13 2016 15:18
Try console.log()
Rémi Benoit
@AltarBeastiful
May 13 2016 15:22
Ty, I was confused for a minute ><
Is there any way to get more info about WebdriverIO errors ?
using --full-trace I get :
 > WebDriverIO._failed
but that's not very informative :)
Adrian Lynch
@adrianblynch
May 13 2016 15:31
Do you have access to Selenium's output? That should have more info on failures.
Rémi Benoit
@AltarBeastiful
May 13 2016 15:32
I have, it does give a better view on what is getting executed
but still no info on the error itself
I'm trying to create a function using webdriverio
in a helper
  switchLastOpenedTab() {
    let client = this.helpers['WebDriverIO'].browser;

    console.log("begin");

    return client.getCurrentTabId(function(tab) {
      console.log(tab);
      client.close(tab);
    }); 

  }]
but it never get's to the second console.log
and I can see the get current in Selenium output
 • I switch last opened tab 
begin
17:32:12.911 INFO - Executing: [get current window handle])
17:32:13.894 INFO - Done: [get current window handle]
17:32:13.902 INFO - Executing: [take screenshot])
17:32:15.024 INFO - Done: [take screenshot]
any idea what could be wrong
?
Rémi Benoit
@AltarBeastiful
May 13 2016 15:46
Actually even the example from http://codecept.io/helpers/ gives me an error
if only I knew which ><
Adrian Lynch
@adrianblynch
May 13 2016 15:50

Update your: console.log("begin");
To: console.log(“begin”, client);
Or: console.log(“begin”, Object.keys(client));

Is getCurrentTabId listed?

Rémi Benoit
@AltarBeastiful
May 13 2016 16:12
begin { state: 'fulfilled',
  value: 
   { sessionId: '5e1afb6e-4e32-460c-86c7-c78dd067877b',
     status: 0,
     state: null,
     value: 
      { platform: 'LINUX',
        javascriptEnabled: true,
        acceptSslCerts: true,
        browserName: 'firefox',
        rotatable: false,
        locationContextEnabled: true,
        'webdriver.remote.sessionid': '5e1afb6e-4e32-460c-86c7-c78dd067877b',
        version: '45.1.0',
        databaseEnabled: true,
        cssSelectorsEnabled: true,
        handlesAlerts: true,
        webStorageEnabled: true,
        nativeEvents: false,
        applicationCacheEnabled: true,
        takesScreenshot: true },
     class: 'org.openqa.selenium.remote.Response',
     hCode: 1549895645 } }
2 [ 'defer',
  'promise',
  'lastPromise',
  'desiredCapabilities',
  'requestHandler',
  'logger',
  'options',
  'commandList',
  'isMobile',
  'isIOS',
  'isAndroid',
  'next',
  'finally',
  'call',
  'then',
  'catch',
  'inspect',
  'unify',
  'addCommand',
  'transferPromiseness',
  'depth',
  'name',
  'lastResult',
  'isExecuted' ]
this are the 2 console output you gave me
doesn't seem to be there, I got getCurrentTabId from there http://webdriver.io/api/window/getCurrentTabId.html
anyway even the example from http://codecept.io/helpers/ doesn't work there
maybe smthg new in webdriverio
anyhow gotta run, I'll test this more at home