       .clearValue             saveAsInputSelector
       .setValue               saveAsInputSelector, newName
       .click                  saveButtonSelector
-      .waitForElementVisible  "#{paneSelector} div[title='#{newName}']", 20000 # Assertion
+      .waitForElementVisible  "#{tabHandleSelector} div[title='#{newName}']", 20000 # Assertion
       .waitForElementVisible  filesTabSelector, 20000
       .assert.containsText    filesTabSelector, newName # Assertion
 


  openContextMenu: (browser) ->

    fileSelector = ' .untitledtxt.active'

    browser
      .waitForElementVisible  paneSelector + fileSelector, 20000
      .moveToElement          paneSelector + fileSelector, 60, 17
      .moveToElement          paneSelector + fileSelector + ' span.options', 8, 8
      .waitForElementVisible  paneSelector + fileSelector + ' span.options', 20000
      .click                  paneSelector + fileSelector + ' span.options'
      .waitForElementVisible  '.kdlistview-contextmenu', 20000 # Assertion



helpers           = require './helpers.js'
tabHandleSelector = "#{panelSelector} .application-tab-handle-holder"

module.exports =

  openNewFile: (browser) ->

    activeEditorSelector = '.pane-wrapper .kdsplitview-panel.panel-1 .kdtabpaneview.active .ace_content'
    plusSelector         = tabHandleSelector + ' .visible-tab-handle.plus'

    browser
      .waitForElementVisible  plusSelector, 20000
