GithubHelp home page GithubHelp logo

shmeltex / siesta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from towerhe/siesta

0.0 2.0 1.0 8.02 MB

A rails mountable engine setting up siesta for testing ExtJS.

License: GNU General Public License v3.0

Ruby 57.15% JavaScript 36.52% HTML 5.25% CSS 1.09%

siesta's Introduction

Siesta

Build Status Dependency Status Code Climate Test Coverage

A rails mountable engine setting up siesta for testing ExtJS.

Install

Add siesta to Gemfile:

gem 'siesta'

And then run bundle install to install siesta. That's all.

Usage

  • Mount the engine in your rails application.
# config/routes
if Rails.env.development?
  mount Siesta::Engine => '/'
end
  • (OPTIONAL) Configure siesta.

    • spec_dir - Default directory of specs is spec/javascripts, so you should create you specs under spec/javascripts by default. But you could change the default value through an initializer.

      # config/initializers/siesta.rb
      Siesta.configure do |config|
        config.spec_dir = 'test/javascripts'
      end
    • auto_organizing - Organizing the tests by folders, default is true.

      # config/initializers/siesta.rb
      Siesta.configure do |config|
        config.auto_organizing = false
      end

      If you do not enable auto_organizing function, you need to create a test_harness.js under spec_dir to organize your tests.

      var Harness = Siesta.Harness.Browser.ExtJS;
      
      Harness.start({
        group               : 'Sample',
        items               : [
          '/assets/sample.t.js'
        ]
      });
  • Create your specs under the directory of specs.

// spec/javascripts/sample.t.js
StartTest(function(t) {
  t.ok(1 == 1, 'A sample test');
})    
  • Create spec/javascripts/test_harness.js to start.
// spec/javascript/test_harness.js
var Harness = Siesta.Harness.Browser.ExtJS;

Harness.start({
  group: 'Sample',
  items: ['/assets/sample.t.js']
});
rails s
// spec/javascripts/siesta_config.js
Siesta.Harness.Browser.ExtJS.configure({
  title: 'Dummy App',
  loaderPath: { 'DummyApp' : '/assets/extjs/app' },

  preload : [
    "/assets/extjs/resources/css/ext-all.css",
    "/assets/extjs/ext-all-debug.js"
  ]
});

For more detail about how to test your ExtJS, please visit: http://www.bryntum.com/docs/siesta/

License

This project rocks and uses GPLv3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.