 
 module.exports =
 
-  openVmSettingsModal: (browser, vmName) ->
 
-    modalSelector = '.activity-modal.vm-settings'
+  openVmSettingsModal: (browser, vmName, cssSelector) ->
 
     if not vmName
       vmName = 'koding-vm-0'
 
-    vmSelector = '.activity-sidebar a[href="/IDE/' + vmName + '"].running'
+    if not cssSelector
+      cssSelector = '.general'
+
+    modalSelector = '.machine-settings-modal.AppModal'
+    itemSelector  = modalSelector + ' .AppModal-navItem' + cssSelector
+    vmSelector    = '.activity-sidebar a[href="/IDE/' + vmName + '"].running'
 
     browser
       .waitForElementVisible   vmSelector, 20000

      .click                   vmSelector + ' span'
      .waitForElementVisible   modalSelector, 20000 # Assertion
      .pause                   2500


  clickMoreButtonInVMSettingsModal: (browser) ->

    browser
      .waitForElementVisible  '.settings form.with-fields .moreview', 20000
      .click                  '.settings form.with-fields .moreview'
      .pause                  2000

  openDomainSettings: (browser, vmName) ->



    @clickAddKodingVMButton browser


  clickAddKodingVMButton: (browser) ->

    sidebarTitle = '[testpath=main-sidebar] .activity-sidebar .vms .sidebar-title'
    browser
      .waitForElementVisible   '.more-modal.more-vms', 20000 # Assertion
      .click                   '.kdbutton.create-koding-vm'


  seeUpgradeModal: (browser) ->

