Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the maximum performance mode with and without the headless execution #242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: docker ps
- name: Run all tests
continue-on-error: true
run: mvn test -DexecutionAddress="localhost:4444" -DtargetOperatingSystem="Linux-64" -DmaximumPerformanceMode="true" -DtargetBrowserName="GoogleChrome" -Dtest="!%regex[.*checksum.*], !%regex[.*cucumber.*], !%regex[.*sikulix.*], !%regex[.*imageComparison.*], !%regex[.*FileActions.*], !%regex[.*TerminalActions.*], !%regex[.*localShell.*], !%regex[.*fullPageScreenshotWithHeader.*], !%regex[.*dbConnection.*], !%regex[.*Appium.*]"
run: mvn test -DexecutionAddress="localhost:4444" -DtargetOperatingSystem="Linux-64" -DmaximumPerformanceMode="2" -DtargetBrowserName="GoogleChrome" -Dtest="!%regex[.*checksum.*], !%regex[.*cucumber.*], !%regex[.*sikulix.*], !%regex[.*imageComparison.*], !%regex[.*FileActions.*], !%regex[.*TerminalActions.*], !%regex[.*localShell.*], !%regex[.*fullPageScreenshotWithHeader.*], !%regex[.*dbConnection.*], !%regex[.*Appium.*]"
- name: Generate Allure Report with history
uses: simple-elf/[email protected]
with:
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/com/shaft/tools/io/PropertyFileManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.shaft.tools.io;

import com.shaft.cli.FileActions;
import com.shaft.validation.Assertions;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.SystemUtils;

Expand Down Expand Up @@ -136,10 +137,10 @@ public static String getDefaultPropertiesFolderPath() {
* </ul>
*/
private static void manageMaximumPerformanceMode() {
if (Boolean.TRUE.equals(Boolean.valueOf(System.getProperty("maximumPerformanceMode")))) {
String maximumPerformanceMode = System.getProperty("maximumPerformanceMode");
if (!maximumPerformanceMode.equals("0")) {
// Beast Mode On
System.setProperty("aiPoweredSelfHealingElementIdentification", String.valueOf(false));
System.setProperty("headlessExecution", String.valueOf(true));
System.setProperty("autoMaximizeBrowserWindow", String.valueOf(true));
System.setProperty("forceCheckForElementVisibility", String.valueOf(false));
System.setProperty("forceCheckElementLocatorIsUnique", String.valueOf(false));
Expand All @@ -151,8 +152,15 @@ private static void manageMaximumPerformanceMode() {
System.setProperty("createAnimatedGif", String.valueOf(false));
System.setProperty("recordVideo", String.valueOf(false));
System.setProperty("debugMode", String.valueOf(false));
switch (maximumPerformanceMode) {
case ("1") -> System.setProperty("headlessExecution", String.valueOf(false));
case ("2") -> System.setProperty("headlessExecution", String.valueOf(true));
default -> {
ReportManager.log("Unexpected maximumPerformanceMode Property value: " + maximumPerformanceMode);
Assertions.assertFail("Unexpected maximumPerformanceMode Property value: " + maximumPerformanceMode);
}
}
}

}

private static void loadPropertiesFileIntoSystemProperties(Properties properties, File propertyFile) {
Expand Down
13 changes: 10 additions & 3 deletions src/main/javadoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,22 @@ <h1>Configuration Manager</h1>
<div class="radio-inline">
<label for="maximumPerformanceMode-0">
<input id="maximumPerformanceMode-0"
name="maximumPerformanceMode" type="radio" value="true">
Enabled
name="maximumPerformanceMode" type="radio" value="0">
Disabled
</label>
</div>
<div class="radio-inline">
<label for="maximumPerformanceMode-1">
<input checked="checked" id="maximumPerformanceMode-1"
name="maximumPerformanceMode"
type="radio" value="false"> Disabled
type="radio" value="1"> Without Headless Execution
</label>
</div>
<div class="radio-inline">
<label for="maximumPerformanceMode-2">
<input checked="checked" id="maximumPerformanceMode-2"
name="maximumPerformanceMode"
type="radio" value="2"> With Headless Execution
</label>
</div>
<span class="help-block">• <b>ExperimentalFeature* </b>Enabling maximumPerformanceMode will disable all complementary features to ensure the fastest execution possible with a 400% calculated performance boost.</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ autoMaximizeBrowserWindow=true
forceCheckForElementVisibility=true
forceCheckElementLocatorIsUnique=true
forceCheckTextWasTypedCorrectly=true
maximumPerformanceMode=false
maximumPerformanceMode=0
skipTestsWithLinkedIssues=false
aiPoweredSelfHealingElementIdentification=false
###################################################
Expand Down