Added new attributes for automation_session object and updated endpoint#2
Added new attributes for automation_session object and updated endpoint#2hanikhan wants to merge 3 commits intobrowserstack:masterfrom
Conversation
…json returned for session details. Also updated REST API endpoint to reflect latest BrowserStack API endpoint: https://www.browserstack.com/automate/rest-api
| * @return The browser_console_logs_url | ||
| */ | ||
| @JsonProperty("browser_console_logs_url") | ||
| public String getBrowser_console_logs_url() { |
There was a problem hiding this comment.
Use camel case only in all function names.
raghuhit
left a comment
There was a problem hiding this comment.
- Please make all variable and function names to be camelcased.
- Error messages should be in accordance with the function they are being written in, for example, in getConsoleLogs function, error message should be "Session console logs not found."
| throw new AutomateException("Invalid session", 400); | ||
| } | ||
|
|
||
| if (session.getBrowser_console_logs_url() == null) { |
There was a problem hiding this comment.
This should also check whether it is a zero length string or not.
| throw new AutomateException("Invalid session", 400); | ||
| } | ||
|
|
||
| if (session.getHar_logs_url() == null) { |
There was a problem hiding this comment.
Add check for zero length string too.
Also this check is not needed, since you are doing it already in Session.java
| } | ||
|
|
||
| if (session.getBrowser_console_logs_url() == null) { | ||
| throw new AutomateException("Session logs not found", 404); |
There was a problem hiding this comment.
Error message should be "Session console logs not found."
| } | ||
|
|
||
| if (session.getHar_logs_url() == null) { | ||
| throw new AutomateException("Session logs not found", 404); |
There was a problem hiding this comment.
Error message should be "Session HAR logs not found."
| throw new AutomateException("Invalid session", 400); | ||
| } | ||
|
|
||
| if (session.getAppium_logs_url() == null) { |
| } | ||
|
|
||
| public final String getHARLogs() throws AutomateException { | ||
| if (logUrl == null) { |
| private String har_logs_url; | ||
|
|
||
| @JsonProperty("appium_logs_url") | ||
| private String appium_logs_url; |
There was a problem hiding this comment.
variables name should be in camel case.
| } | ||
|
|
||
| public final String getAppiumLogs() throws AutomateException { | ||
| if (logUrl == null) { |
There was a problem hiding this comment.
variable name is not correct and zero length string check needs to be performed also here,
|
|
||
| @Test | ||
| public void testGetSessionHARLogs() { | ||
| // TODO: Verify if logs are non-empty |
There was a problem hiding this comment.
This test will fail sometimes. If the last run session haven't enabled network logs.
| } | ||
|
|
||
| @Test | ||
| public void testGetSessionAppiumLogs() { |
There was a problem hiding this comment.
This test will fail in case the last session is run on desktop or appium logs capability was not passed in that.
…l case and added comments to tests
|
Added requested changes. Please review |
Added browser_console_logs_url, har_logs_url, appium_logs_url to the json returned for session details. Also updated REST API endpoint to reflect latest BrowserStack API endpoint: https://www.browserstack.com/automate/rest-api