Browse Source

test_Check initial state of the login GUI and added setUp() method to initiate GUI before tests are run

remotes/origin/server
Richard Schmidt 11 months ago
parent
commit
0e2453a1ce
  1. 19
      src/test/java/LoginGUITest.java

19
src/test/java/LoginGUITest.java

@ -1,8 +1,25 @@
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import java.awt.event.ActionEvent;
import org.junit.jupiter.api.BeforeEach;
class LoginGUITest {
private LoginGUI loginGUI;
@BeforeEach
public void setUp() {
loginGUI = new LoginGUI();
}
@Test
public void testInitialState() {
assertNotNull(loginGUI.getUsernameField());
assertNotNull(loginGUI.getPasswordField());
assertNotNull(loginGUI.getLoginButton());
assertNotNull(loginGUI.getStayLoggedInCheckbox());
assertNotNull(loginGUI.getSignUpButton());
}
@Test
public void testActionPerformed_LoginButton() {
@ -17,5 +34,7 @@ class LoginGUITest {
// Verify if login was successful
assertFalse(loginGUI.isVisible());
}
}
Loading…
Cancel
Save