Skip to content

Run on failure flag - #349

Merged
just-be-dev merged 30 commits into
robotframework:masterfrom
dpsfrishberg:run-on-failure-flag
May 12, 2015
Merged

just-be-dev merged 30 commits into
robotframework:masterfrom
dpsfrishberg:run-on-failure-flag

Conversation

@dpsfrishberg

Copy link
Copy Markdown
Contributor

Trying this again with branch rebased on rtomac's master.

eweitz and others added 25 commits August 19, 2014 10:32
…brary from QAR-48273-upstream-se2lib-build-fails to master

* commit 'f7835852e40ecb35399ac9fdbeee8c706706b542':
  QAR-48273: Applied fix for 'Choose File' bug, from Helio Guilherme (532295c)
  QAR-48273: Fixed build failure caused by extra content in output.xml
…brary from negative-index to master

* commit '1df05fe7cf1dbe77aa9de06fa8b4e37092c68651':
  QAR-48165: Removed unnecessary import of jQuery
  QAR-48165: Added tests for negative indexes, tidied code
  QAR-48165: Added support for negative indexes in Robot keywords
@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

Does this look good to merge?

@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

Ping

@just-be-dev

Copy link
Copy Markdown
Contributor

Sorry for the delay on this @frishberg, I'll review it tonight.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't ${ON FAIL COUNT} be defined here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I don't need it outside the one test case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gotcha. I'm fine with this then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this test is setup it looks like there's a keyword called Run On Failure Only Once. My recommendation is to add this test case to test/acceptance/keywords/run_on_failure.txt since it actually tests that keyword. This doesn't need to be in its own file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll make that change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, @zephraph, the reason this is in its own suite is because the keyword I am registering to run on failure is a custom keyword defined in a separate library. The Suite Setup commands used in test/acceptance/keywords/run_on_failure.txt will not work if I am importing that library, because it gets imported in addition to Selenium2Library, requiring the use of Set Library Search Order to be run before the Suite Setup commands, to disambiguate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I understand. I recommend something more along these lines:

*** Keywords ***
Prefer Custom Keywords
    Import Library  CustomSeleniumKeywords
    ${old order}=  Set Library Search Order  CustomSeleniumKeywords

*** Test Cases ***
Run On Failure Keyword Only Called Once
    [Setup]    Prefer Custom Keywords
    ...
    [Teardown]    Restore Old Search Order

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better! I will try that. I didn't know about Import Library.

@just-be-dev

Copy link
Copy Markdown
Contributor

If you're able to respond to the feedback I left we might be able to get this in the 1.7 release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've got everything in the one test file, but I had to introduce this __init__ hack, so that the Go To command would work with this library.

@just-be-dev

Copy link
Copy Markdown
Contributor

Everything looks okay, but I still can't merge until you're passing the Travis CI build.

@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

Oops! Didn't see that it was failing. Looking now.

@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

Looks like I just had to remove run_on_failure_keyword_only_once.txt.

@just-be-dev

Copy link
Copy Markdown
Contributor

Looks good to me! Thanks for the contribution. 👍

just-be-dev added a commit that referenced this pull request May 12, 2015
@just-be-dev
just-be-dev merged commit 21999d1 into robotframework:master May 12, 2015
@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

Thank you!

@just-be-dev

Copy link
Copy Markdown
Contributor

You won't see it live until the 1.7 release. I'm trying to push out 1.7 soon, but I don't have a concrete release date.

@just-be-dev just-be-dev added this to the 1.7 milestone May 12, 2015
@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

@zephraph, I am wondering if you have a rough release date for 1.7. This pull request is a prerequisite for a feature we are trying to get into http://github.com/ncbi/robotframework-pageobjects, to allow the use of selectors (names that stand in for locators - see https://github.com/ncbi/robotframework-pageobjects) in Robot tests with Selenium2Library keywords. A lot of tests we have been writing have been unable to use this feature, leading to a bit of technical debt. (We use selectors to keep DRY and encapsulate markup details in one place.)

Thanks for all the work you're doing, and let me know if we at NCBI can be of any help.

@just-be-dev

Copy link
Copy Markdown
Contributor

@frishberg, I'd like it to be today if at all possible. I'm a newcomer to this project though, so I didn't want to push out a release until the other contributors have had a say.

Expect it to land this week, likely in the next day or two.

@dpsfrishberg

Copy link
Copy Markdown
Contributor Author

OK, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants