-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
878 additions
and
68 deletions.
There are no files selected for viewing
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
64 changes: 61 additions & 3 deletions
64
...gency/src/test/java/com/hack23/cia/systemintegrationtest/suites/IntegrationTestSuite.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 |
---|---|---|
@@ -1,24 +1,82 @@ | ||
package com.hack23.cia.systemintegrationtest.suites; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Suite; | ||
|
||
import com.hack23.cia.systemintegrationtest.CitizenIntelligenceAgencyServer; | ||
import com.hack23.cia.systemintegrationtest.admin.configuration.AdminConfigurationTest; | ||
import com.hack23.cia.systemintegrationtest.admin.data.AdminDataTest; | ||
import com.hack23.cia.systemintegrationtest.admin.operations.AdminOperationsTest; | ||
import com.hack23.cia.systemintegrationtest.admin.security.AdminSecurityTest; | ||
import com.hack23.cia.systemintegrationtest.user.home.UserHomeTest; | ||
|
||
import io.github.bonigarcia.wdm.WebDriverManager; | ||
import io.github.bonigarcia.wdm.config.DriverManagerType; | ||
|
||
/** | ||
* The Class IntegrationTestSuite. | ||
*/ | ||
@RunWith(Suite.class) | ||
@Suite.SuiteClasses({ | ||
// Admin Tests only - remove other test references that don't exist | ||
AdminConfigurationTest.class, | ||
AdminDataTest.class, | ||
AdminOperationsTest.class, | ||
AdminSecurityTest.class | ||
AdminSecurityTest.class, | ||
UserHomeTest.class | ||
}) | ||
public class IntegrationTestSuite { | ||
// Empty test suite | ||
|
||
protected static final boolean usingExternalServer; | ||
|
||
/** The webdriver setup. */ | ||
private static boolean webdriverSetup = false; | ||
|
||
/** The Constant webDriverMap. */ | ||
static { | ||
final String systemTestTargetUrlProperty = System.getProperty("system.test.target.url"); | ||
if (systemTestTargetUrlProperty != null && systemTestTargetUrlProperty.isEmpty()) { | ||
usingExternalServer = true; | ||
} else { | ||
usingExternalServer = false; | ||
} | ||
|
||
|
||
|
||
CitizenIntelligenceAgencyServer.setEnv("CIA_APP_ENCRYPTION_PASSWORD", "allhaildiscordia"); | ||
} | ||
|
||
/** | ||
* Start server. | ||
* | ||
* @throws Exception | ||
* the exception | ||
*/ | ||
@BeforeClass | ||
public static final synchronized void startServer() throws Exception { | ||
if (!usingExternalServer) { | ||
CitizenIntelligenceAgencyServer.startTestServer(); | ||
} | ||
if(!webdriverSetup) { | ||
WebDriverManager.getInstance(DriverManagerType.CHROME).setup(); | ||
webdriverSetup=true; | ||
} | ||
} | ||
|
||
/** | ||
* Stop server. | ||
* | ||
* @throws Exception | ||
* the exception | ||
*/ | ||
@AfterClass | ||
public static final synchronized void stopServer() throws Exception { | ||
if (!usingExternalServer) { | ||
CitizenIntelligenceAgencyServer.stopTestServer(); | ||
} | ||
} | ||
|
||
|
||
|
||
} |
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.