|
|
@ -0,0 +1,21 @@ |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
class LoginGUITest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testActionPerformed_LoginButton() { |
|
|
|
LoginGUI loginGUI = new LoginGUI(); |
|
|
|
loginGUI.getUsernameField().setText("testUser"); |
|
|
|
loginGUI.getPasswordField().setText("testPassword"); |
|
|
|
loginGUI.getStayLoggedInCheckbox().setSelected(true); |
|
|
|
|
|
|
|
// Simulate action performed event on login button |
|
|
|
loginGUI.actionPerformed(new ActionEvent(loginGUI.getLoginButton(), ActionEvent.ACTION_PERFORMED, null)); |
|
|
|
|
|
|
|
// Verify if login was successful |
|
|
|
assertFalse(loginGUI.isVisible()); |
|
|
|
} |
|
|
|
|
|
|
|
} |