-
Notifications
You must be signed in to change notification settings - Fork 0
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
Aleksandr_Vorobev
committed
Jan 18, 2024
1 parent
3709a64
commit 9e32e7b
Showing
5 changed files
with
52 additions
and
6 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
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,39 @@ | ||
package configuration; | ||
|
||
import static java.lang.Boolean.parseBoolean; | ||
|
||
public class Configuration { | ||
private static final Configuration INSTANCE = new Configuration(); | ||
|
||
private final String baseUrl; | ||
private final String browser; | ||
private final boolean headless; | ||
|
||
private Configuration() { | ||
// Initialize configuration properties | ||
this.baseUrl = getProperty("base.url", "https://example.com"); | ||
this.browser = getProperty("browser", "chrome"); | ||
this.headless = parseBoolean(getProperty("headless", "true")); | ||
} | ||
|
||
public static Configuration getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public String getBaseUrl() { | ||
return baseUrl; | ||
} | ||
|
||
public String getBrowser() { | ||
return browser; | ||
} | ||
|
||
public boolean isHeadless() { | ||
return headless; | ||
} | ||
|
||
private String getProperty(String propertyName, String defaultValue) { | ||
return System.getProperty(propertyName, defaultValue); | ||
} | ||
} | ||
|
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