-
Notifications
You must be signed in to change notification settings - Fork 3
Turbo test guide #397
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
base: main
Are you sure you want to change the base?
Turbo test guide #397
Conversation
WalkthroughThis pull request adds comprehensive documentation for Appium Turbo test execution with example code for Android and iOS, introduces an API base URL obtainment guide, updates profile management documentation, and adds corresponding navigation links. All changes are documentation-focused with no code modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
docs/modules/profile/images/api-base-url.pngis excluded by!**/*.pngdocs/modules/profile/images/help-portal-api.pngis excluded by!**/*.png
📒 Files selected for processing (6)
docs/modules/automation-testing/nav.adoc(1 hunks)docs/modules/automation-testing/pages/turbo-test-execution/run-appium-test.adoc(1 hunks)docs/modules/automation-testing/pages/turbo-test-execution/run-game-driver-test.adoc(1 hunks)docs/modules/profile/pages/manage-your-api-credentials.adoc(3 hunks)docs/modules/profile/pages/manage-your-profile.adoc(1 hunks)docs/modules/profile/partials/obtain-api-base-url.adoc(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: publish-docs-test
🔇 Additional comments (13)
docs/modules/automation-testing/pages/turbo-test-execution/run-game-driver-test.adoc (1)
1-2: LGTM!The title simplification maintains consistency with the related Appium turbo test documentation while keeping it concise.
docs/modules/profile/pages/manage-your-profile.adoc (1)
18-31: LGTM!The new "View your username and email" section clearly communicates that these fields are non-editable, providing helpful context before users attempt modifications. The alt text appropriately distinguishes the same image's use across different sections.
docs/modules/automation-testing/nav.adoc (1)
43-45: LGTM!The new navigation entry correctly links to the Appium Turbo Test guide and is properly positioned alongside the GameDriver documentation within the Turbo Test Execution section.
docs/modules/profile/partials/obtain-api-base-url.adoc (2)
1-1: Verify AsciiDoc comment syntax.The comment at line 1 uses C-style comment syntax (
//) which is valid in AsciiDoc for single-line comments, but verify this is the convention used elsewhere in the partial files of this documentation project to maintain consistency.
3-9: LGTM!The guidance is clear and well-structured. The two-step process (navigate to Help > API, then locate Base URL) provides sufficient context for users to find the required information. Image references are properly formatted.
docs/modules/profile/pages/manage-your-api-credentials.adoc (3)
6-9: LGTM!The new "Obtain the API base URL" section properly includes the reusable partial and is logically positioned before the existing credentials sections. The section anchor follows AsciiDoc naming conventions.
21-24: LGTM!The rename to "Get the Appium server URL" with clarified copy improves documentation clarity by explicitly stating this URL is for Appium automation. The anchor ID change is consistent with the new heading.
45-45: LGTM!The updated alt text accurately describes the image content and improves accessibility.
docs/modules/automation-testing/pages/turbo-test-execution/run-appium-test.adoc (5)
1-66: LGTM!The introduction and prerequisites sections are well-structured. The beta notice is appropriately prominent, and the cross-references to related profile documentation are properly formatted.
69-134: LGTM!The environment variables table is comprehensive and clearly documents all required and optional variables, their purposes, and behavior when omitted. The mapping to Appium capabilities is helpful for developers.
335-447: LGTM!The packaging, upload, and API execution sections are well-structured with clear instructions for both portal and API-based approaches. The curl examples are properly formatted and the request/response documentation is comprehensive.
448-636: LGTM!The parameter reference sections are thorough and well-organized. The authentication, request, and response parameters are clearly documented with examples and descriptions for both execution modes.
637-742: LGTM!The download and demo sections provide practical guidance for retrieving test results and running sample tests. The limitation is appropriately noted at the end.
| String kobitonUrl = System.getenv("KOBITON_URL"); | ||
| String udid = System.getenv("KOBITON_UDID"); | ||
| String kobitonSession = System.getenv("KOBITON_SESSION"); | ||
| String kobitonUsername = System.getenv("KOBITON_USERNAME"); | ||
| String kobitonApiKey = System.getenv("KOBITON_APIKEY"); | ||
|
|
||
| // Optional environment variables | ||
| String app = System.getenv("KOBITON_APP"); | ||
| String sessionName = System.getenv("KOBITON_SESSION_NAME"); | ||
| String sessionDescription = System.getenv("KOBITON_SESSION_DESCRIPTION"); | ||
| String kobitonRuntime = System.getenv("KOBITON_RUNTIME"); | ||
|
|
||
| // Validate env vars | ||
| if (webdriverUrl == null || kobitonSession == null || udid == null || | ||
| webdriverUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) { | ||
| System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_WEBDRIVER_URL, or KOBITON_SESSION"); | ||
| return; | ||
| } | ||
|
|
||
| // Provide default values for optional env vars if null or empty | ||
| if (app == null || app.isEmpty()) { | ||
| app = "https://example.com/downloads/sample.apk"; | ||
| } | ||
|
|
||
| if (sessionName == null || sessionName.isEmpty()) { | ||
| sessionName = "A Turbo Test session for Android"; | ||
| } | ||
|
|
||
| if (sessionDescription == null || kobitonUsername.isEmpty()) { | ||
| sessionDescription = "A sample Turbo Test session for Android"; | ||
| } | ||
|
|
||
| // Capabilities | ||
| DesiredCapabilities caps = new DesiredCapabilities(); | ||
| caps.setCapability("kobiton:sessionName", sessionName); | ||
| caps.setCapability("kobiton:sessionDescription", sessionDescription); | ||
| caps.setCapability("appium:udid", udid); | ||
| caps.setCapability("appium:app", app); | ||
| caps.setCapability("appium:automationName", "UIAutomator2"); | ||
| caps.setCapability("kobiton:session", kobitonSession); | ||
| caps.setCapability("appium:username", kobitonUsername); | ||
| caps.setCapability("appium:accessKey", kobitonApiKey); | ||
| caps.setCapability("kobiton:runtime", kobitonRuntime); | ||
|
|
||
| // Initialize driver | ||
| AndroidDriver driver = new AndroidDriver(new URI(kobitonBaseUrl).toURL(), caps); | ||
|
|
||
| // Save page source | ||
| Files.writeString(Path.of("output/page_source.xml"), driver.getPageSource()); | ||
|
|
||
| // Screenshot | ||
| File shot = driver.getScreenshotAs(OutputType.FILE); | ||
| Files.copy(shot.toPath(), Path.of("output/screenshot.png"), StandardCopyOption.REPLACE_EXISTING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix variable naming inconsistencies in the Android example.
The code has several critical variable naming errors that would cause runtime failures:
- Line 189-191: Validation checks undefined variable
webdriverUrlinstead ofkobitonUrl(defined at line 176) - Line 191: Error message references non-existent env var
KOBITON_WEBDRIVER_URLinstead ofKOBITON_URL - Line 204: Logic error checks
kobitonUsername.isEmpty()when it should checksessionDescription == null || sessionDescription.isEmpty() - Line 221: References undefined variable
kobitonBaseUrlinstead ofkobitonUrl
Additionally, driver.quit() is called twice (lines 231 and 234), which is redundant.
🔎 Proposed fixes for Android example
// Required environment variables
String kobitonUrl = System.getenv("KOBITON_URL");
String udid = System.getenv("KOBITON_UDID");
String kobitonSession = System.getenv("KOBITON_SESSION");
String kobitonUsername = System.getenv("KOBITON_USERNAME");
String kobitonApiKey = System.getenv("KOBITON_APIKEY");
// Optional environment variables
String app = System.getenv("KOBITON_APP");
String sessionName = System.getenv("KOBITON_SESSION_NAME");
String sessionDescription = System.getenv("KOBITON_SESSION_DESCRIPTION");
String kobitonRuntime = System.getenv("KOBITON_RUNTIME");
// Validate env vars
- if (webdriverUrl == null || kobitonSession == null || udid == null ||
- webdriverUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) {
- System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_WEBDRIVER_URL, or KOBITON_SESSION");
+ if (kobitonUrl == null || kobitonSession == null || udid == null ||
+ kobitonUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) {
+ System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_URL, or KOBITON_SESSION");
return;
}
// Provide default values for optional env vars if null or empty
if (app == null || app.isEmpty()) {
app = "https://example.com/downloads/sample.apk";
}
if (sessionName == null || sessionName.isEmpty()) {
sessionName = "A Turbo Test session for Android";
}
- if (sessionDescription == null || kobitonUsername.isEmpty()) {
+ if (sessionDescription == null || sessionDescription.isEmpty()) {
sessionDescription = "A sample Turbo Test session for Android";
}
// Capabilities
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("kobiton:sessionName", sessionName);
caps.setCapability("kobiton:sessionDescription", sessionDescription);
caps.setCapability("appium:udid", udid);
caps.setCapability("appium:app", app);
caps.setCapability("appium:automationName", "UIAutomator2");
caps.setCapability("kobiton:session", kobitonSession);
caps.setCapability("appium:username", kobitonUsername);
caps.setCapability("appium:accessKey", kobitonApiKey);
caps.setCapability("kobiton:runtime", kobitonRuntime);
// Initialize driver
- AndroidDriver driver = new AndroidDriver(new URI(kobitonBaseUrl).toURL(), caps);
+ AndroidDriver driver = new AndroidDriver(new URI(kobitonUrl).toURL(), caps);
// Save page source
Files.writeString(Path.of("output/page_source.xml"), driver.getPageSource());
// Screenshot
File shot = driver.getScreenshotAs(OutputType.FILE);
Files.copy(shot.toPath(), Path.of("output/screenshot.png"), StandardCopyOption.REPLACE_EXISTING);
log.write("Screenshot saved\n");
driver.quit();
log.write("Completed successfully at " + LocalDateTime.now() + "\n");
-
- driver.quit();Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
docs/modules/automation-testing/pages/turbo-test-execution/run-appium-test.adoc
around lines 176-228, fix variable naming and a redundant quit: in the env
validation replace webdriverUrl with kobitonUrl and update the error message to
mention KOBITON_URL; change the sessionDescription check to verify
sessionDescription == null || sessionDescription.isEmpty() (not
kobitonUsername.isEmpty()); use kobitonUrl (not kobitonBaseUrl) when
constructing the driver URI; and remove the duplicated driver.quit() so the
driver is only quit once.
| String kobitonUrl = System.getenv("KOBITON_URL"); | ||
| String udid = System.getenv("KOBITON_UDID"); | ||
| String kobitonSession = System.getenv("KOBITON_SESSION"); | ||
| String kobitonUsername = System.getenv("KOBITON_USERNAME"); | ||
| String kobitonApiKey = System.getenv("KOBITON_APIKEY"); | ||
|
|
||
| // Optional environment variables | ||
| String app = System.getenv("KOBITON_APP"); | ||
| String sessionName = System.getenv("KOBITON_SESSION_NAME"); | ||
| String sessionDescription = System.getenv("KOBITON_SESSION_DESCRIPTION"); | ||
| String kobitonRuntime = System.getenv("KOBITON_RUNTIME"); | ||
|
|
||
| // Validate env vars | ||
| if (webdriverUrl == null || kobitonSession == null || udid == null || | ||
| webdriverUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) { | ||
| System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_WEBDRIVER_URL, or KOBITON_SESSION"); | ||
| return; | ||
| } | ||
|
|
||
| // Provide default values for optional env vars if null or empty | ||
| if (app == null || app.isEmpty()) { | ||
| app = "https://example.com/downloads/sample.ipa"; | ||
| } | ||
|
|
||
| if (sessionName == null || sessionName.isEmpty()) { | ||
| sessionName = "A Turbo Test session for iOS"; | ||
| } | ||
|
|
||
| if (sessionDescription == null || kobitonUsername.isEmpty()) { | ||
| sessionDescription = "A sample Turbo Test session for iOS"; | ||
| } | ||
|
|
||
| // Capabilities | ||
| DesiredCapabilities caps = new DesiredCapabilities(); | ||
| caps.setCapability("kobiton:sessionName", sessionName); | ||
| caps.setCapability("kobiton:sessionDescription", sessionDescription); | ||
| caps.setCapability("appium:udid", udid); | ||
| caps.setCapability("appium:app", app); | ||
| caps.setCapability("appium:automationName", "XCUITest"); | ||
| caps.setCapability("kobiton:session", kobitonSession); | ||
| caps.setCapability("appium:username", kobitonUsername); | ||
| caps.setCapability("appium:accessKey", kobitonApiKey); | ||
| caps.setCapability("kobiton:runtime", kobitonRuntime); | ||
|
|
||
| // Initialize driver | ||
| IOSDriver driver = new IOSDriver(new URI(kobitonUrl).toURL(), caps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix variable naming inconsistencies in the iOS example.
The iOS example has the same critical variable naming errors as the Android example:
- Line 277-279: Validation checks undefined variable
webdriverUrlinstead ofkobitonUrl - Line 279: Error message references non-existent env var
KOBITON_WEBDRIVER_URLinstead ofKOBITON_URL - Line 292: Logic error checks
kobitonUsername.isEmpty()when it should checksessionDescription == null || sessionDescription.isEmpty()
Additionally, driver.quit() is called twice (lines 319 and 322).
🔎 Proposed fixes for iOS example
// Required environment variables
String kobitonUrl = System.getenv("KOBITON_URL");
String udid = System.getenv("KOBITON_UDID");
String kobitonSession = System.getenv("KOBITON_SESSION");
String kobitonUsername = System.getenv("KOBITON_USERNAME");
String kobitonApiKey = System.getenv("KOBITON_APIKEY");
// Optional environment variables
String app = System.getenv("KOBITON_APP");
String sessionName = System.getenv("KOBITON_SESSION_NAME");
String sessionDescription = System.getenv("KOBITON_SESSION_DESCRIPTION");
String kobitonRuntime = System.getenv("KOBITON_RUNTIME");
// Validate env vars
- if (webdriverUrl == null || kobitonSession == null || udid == null ||
- webdriverUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) {
- System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_WEBDRIVER_URL, or KOBITON_SESSION");
+ if (kobitonUrl == null || kobitonSession == null || udid == null ||
+ kobitonUrl.isEmpty() || kobitonSession.isEmpty() || udid.isEmpty()) {
+ System.err.println("Missing required env vars: KOBITON_UDID, KOBITON_URL, or KOBITON_SESSION");
return;
}
// Provide default values for optional env vars if null or empty
if (app == null || app.isEmpty()) {
app = "https://example.com/downloads/sample.ipa";
}
if (sessionName == null || sessionName.isEmpty()) {
sessionName = "A Turbo Test session for iOS";
}
- if (sessionDescription == null || kobitonUsername.isEmpty()) {
+ if (sessionDescription == null || sessionDescription.isEmpty()) {
sessionDescription = "A sample Turbo Test session for iOS";
}
// Capabilities
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("kobiton:sessionName", sessionName);
caps.setCapability("kobiton:sessionDescription", sessionDescription);
caps.setCapability("appium:udid", udid);
caps.setCapability("appium:app", app);
caps.setCapability("appium:automationName", "XCUITest");
caps.setCapability("kobiton:session", kobitonSession);
caps.setCapability("appium:username", kobitonUsername);
caps.setCapability("appium:accessKey", kobitonApiKey);
caps.setCapability("kobiton:runtime", kobitonRuntime);
// Initialize driver
IOSDriver driver = new IOSDriver(new URI(kobitonUrl).toURL(), caps);
// Save page source
Files.writeString(Path.of("output/page_source.xml"), driver.getPageSource());
// Screenshot
File shot = driver.getScreenshotAs(OutputType.FILE);
Files.copy(shot.toPath(), Path.of("output/screenshot.png"), StandardCopyOption.REPLACE_EXISTING);
log.write("Screenshot saved\n");
driver.quit();
log.write("Completed successfully at " + LocalDateTime.now() + "\n");
-
- driver.quit();Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
docs/modules/automation-testing/pages/turbo-test-execution/run-appium-test.adoc
around lines 264 to 309, fix variable naming and logic errors: replace undefined
webdriverUrl with kobitonUrl in the null/empty validation, update the error
message to mention KOBITON_URL (not KOBITON_WEBDRIVER_URL), change the
sessionDescription check to verify sessionDescription == null ||
sessionDescription.isEmpty(), and remove the duplicate driver.quit() call so the
driver is only quit once; ensure all references to the Kobiton WebDriver URL
variable consistently use kobitonUrl and validate it before constructing the
IOSDriver URI.
Summary
Related PRs, issues, or features (optional)
Metadata
PR contributor checklist
My PR follows the Kobiton Docs contributor guidelines, meaning:
nav.adocfile.en-us) from my URLs.Summary by CodeRabbit
Documentation
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.