title: gWidget : is there a way to emulate user actions in testthat?
body: <p>In my package, I'm using <code>testthat</code> and <code>gWidgetRGtk2</code>, I would like to know if there is a way to emulate user actions from the code line, for instance in the following I'm testing an action where the user pushes a button. So far I've been unable to test that part of the code, so I have to manually test all that.</p>
  
  <pre><code>require(gWidgets)
  options("guiToolkit"="RGtk2")
  
  win &lt;- gwindow("Hello World", visible=TRUE)
  obj &lt;- gbutton("Hello world", container = gwindow(),
   handler = function(h,...) assign("test",1,.GlobalEnv))
  
  require(testthat)
  test_that("Test button click",{
       # Something here to emulate pushing button      
        expect_equivalent(test,1)
      })
  </code></pre>
  
  <p>How can I emulate the user's action ?</p>