Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] To use data in yaml file individually #20

Open
anilreddy opened this issue Jul 26, 2015 · 1 comment
Open

[Feature Request] To use data in yaml file individually #20

anilreddy opened this issue Jul 26, 2015 · 1 comment

Comments

@anilreddy
Copy link
Contributor

Hi @cheezy

Currently in the methods if we have please waits & conditions likes if, else etc. I am unable to use data magic.

Say if I have methods that have if else conditions like this:

I cannot use populate_page_with data_for instead it would be great if you can implement like this:

yaml file:

comment_details:
  test_comment: Test comment details
  report_comment: Report comment details
  def enter_comment_details(data = {})
    if report_comment.nil?
      if category == $category[:test].to_s
        if want_date_radio == $confirm[:yes].to_s
          select_want_date_radio
          wait_until_page_loads
          self.want_date = current_date
        elsif test_comment_radio == $confirm[:yes].to_s
          select_test_comment_radio
          wait_until_page_loads
          self.test_comment = test_comment # use here
        end
        self.report_comment = report_comment
      elsif category == $category[:report].to_s
        self.report_comment == report_comment # use here
    end
  end 
@vveliev
Copy link
Contributor

vveliev commented Sep 4, 2015

 def enter_comment_details(data = {})
    comments = data_for(:comment_details)
    if report_comment.nil?
      if category == $category[:test].to_s
        if want_date_radio == $confirm[:yes].to_s
          select_want_date_radio
          wait_until_page_loads
          self.want_date = current_date
        elsif test_comment_radio == $confirm[:yes].to_s
          select_test_comment_radio
          wait_until_page_loads
          self.test_comment =  comments['test_comment'] # use here
        end
        self.report_comment = report_comment
      elsif category == $category[:report].to_s
        self.report_comment == comments['report_comment'] # use here
    end
  end 

What's wrong with that ?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants