Class: NewMappingsPage

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
pages/NewMappingsPage.rb

Instance Method Summary collapse

Constructor Details

#initializeNewMappingsPage

Returns a new instance of NewMappingsPage.


4
5
6
# File 'pages/NewMappingsPage.rb', line 4

def initialize
  find(:xpath,".//*[@class='input-medium']")[:placeholder].should == 'Untitled Mapping' 
end

Instance Method Details

#create_blank_mappingObject


8
9
10
11
# File 'pages/NewMappingsPage.rb', line 8

def create_blank_mapping
  find(:xpath, ".//*[@class='btn btn-primary editable-submit']").click
  click_button('Save')
end

#create_new_mappingObject


19
20
21
22
23
24
25
26
27
# File 'pages/NewMappingsPage.rb', line 19

def create_new_mapping
  mapping="mapping"+Time.now.to_s
  enter_mapping_name(mapping)
  click_button('Save')
  find(:xpath, ".//*[@id='flashnotice']//*[@class='container']").text.should == 'Mapping was successfully created.'
  $log.debug("#{mapping} mapping created")
  find(:id, 'reapply_link')
  return mapping
end

#enter_mapping_name(name) ⇒ Object


13
14
15
16
17
# File 'pages/NewMappingsPage.rb', line 13

def enter_mapping_name(name)
  find(:xpath, ".//*[@class='input-medium']").set name
  find(:xpath, ".//*[@class='btn btn-primary editable-submit']").click
  find(:xpath, ".//*[@class='editable editable-click']").text.should == name
end