amtrack / sfdx-browserforce-plugin

sfdx plugin for browser automation
MIT License
109 stars 38 forks source link

Issue contributing Opportunity Split enablement #508

Closed twhitesides closed 1 year ago

twhitesides commented 1 year ago

I have a use case where I would like to create Scratch Orgs with Opportunity Splits already enabled. I have attempted to follow your instructions in CONTRIBUTING.md. I seem to be having an issue when it comes to trying it out. The suggested command: ./bin/run browserforce:apply -f src/plugins/opportunity-splits/enable.json results in:

Could not find plugin named 'opportunitySplits' in definition: {"$schema":"../schema.json","settings":{"opportunitySplits":{"enabled":true}}}

I did the yarn command and followed your instructions carefully, so I'm not certain what could be missing.

amtrack commented 1 year ago

@twhitesides Good catch! Thanks for reporting!

The Contribution Guide was missing the step to build the plugin:

I've now update the docs: https://github.com/amtrack/sfdx-browserforce-plugin/pull/509

twhitesides commented 1 year ago

Thank you! I appreciate it. I was able to move farther. However, I seem to be stuck again if you wouldn't mind taking a look. I can't seem to figure out the pattern to the selectors. For Opp Splits I'm trying to select a button with HTML like: <input id="j_id0:form:EditButton" type="submit" name="j_id0:form:EditButton" value="Set up Opportunity Splits" class="btn button"> What would be the pattern for that?

amtrack commented 1 year ago
@twhitesides It depend on wether you use Salesforce Classic or Lightning Experience: UI URL path Selector
Salesforce Classic opp/opportunitySplitSetupLanding.apexp input[id$=":form:EditButton"]
Salesforce Lightning Experience lightning/setup/OpportunitySplitSetup/home pierce/force-aloha-page iframe[name^=vfFrameId], iframe[name^=vfFrameId], input[id$=":form:EditButton"]
twhitesides commented 1 year ago

Thanks for your answer. I am not sure if I am doing something wrong or if, due to this particular interface being quite outdated and a mix of Lightning and Classic, this one will work differently. I have been trying for a few hours but it cannot find the selector.

amtrack commented 1 year ago

@twhitesides It seems to have worked for me. Did you manually enable Setup > Opportunity Team Settings > Enable Team Selling in your Scratch Org? That was a prerequisite for me to make the Setup Page for Opportunity Splits available.

twhitesides commented 1 year ago

Thanks for checking. I did have that enabled and was using debug to be certain it was getting to the same page. Oddly enough I was able to get this working once through recording a faked set of mimicking tab and enter keys, but it only worked once on one org. If you cared to share I would love to know how you got things working, I seem to be unable to do so.

amtrack commented 1 year ago

@twhitesides I've implemented the wizard without applying any further configuration or handling of errors: https://github.com/amtrack/sfdx-browserforce-plugin/pull/524 Feel free to take this as a kickstart.

whitesidest commented 1 year ago

Thank you so much for your effort, and apologies for the delay in reply. This seems to work very well. Is there anything that I could contribute to in order to help this get merged into core for more people to benefit from?

amtrack commented 1 year ago

@whitesidest I was assuming there might be some more settings needed to be implemented. If you confirm that the enablement - as implemented - is already sufficient, then I'll finalize and merge the PR.

whitesidest commented 1 year ago

It works perfectly in tests I try. I'm delighted with it. Thank you again.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: