Skip to content

add dynaconf configuration #2

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

Merged
merged 1 commit into from
Feb 28, 2025
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
15 changes: 8 additions & 7 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

settings = Dynaconf(
settings_files=[
"settings/settings.yaml", # Default settings
"settings/stage.yaml", # Development-specific settings
"settings/prod.yaml", # Production-specific settings
"settings/.secrets.yaml", # Sensitive data
"config/settings.yaml", # Default settings
"config/.secrets.yaml", # Sensitive data
],
environments=True,
load_dotenv=True,
envvar_prefix="PW",
env_switcher="ENV_FOR_PW",
dotenv_path="configs/.env",
envvar_prefix="APPIUM",
env_switcher="ENV_FOR_APPIUM",
dotenv_path="configs/.env", # Enable env switcher
)


print(settings.APPIUM_SERVER)
1 change: 1 addition & 0 deletions config/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENV_FOR_APPIUM=stage
File renamed without changes.
16 changes: 16 additions & 0 deletions config/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default:
APPIUM_SERVER: "http://localhost:4723/wd/hub"

stage:
APPIUM_SERVER: "http://stage:4723/wd/hub"
ANDROID_CAPS:
platformName: "Android"
deviceName: "emulator"
app: "/path/to/app.apk"

prod:
APPIUM_SERVER: "http://prod:4723/wd/hub"
IOS_CAPS:
platformName: "iOS"
deviceName: "iPhone 14"
bundleId: "com.example.app"
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ authors = ["Dmytro Berezovskyi <[email protected]>"]

packages = [
{ include = "src" },
{ include = "settings" },
{ include = "drivers", from = "src" },
{ include = "screens", from = "src" },
{ include = "utils", from = "src" }
Expand Down
Empty file removed settings/__init__.py
Empty file.
Empty file removed settings/settings.yaml
Empty file.
5 changes: 5 additions & 0 deletions src/drivers/driver_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Driver:

@staticmethod
def get_driver(platform: str):
"""Get driver by platform"""
2 changes: 2 additions & 0 deletions src/screens/base_screen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Screen:
pass
Loading