Module: Watir::Container

Included in:
ContentElement, Frame, Safari
Defined in:
lib/safariwatir.rb

Defined Under Namespace

Modules: Clickable Classes: AlertWindow, Button, Checkbox, ContentElement, Div, Form, Frame, HtmlElement, Image, InputElement, Label, Link, Option, P, Password, Radio, SecurityWarningWindow, SelectList, Span, Table, TableCell, TableRow, TextField

Constant Summary collapse

DEFAULT_TYPING_LAG =
0.08

Instance Method Summary collapse

Instance Method Details

#button(how, what) ⇒ Object

Elements



414
415
416
# File 'lib/safariwatir.rb', line 414

def button(how, what)
  Button.new(scripter, how, what)
end

#cell(how, what) ⇒ Object



418
419
420
# File 'lib/safariwatir.rb', line 418

def cell(how, what)
  TableCell.new(scripter, how, what)
end

#checkbox(how, what, value = nil) ⇒ Object



422
423
424
# File 'lib/safariwatir.rb', line 422

def checkbox(how, what, value = nil)
  Checkbox.new(scripter, how, what, value)
end

#contains_text(what) ⇒ Object



482
483
484
485
486
487
488
489
490
491
# File 'lib/safariwatir.rb', line 482

def contains_text(what)
  case what
  when Regexp
    text =~ what
  when String
    text.index(what)
  else
    raise MissingWayOfFindingObjectException
  end
end

#div(how, what) ⇒ Object



426
427
428
# File 'lib/safariwatir.rb', line 426

def div(how, what)
  Div.new(scripter, how, what)
end

#form(how, what) ⇒ Object



434
435
436
# File 'lib/safariwatir.rb', line 434

def form(how, what)
  Form.new(scripter, how, what)
end

#frame(name) ⇒ Object



438
439
440
# File 'lib/safariwatir.rb', line 438

def frame(name)
  Frame.new(scripter, name)
end

#image(how, what) ⇒ Object



442
443
444
# File 'lib/safariwatir.rb', line 442

def image(how, what)
  Image.new(scripter, how, what)
end

#label(how, what) ⇒ Object



446
447
448
# File 'lib/safariwatir.rb', line 446

def label(how, what)
  Label.new(scripter, how, what)
end


450
451
452
# File 'lib/safariwatir.rb', line 450

def link(how, what)
  Link.new(scripter, how, what)
end

#p(how, what) ⇒ Object



430
431
432
# File 'lib/safariwatir.rb', line 430

def p(how, what)
  P.new(scripter, how, what)
end

#password(how, what) ⇒ Object



454
455
456
# File 'lib/safariwatir.rb', line 454

def password(how, what)
  Password.new(scripter, how, what)
end

#radio(how, what, value = nil) ⇒ Object



458
459
460
# File 'lib/safariwatir.rb', line 458

def radio(how, what, value = nil)
  Radio.new(scripter, how, what, value)
end

#row(how, what) ⇒ Object



462
463
464
# File 'lib/safariwatir.rb', line 462

def row(how, what)
  TableRow.new(scripter, how, what)
end

#select_list(how, what) ⇒ Object



466
467
468
# File 'lib/safariwatir.rb', line 466

def select_list(how, what)
  SelectList.new(scripter, how, what)
end

#set_fast_speedObject



28
29
30
# File 'lib/safariwatir.rb', line 28

def set_fast_speed
  @scripter.typing_lag = 0
end

#set_slow_speedObject



32
33
34
# File 'lib/safariwatir.rb', line 32

def set_slow_speed
  @scripter.typing_lag = DEFAULT_TYPING_LAG
end

#span(how, what) ⇒ Object



470
471
472
# File 'lib/safariwatir.rb', line 470

def span(how, what)
  Span.new(scripter, how, what)
end

#speed=(how_fast) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/safariwatir.rb', line 36

def speed=(how_fast)
  case how_fast
  when :fast then set_fast_speed
  when :slow then set_slow_speed
  else
    raise ArgumentError, "Invalid speed: #{how_fast}"
  end
end

#table(how, what) ⇒ Object



474
475
476
# File 'lib/safariwatir.rb', line 474

def table(how, what)
  Table.new(scripter, how, what)
end

#text_field(how, what) ⇒ Object



478
479
480
# File 'lib/safariwatir.rb', line 478

def text_field(how, what)
  TextField.new(scripter, how, what)
end