Sha256: 866f103668b7026d449baab33c1c8365dab6fcae302f43c6354815152ca7462f

Contents?: true

Size: 1.65 KB

Versions: 12

Compression:

Stored size: 1.65 KB

Contents

module OpsManagerUiDrivers
  module Version17
    module BoshProductSections
      class Networks
        def initialize(browser:)
          @browser = browser
          @bosh_product_form_section = BoshProductFormSection.new(browser, 'network[networks][]')
        end

        def add_single_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
          @bosh_product_form_section.open_form('network')

          @bosh_product_form_section.set_fields(
            'name' => name,
            'iaas_network_identifier' => iaas_network_identifier,
            'subnet' => subnet,
            'dns' => dns,
            'gateway' => gateway,
            'reserved_ip_ranges' => reserved_ip_ranges,
          )
          browser.click_on 'Save'
          flash_errors = browser.all('.flash-message.error ul.message li').to_a
          flash_errors.reject! { |node| node.text =~ /cannot reach gateway/i }

          if (flash_errors.length > 0)
            fail flash_errors.collect(&:text).inspect
          end
        end

        def add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
          @bosh_product_form_section.open_form('network')

          browser.click_on 'Add'
          @bosh_product_form_section.set_fields(
            'name' => name,
            'iaas_network_identifier' => iaas_network_identifier,
            'subnet' => subnet,
            'dns' => dns,
            'gateway' => gateway,
            'reserved_ip_ranges' => reserved_ip_ranges,
          )
          @bosh_product_form_section.save_form
        end

        private

        attr_reader :browser
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-1.8.3 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.9.4 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.9.3 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.9.2 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.9.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.9.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.8.2 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.8.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.8.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.7.3 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.7.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
ops_manager_ui_drivers-1.7.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb