Repository navigation
create_test: accept test_environment_id (API requires it) #1
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,9 +226,17 @@ def get_test(self, sessionId: Union[int, str], skip_fields: Optional[Union[list, | |
| return self.client.get(url) | ||
|
|
||
| def create_test(self, name: str, success: Optional[bool] = None, status_message: Optional[str] = None, | ||
| extra: Optional[str] = None, build: Optional[str] = None) -> Any: | ||
| """Create a test record (for logging manual or external test results).""" | ||
| extra: Optional[str] = None, build: Optional[str] = None, | ||
| test_environment_id: Optional[Union[int, str]] = None) -> Any: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changing this. Making test_environment_id positional/required would break existing positional calls (create_test(name, success, status_message, ...)), and a client-side None check would just duplicate the server's validation, which already returns a clear message ('test[test_environment_id] is missing'). The parameter is optional so the signature stays backwards compatible. The docstring and README now say the API needs it. |
||
| """Create a test record (for logging manual or external test results). | ||
|
|
||
| test_environment_id: the ``browser_id`` of the browser/device (from | ||
| ``tb.information.get_browsers()``) the test ran on. The API rejects | ||
| the request without it. | ||
| """ | ||
| test = {'name': name} | ||
| if test_environment_id is not None: | ||
| test['test_environment_id'] = test_environment_id | ||
| if success is not None: | ||
| test['success'] = success | ||
| if status_message is not None: | ||
|
|
||
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.
Keeping it as a placeholder. This README section lists every method with placeholder arguments (sessionId, buildId, app_url, testId, ...), none of which are defined in the snippet. The comment right below the call says where browserId comes from (the browser_id field of tb.information.get_browsers()).