-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring to be able to close the browser earlier #3622
- add a ScriptLoginResult which contains all the session data - update the current script login to use the ScriptLoginResult - update and extend testcases
- Loading branch information
Showing
9 changed files
with
279 additions
and
152 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...sp-zap/src/main/java/com/mercedesbenz/sechub/zapwrapper/scan/login/ScriptLoginResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
package com.mercedesbenz.sechub.zapwrapper.scan.login; | ||
|
||
import java.util.*; | ||
|
||
import org.openqa.selenium.Cookie; | ||
|
||
public class ScriptLoginResult { | ||
|
||
private Set<Cookie> sessionCookies; | ||
private Map<String, String> localStorage; | ||
private Map<String, String> sessionStorage; | ||
|
||
private boolean loginFailed; | ||
|
||
public ScriptLoginResult() { | ||
this.sessionCookies = new HashSet<>(); | ||
this.localStorage = new HashMap<>(); | ||
this.sessionStorage = new HashMap<>(); | ||
} | ||
|
||
public Set<Cookie> getSessionCookies() { | ||
return Collections.unmodifiableSet(sessionCookies); | ||
} | ||
|
||
public void setSessionCookies(Set<Cookie> sessionCookies) { | ||
if (sessionCookies != null) { | ||
this.sessionCookies = sessionCookies; | ||
} | ||
} | ||
|
||
public Map<String, String> getLocalStorage() { | ||
return Collections.unmodifiableMap(localStorage); | ||
} | ||
|
||
public void setLocalStorage(Map<String, String> localStorage) { | ||
if (localStorage != null) { | ||
this.localStorage = localStorage; | ||
} | ||
} | ||
|
||
public Map<String, String> getSessionStorage() { | ||
return Collections.unmodifiableMap(sessionStorage); | ||
} | ||
|
||
public void setSessionStorage(Map<String, String> sessionStorage) { | ||
if (sessionStorage != null) { | ||
this.sessionStorage = sessionStorage; | ||
} | ||
} | ||
|
||
public boolean isLoginFailed() { | ||
return loginFailed; | ||
} | ||
|
||
public void setLoginFailed(boolean loginFailed) { | ||
this.loginFailed = loginFailed; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.