class OpsManagerUiDrivers::Version17::BoshProductSections::Subnet

Constants

FLASH_MESSAGE_CLASS
FLASH_MESSAGE_ERRORS

Public Class Methods

new(browser:, network_form:, subnet_index:) click to toggle source
# File lib/ops_manager_ui_drivers/version17/bosh_product_sections/subnet.rb, line 8
def initialize(browser:, network_form:, subnet_index:)
  @browser                   = browser
  @subnet_index = subnet_index
  @subnet_form_section =
    BoshProductFormSection.new(@browser, "#{network_form.field_prefix}[subnets][#{subnet_index}]")
end

Public Instance Methods

add_subnet(identifier:, cidr:, dns:, gateway:, reserved_ips:, availability_zones:) click to toggle source
# File lib/ops_manager_ui_drivers/version17/bosh_product_sections/subnet.rb, line 15
def add_subnet(identifier:, cidr:, dns:, gateway:, reserved_ips:, availability_zones:)
  @browser.all('a', text: 'Add Subnet').last.click if @subnet_index > 0

  @subnet_form_section.set_fields(
    'iaas_identifier'    => identifier,
    'cidr'               => cidr,
    'dns'                => dns,
    'gateway'            => gateway,
    'reserved_ip_ranges' => reserved_ips,
  )

  availability_zones.each do |availability_zone|
    @browser.
      find(:xpath, %Q{//label/input[contains(@name, "#{@subnet_form_section.field_prefix}[availability_zone_references]")]/..}, text: availability_zone).click
  end
end