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

Testing SalesForce A

Mats Bryntse
January 15, 2015
52

Testing SalesForce A

Mats Bryntse

January 15, 2015
Tweet

Transcript

  1. Intro | DESCRIPTION Who am I? Ext JS since 2007

    Bryntum: Gantt charts, JS Testing tools
  2. Webinar | Content Unit tests UI tests Continuous Integration •

    Writing a unit test • Using PhantomJS • Hello world sample • Event recorder intro • Testing an Ext JS cmp • Recording a UI test • TeamCity • Code Coverage • Statistics • Cloud Testing + How Siesta can help you test SalesForce apps
  3. Intro | WHY 1. Productivity & confidence in code 2.

    Frameworks contain bugs 3. So does your code (and mine) 4. Refactoring & code handover 5. Fix bugs once
  4. Intro | Testing with Siesta • runs in any browser

    • is written in plain JS • is sandboxed by default A Siesta test…
  5. Intro | Testing with Siesta • can do both UI

    and unit testing • can be automated using PhantomJS or Selenium WebDriver • can detect leaked global variables A Siesta test…
  6. Intro | Testing with Siesta describe('A simple Model test', function

    (t) {
 
 t.it('Should do something', function(t) {
 
 // Test things
 t.expect(1).toBe(1);
 });
 });

  7. Unit tests | Intro •Unit tests usually only involve “raw”

    JS •Run very fast •Perfect for pre-commit hooks •Disable sandboxing if possible
  8. Unit tests | Intro •Should be your #1 priority •Cover

    your most important JS classes •Run often, before commit, daily, nightly. •Use TDD approach + BDD style for readability
  9. Unit tests | TDD basics 1. Make the unit test

    fail 2. Implement 3. Make the test pass 4. Refactor, Repeat
  10. UI tests | Intro •UI “unit test” of a single

    UI component •Or Application test, open index.html and test it Two main types of UI tests
  11. UI tests | Event recorder •Great for application tests •Records

    user actions: clicks, types, drag drop •Exports actions to a Siesta test case •Can be used by a non-programmer •Big timesaver
  12. UI tests | Monkey tests •Random UI testing •Clicks, drags

    etc. in your UI •Finds unhandled exceptions •Free testing help. 0€
  13. Continuous Integration | Intro •Bryntum uses TeamCity, Siesta integrates with

    others (Jenkins…) •Test suites run every 2 hours in Chrome •Full test suites executed nightly •Reports, statistics, charts and code coverage
  14. Continuous Integration | Cloud testing •Need to create Virtual Machines

    for each version of IE •Total: Chrome, Safari, FF, IE 7-11 => 7 VMs •Managing such a farm can be very time consuming
  15. Continuous Integration | Cloud testing •Siesta integrates with both BrowserStack

    and Sauce Labs •Run tests easily in any OS and Browser combination •No need to setup your own VM farm •Read more on the Bryntum blog…