Write a Java test

Write a simple test scenario, compile it, and execute it.

Before you begin:
  1. Begin by running the Genero Ghost Client ggcgen tool to create a skeleton application.
    ggcgen java --skeleton myapp_tests

    The myapp_tests_provider.java file is created in the "scenario" package:

    /*
     * Generated using Genero Ghost Client 2.00.06-201905141203
     */
    package scenario;
    
    import com.fourjs.ggc.ScenarioProvider;
    import com.fourjs.ggc.Scenario;
    import com.fourjs.ggc.Client;
    import com.fourjs.ggc.generator.ScenarioChecks;
    import java.util.concurrent.ConcurrentLinkedDeque;
    
    public class myapp_test2_provider implements ScenarioProvider
    {
      private final ConcurrentLinkedDeque<Scenario> scenarios;
    
      /* Instance initializer */
      public myapp_test2_provider()
      {
        scenarios = new ConcurrentLinkedDeque<>();
    
        /* Register scenario functions */
        scenarios.add(new scenario_0());
    
      }
    
      /* Scenario myapp_test2 id: 0 */
      private class scenario_0 implements Scenario
      {
        @Override
        public void play(Client client)
        {
          
        }
      }
    
      @Override
      public Scenario nextScenario()
      {
        return scenarios.removeFirst();
      }
    }
    In this skeleton scenario:
    1. The code begins by importing the Genero Ghost Client Java classes.
    2. The myapp_test2_provider() method implements the com.fourjs.ggc.ScenarioProvider interface.
    3. A function (scenario_0) with the id of 0 is registered in the scenarios variable. A test may register multiple test scenarios in this variable. They run in the sequence registered.
    4. A scenario_0 class is declared. This implements the com.fourjs.ggc.Scenario interface, which requires the method play to run the test.
  2. To the play method of the scenario_0 class add code to test an application.
    For the test, the window name is retrieved from the client and the action cancel is triggered.
    /*
     * Generated using Genero Ghost Client 2.00.06-201905141203
     */
    package scenario;
    
    import com.fourjs.ggc.ScenarioProvider;
    import com.fourjs.ggc.Scenario;
    import com.fourjs.ggc.Client;
    import com.fourjs.ggc.generator.ScenarioChecks;
    import java.util.concurrent.ConcurrentLinkedDeque;
    
    public class myapp_test2_provider implements ScenarioProvider
    {
      private final ConcurrentLinkedDeque<Scenario> scenarios;
    
      /* Instance initializer */
      public myapp_test2_provider()
      {
        scenarios = new ConcurrentLinkedDeque<>();
    
        /* Register scenario functions */
        scenarios.add(new scenario_0());
    
      }
    
      /* Scenario myapp_test2 id: 0 */
      private class scenario_0 implements Scenario
      {
        @Override
        public void play(Client client)
        {
          String windowTitle = client.getUserInterface().getCurrentWindow().getTitle();
    
          System.out.println("Window title is: " + windowTitle);
          System.out.println("Exiting with action 'cancel'");
    
          client.wait(100);
          client.action("cancel"); 
        }
      }
    
      @Override
      public Scenario nextScenario()
      {
        return scenarios.removeFirst();
      }
    }