These are chat archives for cucumber/cucumber-ruby

22nd
Aug 2016
hasherCGI
@hasherCGI
Aug 22 2016 14:11
@mattwynne I found a blog on how to use external data in gherkin, but can't get it to work https://shvets.github.io/blog/2014/10/19/adding_source_to_gherkin_script.html
nixfreak
@nixfreak
Aug 22 2016 14:12
is it possible to put in logic using watir::webdriver ?
or will I have to use pure ruby in order to put logic in ?
nixfreak
@nixfreak
Aug 22 2016 14:18
scenario would be to recognize a text field and if the text field was populated and a duplicate then I would like watir::webdriver to alert that person and either manually put in another request id or have the program fill it when another request id based on a regex statement
has anyone had experience with this type of scenario before?
blueice349
@blueice349
Aug 22 2016 23:28

can someone help with a custom step problem I am having?

custom step:

def getLabelElementByLabel( label )

   return $driver.find_element( :xpath, '//label[translate(normalize-space(text()),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")="' + label.upcase + '"]' )
end

Then( /^I enter "([^"]*?)" into the textbox labeled "([^"]*)"$/ ) do | text, label |

  label_element = getLabelElementByLabel( label )
  clear_text( 'id', label_element.attribute( 'for' ) )
  enter_text( 'id', text, label_element.attribute( 'for' ) )
end

using the custom step:

Then I enter "Update" into the textbox labeled "ENTER NEW ENTRY LABEL (DEFAULT IS \"COMMENT\" OTHER POSSIBLE VALUES MAY BE LOG, UPDATE, ETC.)"

the problem is the "" does not get read as a string

the next line is the whole string:
ENTER NEW ENTRY LABEL (DEFAULT IS "COMMENT" OTHER POSSIBLE VALUES MAY BE LOG, UPDATE, ETC.)

Dave McNulla
@dmcnulla
Aug 22 2016 23:51
@nixfreak - I wouldn't do that if it could. It won't run in CI. Better to get your data cleaned up between scenarios.