Module: Locator::Wait

Defined in:
lib/cucumber/pickles/locator/wait.rb

Constant Summary collapse

WAIT_REGEX =
/\A([^\p{L}]*)(>)(.*)\Z/

Class Method Summary collapse

Class Method Details

.execute(locator) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cucumber/pickles/locator/wait.rb', line 7

def execute(locator)
  matches = WAIT_REGEX.match(locator)

  if matches
    captures = matches.captures
    locator = "#{captures[0]}#{captures[2]}"

    [locator, nil]
  else

    [locator, 0]
  end
end