Browse Source

refactoring: fixed some indentations and added / removed comments in LoginGUITest

remotes/origin/hotfix/client/improve-chat-window-appearence
Richard Schmidt 11 months ago
parent
commit
e6ee2634b9
  1. 17
      src/test/java/LoginGUITest.java

17
src/test/java/LoginGUITest.java

@ -12,6 +12,7 @@ class LoginGUITest {
loginGUI = new LoginGUI();
}
//Tests initial state of the GUI
@Test
public void testInitialState() {
assertNotNull(loginGUI.getUsernameField());
@ -21,6 +22,7 @@ class LoginGUITest {
assertNotNull(loginGUI.getSignUpButton());
}
//Tests the login button
@Test
public void testActionPerformed_LoginButton() {
LoginGUI loginGUI = new LoginGUI();
@ -28,25 +30,18 @@ class LoginGUITest {
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());
}
//Tests the check-box for staying logged in
@Test
public void testStayLoggedInCheckbox() {
// Initially, checkbox should be unchecked
assertFalse(loginGUI.getStayLoggedInCheckbox().isSelected());
assertFalse(loginGUI.getStayLoggedInCheckbox().isSelected());
// Simulate checking the checkbox
loginGUI.getStayLoggedInCheckbox().doClick();
loginGUI.getStayLoggedInCheckbox().doClick();
assertTrue(loginGUI.getStayLoggedInCheckbox().isSelected());
assertTrue(loginGUI.getStayLoggedInCheckbox().isSelected());
}
}
Loading…
Cancel
Save