Grouped keywords together#2
Conversation
Julian88Tex
left a comment
There was a problem hiding this comment.
@sungysang provided some additional comments focused around using existing NPSP.robot keywords or at least using them as models and/or adding to the library.
|
|
||
| *** Test Cases *** | ||
| Assign GAU to Campaign and Verify Allocation on Opportunity | ||
| ${gau_id}= Create GAU |
There was a problem hiding this comment.
@sungysang looks like this can be part of Setup Test Data since it isn't part of the test.
| API Create Campaign GAU Allocation ${gau_id} | ||
| ... &{campaign}[Id] | ||
| ... ${ns}Percent__c=100.0 |
There was a problem hiding this comment.
You could group this into a keyword called Create 100% Campaign GAU Allocation
There was a problem hiding this comment.
If you want to leave this keyword on this robot file then I'd just hard code the API Create keyword to be 100%. If you want the keyword to be more generic and usable in other tests, then I would promote your API Create Keyword to NPSP.robot file (first I'd check to make sure one doesn't already exist that you can just use an update). And then you can create a localized keyword that references the above. While not a requirement, I recommend building keywords so that there are no variables in the tests so that the tests can be very readable steps.
There was a problem hiding this comment.
There was a problem hiding this comment.
If you promote it, you can probably put it near this keyword: https://github.com/SalesforceFoundation/NPSP/blob/master/robot/Cumulus/resources/NPSP.robot#L139
There was a problem hiding this comment.
@Julian88Tex Thanks, I basically copy pasted the original keyword since that one only worked for Opportunities, how would I promote it?
There was a problem hiding this comment.
@sungysang promote it means cut it from this file and paste it in the NPSP.robot file
| Create Opportunity With Campaign ${data}[contact][LastName] Household | ||
| ... ${campaign}[Name] |
There was a problem hiding this comment.
Any reason this needs to be UI? If you just testing the trigger logic, you might as well just create Opportunity through API. Looks like you can use this existing Keyword: https://github.com/SalesforceFoundation/NPSP/blob/master/robot/Cumulus/resources/NPSP.robot#L50
There was a problem hiding this comment.
@Julian88Tex I felt like this should try to re-create the user scenario as close as possible through the UI, but would you recommend API?
There was a problem hiding this comment.
@sungysang it all depends on what you're trying to test. If you trying to test the trigger, then API should be fine IMO since I wouldn't expect UI to have any impact on trigger logic vs. making an API call. If you're trying to test UI then stick with UI.
No description provided.