Sha256: de5b4a8f75b9bf312502c7933298dc68eab2d8b1bb823f487f30e0f9888ab2b1

Contents?: true

Size: 1.36 KB

Versions: 20

Compression:

Stored size: 1.36 KB

Contents

module OpsManagerUiDrivers
  module Version14
    class ProductForm
      def initialize(browser:, product_name:, form_name:)
        @browser = browser
        @product_name = product_name
        @form_name = form_name
      end

      def property(property_reference)
        browser.find_field("#{form_name}[#{property_reference}]")
      end

      def nested_property(property_reference, nested_reference)
        browser.find_field("#{form_name}[#{property_reference}][#{nested_reference}]")
      end

      def generate_self_signed_cert(wildcard_domain)
        browser.click_on 'Generate Self-Signed RSA Certificate'
        browser.within '#rsa-certificate-form' do
          browser.fill_in 'rsa_certificate[domains]', with: wildcard_domain
          browser.click_on 'save-rsa-certificate-action'
        end
      end

      def save_form(validate: true)
        browser.click_on 'Save'

        fail('unexpected failure') unless browser.has_css?('.flash-message')

        if validate
          fail(browser.find('.flash-message.error').text) unless browser.has_css?('.flash-message.success')
        end
      end

      def open_form
        browser.visit '/'
        browser.click_on "show-#{product_name}-configure-action"
        browser.click_on "show-#{form_name}-action"
      end

      private

      attr_reader :browser, :product_name, :form_name
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-0.9.7 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.6 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.5 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.4 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.3 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.2 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.1 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.9.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.8.2 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.8.1 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.8.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.7.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.6.2 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.6.1 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.6.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.5.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.4.1 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.4.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.3.0 lib/ops_manager_ui_drivers/version14/product_form.rb
ops_manager_ui_drivers-0.2.0 lib/ops_manager_ui_drivers/version14/product_form.rb