Skip to content

Commit 4b64496

Browse files
committed
BrowserStack-only alignment: README/CLI updates; CI workflow to new CLI; YAML creds fallback in DriverFactory; remove frameworkOptions; docs cleanup; suite reference fixes
1 parent dbd08f9 commit 4b64496

16 files changed

Lines changed: 234 additions & 1849 deletions

.github/workflows/browserstack-sdk.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,14 @@ jobs:
138138
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
139139
run: |
140140
# Maven command structure:
141-
# -Pbrowserstack: Activates BrowserStack profile (adds SDK agent)
142-
# -Dbrowserstack.config: Specifies YAML config file with app ID and device list
141+
# -DsuiteXmlFile: TestNG suite file
142+
# -Dbrowserstack.config: YAML config file with app ID and device list
143143
# -Dplatform=android: Sets platform for DriverFactory
144-
# -Denv=browserstack: Triggers ConfigManager to use BrowserStack mode
145144
# -Dcucumber.filter.tags: Applies tag filters (@androidOnly, @smoke, etc.)
146145
mvn clean test \
147-
-Pbrowserstack \
146+
-DsuiteXmlFile=testngSuite.xml \
148147
-Dbrowserstack.config=browserstack-android-ci.yml \
149148
-Dplatform=android \
150-
-Denv=browserstack \
151149
-Dcucumber.filter.tags="${{ steps.tags.outputs.filter }}" \
152150
--no-transfer-progress \
153151
-q
@@ -235,10 +233,9 @@ jobs:
235233
# Same Maven structure as Android, but with iOS-specific config
236234
# browserstack-ios-ci.yml contains: iOS devices, automationName: XCUITest, app ID
237235
mvn clean test \
238-
-Pbrowserstack \
236+
-DsuiteXmlFile=testngSuite.xml \
239237
-Dbrowserstack.config=browserstack-ios-ci.yml \
240238
-Dplatform=ios \
241-
-Denv=browserstack \
242239
-Dcucumber.filter.tags="${{ steps.tags.outputs.filter }}" \
243240
--no-transfer-progress \
244241
-q

AI_Tutor.md

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,26 @@ Framework Overview:
2121
- Language: Java 21
2222
- Build Tool: Maven
2323
- Test Framework: TestNG + Cucumber BDD
24-
- Mobile Automation: Appium (Android & iOS)
24+
- Mobile Automation: Appium (Android & iOS) on BrowserStack cloud (SDK-managed capabilities)
2525
- Reporting: Extent Reports + Cucumber HTML Reports
2626
- Design Patterns: Page Object Model, Factory Pattern, Singleton, ThreadLocal
27+
- Config: BrowserStack YAML (`browserstack-*.yml`) with `frameworkOptions` for waits; no local properties
2728
- CI/CD: GitHub Actions, Azure DevOps, Docker
2829
29-
Project Structure (Maven Standard Layout):
30+
Project Structure (BrowserStack-only):
3031
src/
31-
├── main/java/ # Framework Library
32+
├── main/java/
3233
│ └── com/automation/framework/
33-
│ ├── core/
34-
│ │ ├── ConfigManager.java # Multi-environment configuration
35-
│ │ ├── DriverFactory.java # Platform-specific driver creation
36-
│ │ └── DriverManager.java # Thread-safe driver management
37-
│ ├── pages/
38-
│ │ ├── BasePage.java # Base class for all page objects
39-
│ │ ├── locators/
40-
│ │ │ └── WdioLocators.java # Centralized locator constants
41-
│ │ └── screens/
42-
│ │ └── LoginScreen.java # Page object implementation
43-
│ └── reports/
44-
│ └── ExtentReportManager.java # Extent Reports management
45-
46-
├── main/resources/
47-
│ ├── config.properties # Base configuration
48-
│ ├── config-local.properties # Local environment overrides
49-
│ ├── config-staging.properties # Staging environment
50-
│ ├── config-prod.properties # Production environment
51-
│ └── logback.xml # Logging configuration
52-
53-
├── test/java/ # Test Code
54-
│ ├── listeners/
55-
│ │ ├── ExtentReportListener.java # Report lifecycle
56-
│ │ ├── RetryAnalyzer.java # Retry failed tests
57-
│ │ └── RetryTransformer.java # Auto-apply retry
58-
│ ├── runner/
59-
│ │ └── TestNgRunner.java # Cucumber-TestNG runner
60-
│ └── stepdefinitions/
61-
│ ├── Hooks.java # Cucumber hooks
62-
│ └── WdioLoginSteps.java # Step definitions
63-
64-
└── test/resources/
65-
└── features/
66-
└── wdioLogin.feature # BDD feature files
34+
│ ├── core/ (ConfigManager – YAML loader, DriverFactory – BrowserStack SDK, DriverManager – ThreadLocal, FrameworkConstants – minimal)
35+
│ ├── pages/ (BasePage, PageObjectManager, locators, screens)
36+
│ └── reports/ExtentReportManager
37+
├── main/resources/ (extent-config.xml, logback.xml)
38+
├── test/java/ (listeners, runner, stepdefinitions)
39+
└── test/resources/features/
40+
41+
TestNG Suite: `testngSuite.xml` (was testngParallel.xml)
42+
43+
Root YAML: browserstack-android*.yml, browserstack-ios*.yml with `frameworkOptions` for waits.
6744
6845
Teaching Objectives - Cover these topics in order:
6946
@@ -172,8 +149,8 @@ Driver Layer → "Kitchen Equipment" (actual tools)
172149
173150
**3. SMART DESIGN #1: Factory Pattern (DriverFactory)**
174151
- Analogy: A car factory that builds different car models (Android/iOS) from the same blueprint
175-
- Why it's smart: One method createDriver() handles both platforms
176-
- The atomic port counter trick for parallel execution
152+
- Why it's smart: One method createDriver() handles both platforms (BrowserStack-only)
153+
- BrowserStack SDK injects capabilities from YAML; code stays minimal
177154
178155
**4. SMART DESIGN #2: Singleton Pattern (ConfigManager)**
179156
- Analogy: A library with ONE master catalog that everyone shares
@@ -183,7 +160,7 @@ Driver Layer → "Kitchen Equipment" (actual tools)
183160
**5. SMART DESIGN #3: Thread-Local Pattern (DriverManager)**
184161
- Analogy: A gym where each person gets their own locker
185162
- Why it's smart: Parallel tests don't fight over the same driver
186-
- How ThreadLocal gives each test its own isolated driver
163+
- ThreadLocal gives each test its own isolated driver; cleanup in Hooks
187164
188165
**6. SMART DESIGN #4: Page Object Model**
189166
- Analogy: A recipe book - change recipe once, all dishes update
@@ -211,8 +188,8 @@ Feature → Runner → Hooks(@Before) → StepDef → PageObject → Driver →
211188
**9. WHY THIS IS PRODUCTION-READY**
212189
Explain these enterprise features simply:
213190
- Retry mechanism for flaky mobile tests
214-
- Multi-environment config (local/staging/prod)
215-
- Parallel execution support
191+
- BrowserStack YAML config with SDK-managed capabilities; waits via `frameworkOptions`
192+
- Parallel execution support (ThreadLocal drivers)
216193
- Detailed HTML reports with screenshots
217194
- CI/CD ready (GitHub Actions, Azure DevOps)
218195

0 commit comments

Comments
 (0)