Class: OpsManagerUiDrivers::Version15::MicroboshSections::Networks
- Inherits:
-
Object
- Object
- OpsManagerUiDrivers::Version15::MicroboshSections::Networks
- Defined in:
- lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb
Instance Method Summary collapse
- #add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:) ⇒ Object
- #add_single_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:) ⇒ Object
-
#initialize(browser:) ⇒ Networks
constructor
A new instance of Networks.
Constructor Details
#initialize(browser:) ⇒ Networks
Returns a new instance of Networks.
5 6 7 8 |
# File 'lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb', line 5 def initialize(browser:) @browser = browser @microbosh_form_section = MicroboshFormSection.new(browser, 'network[networks][]') end |
Instance Method Details
#add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb', line 30 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 |
#add_single_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ops_manager_ui_drivers/version15/microbosh_sections/networks.rb', line 10 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 |