› Test technology ▪ Testing with Ember › Test helpers › Simulating an API › Lessons learned @ Yahoo ▪ Test Automation › Continuous Integration › Cross-Device testing
▪ Excellent at testing “algorithmic complexity” Functional tests (a.k.a. “acceptance tests) ▪ Test behavior in context ▪ Simulate user behavior ▪ Often based on specs or acceptance criteria Integration tests ▪ Ensure that contracts at integration points stay in place ▪ NOT functional tests “End to end test” ▪ Check for multi-component system integrity ▪ Usually very slow
Unit Test Acceptance Criteria Acceptance/Functional Test Workflow Acceptance/Functional Test Contract between two components Integration test Total System Integrity “End to end” test
[, callbacks]]) moduleForModel( … ) moduleForComponent( … ) • Setup an empty container to unit test in isolation • Set context of view, so bindings work moduleForComponent('my-tabs', { needs: ['component:my-tab'] });
Async 12 test('Drilling into a shopping list from the index page', assert => { visit('/lists'); andThen(() => { assert.equal( currentURL(), ‘/lists', 'Should be at the index page’ ); assert.equal( find('.list-of-lists .list-item').length, 2, 'Two shopping lists are in the index’ ); }); click('.list-of-lists .list-item:nth-child(1)'); andThen(() => { assert.equal(currentURL(), ‘/list/1’, 'Showing the first shopping list’ ); }); console.log('Hello world!'); });
EMBER_TRY_SCENARIO=default - EMBER_TRY_SCENARIO=ember-release - EMBER_TRY_SCENARIO=ember-beta - EMBER_TRY_SCENARIO=ember-canary .travis.yml matrix: fast_finish: true allow_failures: - env: EMBER_TRY_SCENARIO=ember-canary Build has passed, but this is still running!
to fiddle with testem port and/or hostname to get OS X working { "framework": "qunit", "host": "lvh.me", "port": "7000", "test_page": "tests/index.html?hidepassed", ... }