Sha256: 86ac2e7508798e6c4bb12710ea0ee7fbdd9324b8a7c14a043f8660f29dac7e76

Contents?: true

Size: 803 Bytes

Versions: 1

Compression:

Stored size: 803 Bytes

Contents

require 'thor/group'
require 'git'
require 'active_support/inflector'

module WatirInstall
  module Generators
    class Page < Thor::Group
      include Thor::Actions

      argument :klass, type: :string, desc: 'The page object being created'
      argument :url, type: :string, default: '', desc: 'The Page URL'
      argument :form, type: :string, default: '', desc: 'Generates #submit_form'
      argument :elements, required: false, default: [], type: :array, desc: 'These are elements on page'

      def self.source_root
        "#{File.dirname(__FILE__)}/pages"
      end

      def name
        Dir.pwd[/[^\/]*$/]
      end

      def data_files
        template "spec/support/pages/page.rb.tt", "#{Dir.pwd}/spec/support/pages/#{klass.downcase.gsub('::', '/')}.rb"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir_install-0.3.0 lib/watir_install/generators/page.rb