-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Develop #1328
Develop #1328
Conversation
@@ -107,6 +110,19 @@ | |||
@AutoDef | |||
Map<String, Object> cookie(String name); | |||
|
|||
@AutoDef |
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.
I left this method as default to avoid duplicating the logic in multiple driver implementations. Let me know if this ok, else we can push to respective driver implementations. - Deepak
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.
I like the default method approach
/** | ||
* Cookie Utility method for UI calls. | ||
*/ | ||
public class UICookieUtils { |
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.
I think you can add this utility method tocom.intuit.karate.http.HttpUtils
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.
done!
/** | ||
* creates a map corresponding to cookie. This is used by appropriate drivers. | ||
* Karate Cookie Map is of type <String, String> vs the internal framwork expects appropriate types - | ||
* for ex boolean for secure and persistent keys. |
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.
yes this makes sense. can you just apply IDE java formatting to add white-space (nit pick)
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.
done!
@@ -107,6 +110,19 @@ | |||
@AutoDef | |||
Map<String, Object> cookie(String name); | |||
|
|||
@AutoDef |
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.
I like the default method approach
Given driver 'https://google.com' | ||
And input("input[name=q]", 'karate dsl') | ||
When submit().click("input[name=btnI]") | ||
Then waitForUrl('https://github.com/intuit/karate') | ||
|
||
Scenario: pass cookie from API call to UI call |
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.
since I am used to using demo-01.feature for various live demos, can you move this into a new feature and java runner ? really appreciate that you took time to write a test 👍
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.
done! created new runner / feature for hybrid and reverted all -1 changes.
@ptrthomas - thank you for the review - I will make the changes and resubmit. |
@ptrthomas - pushed changes per review comments. Thank you. |
#1293 unify cookie for api and ui tests
Thanks for contributing this Pull Request. Make sure that you submit this Pull Request against the
develop
branch of this repository, add a brief description, and tag the relevant issue(s) and PR(s) below.