class SideToCapybara::Minitest

This class holds the translations for minitest.

To add a translation you need to do the following steps:

  1. Open the .side file and find the command you want to add

  2. Define a method in the Minitest class with the command as name. The command name must be translated to the ruby version of the name. `assertText` => `assert_text`

  3. Define the translation

The properties of the whole .side command object are accessible through ruby methods.

Public Instance Methods

assert_text() click to toggle source
# File lib/side_to_capybara/minitest.rb, line 53
def assert_text
  "assert_selector('#{selector}', text: '#{value}')"
end
click() click to toggle source
# File lib/side_to_capybara/minitest.rb, line 38
def click
  case selector_type
  when 'css'
    "find('#{selector}').click"
  when 'id'
    "find('##{selector}').click"
  when 'xpath'
    "find('#{selector}').click"
  when 'name'
    "find('[name=\"#{selector}\"]').click"
  when 'linkText'
    "click_link_or_button('#{selector}')"
  end
end
double_click() click to toggle source
# File lib/side_to_capybara/minitest.rb, line 25
def double_click
  case selector_type
  when 'css'
    "find('#{selector}').double_click"
  when 'id'
    "find('##{selector}').double_click"
  when 'xpath'
    "find('#{selector}').double_click"
  when 'name'
    "find('[name=\"#{selector}\"]').double_click"
  end
end
open() click to toggle source
# File lib/side_to_capybara/minitest.rb, line 21
def open
  "visit('#{target}')"
end