Skip to content

Instantly share code, notes, and snippets.

@edmondop
Created May 16, 2020 11:56
Show Gist options
  • Save edmondop/2d8df87228cc0425075f83f3a52c80e0 to your computer and use it in GitHub Desktop.
Save edmondop/2d8df87228cc0425075f83f3a52c80e0 to your computer and use it in GitHub Desktop.
Account.AnnualRevenue Age Role Likely_Member__c
10000 20 CEO True
100000 45 CFO False
@edmondop
Copy link
Author

Option 2, using maybe roboframework.csv, in pseudocode


Likely_Member__c
True,
False


cci task run dataset import my-flow-examples
${rows}=		read csv as list		test.csv ## You still need a csv to store Likely_Member__c, the dataset only solves setting up the graph
contacts = Get All contacts
for index in range. 0 , contacts.length
    row = rows(index)
    contact = contacts(index)    
    Should Be Equal updated_contact.Likely_Member__c row(1)

Pros:

  • the complex set up of graph and dependencies of linked objects is handled by cumulus ci data set
    Cons:
  • You need a different csv for the results and linking that csv with the dataset used in input is not trivial
  • Still, ShouldBeEqual is hardcoded in the test, what if in some cases you want to test Should Be Greater Than, or Should Not Be Greater Than?

@edmondop
Copy link
Author

Option 3:

  1. Have a file that stores the relationship between the dataset ids and the expected values
  2. Parse that file with roboframework
  3. Perform CCI tasks
  4. Loop over the file and perform the assertion (potentially dynamically)

ContactId, AssertionType, Value

0131aaaa, Should Be Equal To, 10
0131aaab, Should Be Greater Than , 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment