Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FinancialForce DevTalks: Siesta Testing

FinancialForce DevTalks: Siesta Testing

Chris Peterson

January 14, 2015
Tweet

More Decks by Chris Peterson

Other Decks in Programming

Transcript

  1. Requires ExtJs • from CDN (use cachefly for HTTPS support)

    ◦ Sencha CDN is HTTP only, won't load right on modern browsers inside HTTPS-only visualforce ◦ Use cachefly - same URL structure but with HTTPS • from static resource ◦ Size limits issues? Only requires ▪ /resources ▪ ext-all.js
  2. Test Harness • Load tests from localhost or static resources

    • Siesta is bound by same-origin, like all js ◦ So make sure the harness is a visualforce page
  3. Working with Visualforce • Use apex:actionStatus with waitForElementNotVisible • Set

    separateContext : true in test definition ◦ Prevents page rerenders breaking your test chains ◦ Or use well-scoped rerender on all actions • [Soon] AJAX toolkit for test setup/teardown
  4. data-tid used as a target for tests instead of id

    If you use siesta's recorder set it to use these instead of Id: This passes through to the generated HTML as: data-tid="input-accountName"
  5. • Visualforce doesn't give you an index inside repeat and

    table elements. • data-tid really needs to be unique for our tests • Old pages can be apex:variable as a counter, but that broke in Sprint '12 (or somewhere around there) • There's a trick that's not too disruptive: make an array of array indexes and iterate on that Visualforce Iteration
  6. What just doesn't work • *.salesforce.com pages all contain anti-

    iframe code and won't run in siesta • Clickjack protection option for visualforce can be problematic. • Cross-namespace testing won't work: different subdomains
  7. Coming Soon Once a bug is fixed: invoke the salesforce

    AJAX toolkit for test setup. Once I write the feature request: invoke the AJAX toolkit for test cleanup.
  8. FAQ Where can I see your code? https://github.com/capeterson/Siesta-DevTalk Where can

    I get these slides? https://speakerdeck.com/ca_peterson