- 
                Notifications
    You must be signed in to change notification settings 
- Fork 29
Testing
webKnossos support both unit tests and integration/end-to-end (E2E) tests.
- Google Chrome with webdriver support
- node v0.12+
./start
npm run webdriver
npm test
Protractor is a wedriver/selenium abstraction that allows for easy access to DOM elements. See Helpers section below for advice.
explorativeTab = element(By.css("#tab-explorative"))
All tests are run as Jasmine tests. Jasmine can be used to write plain old unit tests or rely on Protractor to access DOM elements for E2E tests.
describe("A suite", function() {
  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  });
});
PageObject Pattern All major wK pages (e.g. Dashboard, Users List, etc) should be wrapped in Page Class that has convenience methods for navigating to the page and access certain buttons / DOM elements.
class Dashboard extends BaseTestPage
  get : ->
    browser.get '/dashboard'
  clickButton : ->
     return @waitForButton()
      .then (btn) -> btn.click()
All protractor calls to elements should make sure that the element is already rendered / available in the DOM by waiting for it. Selecting an element through a CSS selection is easily done through the helper method XYZ().
element = XYZ("#tab-explorative")