Sha256: d5e6aa5d1f25fb02fa76d8865d71444e18b1e7cd61a167b9bd40fa07396b480a

Contents?: true

Size: 1.56 KB

Versions: 18

Compression:

Stored size: 1.56 KB

Contents

require "thor"
require "thor/group"
require "watirsplash/generators/helper"
require "watirsplash/generators/new_project"
require "watirsplash/generators/page"
require "watirsplash/util"

module WatirSplash
  class CLI < Thor
    extend Generators::Helper

    unless Dir.entries(Dir.pwd).include? ".rspec"
      desc "new [DIRECTORY_NAME]", "Create a new WatirSplash project."
      method_option :url, :default => "about:blank", :aliases => "-u",
        :desc => "URL for the application under test."
      method_option :framework, :default => "default", :aliases => "-f",
        :desc => "Framework to use. Possible values are #{supported_frameworks.join(", ")}."
      def new(name = "ui-test")
        WatirSplash::Generators::NewProject.start([name, options[:url], options[:framework]])
      end
    end

    if Dir.entries(Dir.pwd).include? ".rspec"
      desc "page PAGE_NAME [element_name:element_type:locator_name:locator_value]", "Create a new WatirSplash page."
      method_option :spec, :default => true, :aliases => "-s", :type => :boolean,
        :desc => "Create spec file for page."
      method_option :url, :default => nil, :aliases => "-u",
        :desc => "URL for the page if directly accessible."
      method_option :module, :default => "App", :aliases => "-m",
        :desc => "Namespace module for the page."
      def page(page_name = "Main", *elements)
        WatirSplash::Generators::Page.start([page_name.gsub("-", "_"), elements, options[:module].gsub("-", "_"), options[:spec], options[:url]])
      end
    end

  end  
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
watirsplash-2.4.4 lib/watirsplash/cli.rb
watirsplash-2.4.3 lib/watirsplash/cli.rb
watirsplash-2.4.2 lib/watirsplash/cli.rb
watirsplash-2.4.1 lib/watirsplash/cli.rb
watirsplash-2.4.0 lib/watirsplash/cli.rb
watirsplash-2.3.2 lib/watirsplash/cli.rb
watirsplash-2.3.1 lib/watirsplash/cli.rb
watirsplash-2.3.0 lib/watirsplash/cli.rb
watirsplash-2.2.0 lib/watirsplash/cli.rb
watirsplash-2.1.1 lib/watirsplash/cli.rb
watirsplash-2.1.0 lib/watirsplash/cli.rb
watirsplash-2.0.1.rc5 lib/watirsplash/cli.rb
watirsplash-2.0.1.rc4 lib/watirsplash/cli.rb
watirsplash-2.0.1.rc3 lib/watirsplash/cli.rb
watirsplash-2.0.1.rc1 lib/watirsplash/cli.rb
watirsplash-2.0.0 lib/watirsplash/cli.rb
watirsplash-2.0.0.rc2 lib/watirsplash/cli.rb
watirsplash-2.0.0.rc1 lib/watirsplash/cli.rb