mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 09:11:02 +00:00
solving the issue with UI tests sporadically failing due to authorization issues; the problem was that a request for Login.html also creates a session asynchronously, causing a race condition
This commit is contained in:
1 parent
c260ca8f73
commit
aaf49f9302
1 file changed
+7
-2
+7
-2
@@ -31,7 +31,12 @@ import com.sap.sailing.selenium.core.Managed;
|
||||
import com.sap.sailing.selenium.core.SeleniumRunner;
|
||||
import com.sap.sailing.selenium.core.TestEnvironment;
|
||||
import com.sap.sailing.selenium.core.WindowManager;
|
||||
<<<<<<< Updated upstream
|
||||
import com.sap.sailing.selenium.pages.HostPage;
|
||||
=======
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
/**
|
||||
* <p>Abstract base class for unit tests with Selenium. This class is already annotated as required to get executed
|
||||
@@ -86,10 +91,10 @@ public abstract class AbstractSeleniumTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUpAuthenticatedSession() {
|
||||
public void setUpAuthenticatedSession() throws InterruptedException {
|
||||
logger.info("Authenticating session...");
|
||||
Cookie sessionCookie = authenticate(getContextRoot());
|
||||
getWebDriver().get(getContextRoot() + "security/ui/Login.html?" + HostPage.getGWTCodeServer()); // initialize web driver so setting a cookie for the local domain is possible
|
||||
getWebDriver().get(getContextRoot() + "index.html"); // initialize web driver so setting a cookie for the local domain is possible
|
||||
getWebDriver().manage().addCookie(sessionCookie);
|
||||
logger.info("...obtained session cookie "+sessionCookie);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user