-
Notifications
You must be signed in to change notification settings - Fork 133
Convert typed dict earlier in new_context #2211
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
Convert typed dict earlier in new_context #2211
Conversation
- To avoid possible argument mutation for arguments that have pointers, like dictionaries
|
To protect accidentally changing that code again, it would be good idea to modify example this test to check the dictionary https://github.com/MarketSquare/robotframework-browser/blob/main/atest/test/01_Browser_Management/video.robot At least in one test. |
|
I was just looking into it also. Will try to add or modify two tests for this behavior to a test in that suite. Two because the original behavior was different depending on whether the video path existed beforehand or not. |
|
Is the New Context actually expected to return the full video record path in the dictionary passed to it using recordVideo argument? That came into my mind when I was about to modify test case Create Video With Relative Path in https://github.com/MarketSquare/robotframework-browser/blob/main/atest/test/01_Browser_Management/video.robot. If that should be the case, then I think better way would be to return that path as a string in the passed recordVideo dictionary, and not as a WindowsPath object as it is now. And it should be documented that the function will return the full path in there. |
|
I will anyhow add the tests here, and you can then evaluate if the expectations in the tests are ok. |
… acceptance tests
|
|
F☆☆☆☆ did accidentally press the update branch button, instead of approving the CI runs. Those are so close in mobile, sorry. Please force push your local branch to PR. |
|
Not only because of |
|
With "force push your local branch to PR" do you mean |
|
Ok, when I read carefully your comment on what you accidentally did I think I know what you meant. I will do that. |
Yes that one please. |
7f61139 to
d527982
Compare
|
Force push done to get back to the previous state of the main branch |
|
About the backwards incompatibility if returning strings. In the current version of Browser library, the |
|
Path objects are the future and more underlying native Python methods gain support for Path objects. Example subprocess.Popen got Path object support in 3.8 https://docs.python.org/3.8/library/subprocess.html#popen-constructor Example Process library works with Path objects when used with Python 3.8 or greater, but not with Python 3.7 or lower. Returning two different types is not good, Path object would be better. Also RF OperatingSystem library should start supporting Path objects too, but that is separate issue. |
|
Ok, should we then change the implementation of new_context and new_persistent_context so that it will always return a Path-object? If you think so, I could make another PR for that and we can then close this PR. I think I have the code already for that, just need to add and modify some tests too. |
|
At the same time I found another bug in |
|
I have now created a separate bug report of the "New Persistent Context" keyword: #2214 |
|
@ssallmen thanks for the contribution! |
|
Hmmm tests failing :/ |
To avoid possible argument mutation for arguments that have pointers, like dictionaries