Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrhman-Ellithy committed Dec 12, 2024
1 parent a7048c9 commit 8907de4
Show file tree
Hide file tree
Showing 17 changed files with 1,225 additions and 226 deletions.
1,260 changes: 1,122 additions & 138 deletions Test-Output/Logs/Test.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Test-Output/UpdateChecker/checker.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"LastRunDate": "2024-12-11"
"LastRunDate": "2024-12-12"
}
2 changes: 1 addition & 1 deletion TestNGRunner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- </test>-->
<test name="Web UI Test Chrome">
<classes>
<class name="Tests.loginTestsRemote"/>
<class name="Tests.loginTests"/>
</classes>
</test>
<!-- <test name="ِDatabase Test">-->
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/Ellithium/config/managment/ConfigContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public class ConfigContext {
static {
// DriverType to String mapping
DRIVER_TYPE_STRING_MAP = Map.ofEntries(
Map.entry(DriverType.Chrome, "Chrome"),
Map.entry(DriverType.Edge, "Edge"),
Map.entry(DriverType.Safari, "Safari"),
Map.entry(DriverType.FireFox, "Firefox"),
Map.entry(DriverType.REMOTE_Chrome, "Remote Chrome"),
Map.entry(DriverType.REMOTE_Edge, "Remote Edge"),
Map.entry(DriverType.REMOTE_Safari, "Remote Safari"),
Map.entry(DriverType.REMOTE_FireFox, "Remote Firefox"),
Map.entry(DriverType.Android, "Android"),
Map.entry(DriverType.IOS, "iOS")
Map.entry(LocalDriverType.Chrome, "Chrome"),
Map.entry(LocalDriverType.Edge, "Edge"),
Map.entry(LocalDriverType.Safari, "Safari"),
Map.entry(LocalDriverType.FireFox, "Firefox"),
Map.entry(RemoteDriverType.REMOTE_Chrome, "Remote Chrome"),
Map.entry(RemoteDriverType.REMOTE_Edge, "Remote Edge"),
Map.entry(RemoteDriverType.REMOTE_Safari, "Remote Safari"),
Map.entry(RemoteDriverType.REMOTE_FireFox, "Remote Firefox"),
Map.entry(MobileDriverType.Android, "Android"),
Map.entry(MobileDriverType.IOS, "iOS")
);
// HeadlessMode to String mapping
HEADLESS_MODE_STRING_MAP = Map.ofEntries(
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/Ellithium/config/managment/GeneralHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import Ellithium.Utilities.interactions.WaitManager;
import Ellithium.config.Internal.APIFilterHelper;
import Ellithium.config.Internal.VersionChecker;
import Ellithium.core.driver.DriverFactory;
import Ellithium.core.driver.DriverType;
import Ellithium.core.driver.*;
import Ellithium.core.execution.Analyzer.RetryAnalyzer;
import Ellithium.core.logging.LogLevel;
import Ellithium.core.logging.Logger;
Expand Down Expand Up @@ -70,14 +69,14 @@ public static List<Parameter> getParameters(){
List<io.qameta.allure.model.Parameter>parameters=new ArrayList<>();
DriverType type=ConfigContext.getDriverType();
parameters.add(new io.qameta.allure.model.Parameter().setName("DriverType").setValue(ConfigContext.getValue(type)));
if(type== DriverType.Chrome||type== DriverType.Safari||type== DriverType.FireFox||type== DriverType.Edge||type==DriverType.REMOTE_Chrome||type==DriverType.REMOTE_Edge||type==DriverType.REMOTE_FireFox||type==DriverType.REMOTE_Safari){
if(type instanceof LocalDriverType || type instanceof RemoteDriverType){
parameters.add(new io.qameta.allure.model.Parameter().setName("HeadlessMode").setValue(ConfigContext.getValue(ConfigContext.getHeadlessMode())));
parameters.add(new io.qameta.allure.model.Parameter().setName("PageLoadStrategyMode").setValue(ConfigContext.getValue(ConfigContext.getPageLoadStrategy())));
parameters.add(new io.qameta.allure.model.Parameter().setName("PrivateMode").setValue(ConfigContext.getValue(ConfigContext.getPrivateMode())));
parameters.add(new io.qameta.allure.model.Parameter().setName("SandboxMode").setValue(ConfigContext.getValue(ConfigContext.getSandboxMode())));
parameters.add(new io.qameta.allure.model.Parameter().setName("WebSecurityMode").setValue(ConfigContext.getValue(ConfigContext.getWebSecurityMode())));
}
if(type==DriverType.REMOTE_Chrome||type==DriverType.REMOTE_Edge||type==DriverType.REMOTE_FireFox||type==DriverType.REMOTE_Safari||type==DriverType.Android||type==DriverType.IOS){
if(type instanceof RemoteDriverType ||type instanceof MobileDriverType){
parameters.add(new io.qameta.allure.model.Parameter().setName("Remote Address").setValue(ConfigContext.getRemoteAddress().toString()));
parameters.add(new io.qameta.allure.model.Parameter().setName("Capabilities").setValue(ConfigContext.getCapabilities().toString()));
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/Ellithium/core/driver/BrowserSetUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public class BrowserSetUp {
// Private method to configure browser options and return the WebDriver instance
public static WebDriver setupLocalDriver(DriverType driverType, HeadlessMode headlessMode, PageLoadStrategyMode pageLoadStrategy, PrivateMode privateMode, SandboxMode sandboxMode, WebSecurityMode webSecurityMode) {
switch (driverType) {
case Chrome:
case LocalDriverType.Chrome:
ChromeOptions chromeOptions = configureChromeOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
return new ChromeDriver(chromeOptions);
case FireFox:
case LocalDriverType.FireFox:
FirefoxOptions firefoxOptions = configureFirefoxOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
return new FirefoxDriver(firefoxOptions);
case Edge:
case LocalDriverType.Edge:
EdgeOptions edgeOptions = configureEdgeOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
return new EdgeDriver(edgeOptions);
case Safari:
case LocalDriverType.Safari:
SafariOptions safariOptions = configureSafariOptions(pageLoadStrategy, privateMode);
return new SafariDriver(safariOptions);
default:
Expand All @@ -41,22 +41,22 @@ public static WebDriver setupLocalDriver(DriverType driverType, HeadlessMode hea
public static RemoteWebDriver setupRemoteDriver(DriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PageLoadStrategyMode pageLoadStrategy, PrivateMode privateMode, SandboxMode sandboxMode, WebSecurityMode webSecurityMode) {
RemoteWebDriver driver;
switch (driverType) {
case REMOTE_Chrome->{
case RemoteDriverType.REMOTE_Chrome->{
ChromeOptions chromeOptions = configureChromeOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
capabilities.merge(chromeOptions);
driver= new RemoteWebDriver(remoteAddress,capabilities);
}
case REMOTE_FireFox ->{
case RemoteDriverType.REMOTE_FireFox ->{
FirefoxOptions firefoxOptions = configureFirefoxOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
capabilities.merge(firefoxOptions);
driver= new RemoteWebDriver(remoteAddress,capabilities);
}
case REMOTE_Edge ->{
case RemoteDriverType.REMOTE_Edge ->{
EdgeOptions edgeOptions = configureEdgeOptions(headlessMode, pageLoadStrategy, privateMode, sandboxMode, webSecurityMode);
capabilities.merge(edgeOptions);
driver= new RemoteWebDriver(remoteAddress,edgeOptions);
}
case REMOTE_Safari ->{
case RemoteDriverType.REMOTE_Safari ->{
SafariOptions safariOptions = configureSafariOptions(pageLoadStrategy, privateMode);
capabilities.merge(safariOptions);
driver= new RemoteWebDriver(remoteAddress,safariOptions);
Expand Down
Loading

0 comments on commit 8907de4

Please sign in to comment.