Sha256: 928c170c8ee2089ab71927a16dd8f3cd4eacc9f174f028f0894cbb1137a14b0c

Contents?: true

Size: 1.63 KB

Versions: 50

Compression:

Stored size: 1.63 KB

Contents

module OpsManagerUiDrivers
  module Version15
    module MicroboshSections
      class Networks
        def initialize(browser:)
          @browser = browser
          @microbosh_form_section = MicroboshFormSection.new(browser, 'network[networks][]')
        end

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

          @microbosh_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:)
          @microbosh_form_section.open_form('network')

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

        private

        attr_reader :browser
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-1.8.3 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.28.1 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.28.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.27.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.26.1 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.26.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.25.1 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.25.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.24.4 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.24.3 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.24.2 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.24.1 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.24.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.23.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.22.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.21.1 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.21.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.20.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.19.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
ops_manager_ui_drivers-1.18.0 lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb