Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* MIT License
*
* Copyright (c) 2019 Udo Borkowski, ([email protected])
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.abego.guitesting.swing;
import org.abego.commons.blackboard.Blackboard;
import org.abego.commons.seq.Seq;
import org.abego.commons.timeout.Timeoutable;
import org.junit.jupiter.api.Assertions;
import java.awt.Component;
import java.awt.Window;
import java.util.Objects;
import java.util.function.Predicate;
import static org.abego.commons.lang.ThrowableUtil.messageOrClassName;
/**
* GT, the main interface for GUI testing.
*
*
* The GT interface provides access to most features of the GUITesting Swing
* library. The interface covers many areas related to GUI testing,
* like dealing with windows or components, using input devices like
* keyboard or mouse, checking test results with GUI specific
* "assert..." methods and many more.
*
* A typical code snippet using GT may look like this:
*
* import static org.abego.guitesting.swing.GuiTesting.newGT;
*
* ...
*
* // A GT instance is the main thing we need when testing GUI code.
* GT gt = newGT();
*
* // run some application code that opens a window
* openSampleWindow();
*
* // In that window we are interested in a JTextField named "input"
* JTextField input = gt.waitForComponentNamed(JTextField.class, "input");
*
* // we move the focus to that input field and type "Your name" ", please!"
* gt.setFocusOwner(input);
* gt.type("Your name");
* gt.type(", please!");
*
* // Verify if the text field really contains the expected text.
* gt.assertEqualsRetrying("Your name, please!", input::getText);
*
* // When we are done with our tests we can ask GT to cleanup
* // (This will dispose open windows etc.)
* gt.cleanup();
*
*
* Feature Areas and "...Support" interfaces
*
* GT is a quite large API with many methods for different GUI testing areas.
* To better manage this large feature set we have different
* "...Support" interfaces for each area, like {@link KeyboardSupport} or
* {@link WindowSupport}. GT gives access to these feature areas through
* methods starting with an underscore, like {@link #_keyboard()} or
* {@link #_window()}, e.g. with code like this:
*