GithubHelp home page GithubHelp logo

Comments (4)

adam-wypych avatar adam-wypych commented on August 14, 2024

Hi,

I think is quite complex since keywords like Run Keyword If*\Set Variables If* are open gate for syntax like ELSE IF\ELSE ( see: http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20If ). I have been checked it and even RIDE do not support such fully validation. But I think in some point we will need to put some effort to introduce such validation.

Best Regards,
-Adam.

from red.

adam-wypych avatar adam-wypych commented on August 14, 2024

Copy of some discussion with Michal from ( #224 (comment) ):

However it seem to be quite hard to make it customizable for users because those keywords are basically free to interpret provided arguments and sometimes there may be non trivial logic implemented there.

To be honest I was thinking that you do not need to treat whole line of execution as one. If you will use old technic divide and conquer, you can achieve customise ability. In my opinion if you will just check each keyword separately (nested keyword) is not to hard to achieve possibility to have some kind of the table, which will say that argument on position 2 of keyword X is keyword name and start from the next position (3) could be his arguments.

Anyway I think the most critical for both hardcoded and customizable is to decide if ELSE is part of keyword put as argument or is part of Run Keyword If syntax. This I think require to take a look how Robot Framework is parsing such syntax.

So regarding Run Keyword If as nested keyword in other Run Keyword If, some clarification is needed from Robot Framework contributors. I figurated that the syntax is not fully supported, as it could be expected (robotframework/robotframework#2871). Shortly describing the issue, ELSE from the latest nested Run Keyword If is used for any Run Keyword If condition in the path.

Anyway, I reviewed the Robot Framework source code related to handling Run * If keywords. Base what was written in comment for Run Keyword If method ( https://github.com/robotframework/robotframework/blob/master/src/robot/libraries/BuiltIn.py#L1680 ) :

Notice that ELSE and ELSE IF control words must be used
explicitly and thus cannot come from variables. If you need to use
literal ELSE and ELSE IF strings as arguments, you can escape
them with a backslash like \\ELSE and \\ELSE IF.
Base on this I think it shouldn't be hard to introduce support for customizable keyword variants.

I am not aware if logic related to discovery from where keyword comes still stays in plugin, but I think is possible to create filter/wrapper output of https://github.com/nokia/RED/blob/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/exec/descs/ExecutableRowDescriptorBuilder.java, which will get an information about keywords (basically if keyword with name is variant keyword) from plugin and will include information about treatment of ELSE, ELSE IF, END, or, and (case sensitive) in condition as special words.
It should return splitted variant keywords to execution lines understandable by validation logic. As the advantages of this solution the BuiltIn.Run Keywords can be handle in such approach as well.

from red.

adam-wypych avatar adam-wypych commented on August 14, 2024

As per Pekka response (robotframework/robotframework#2871 (comment))

We could easily document that nested used is not supported in Run Keyword If documentation.

So such nested ELSE usage should be mark as an error.

from red.

KrzysztofJozefowicz avatar KrzysztofJozefowicz commented on August 14, 2024

released in 0.8.7

from red.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.