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

Please add debug functionality to "table template" , similar to "debug script" #43

Closed
pvbemmelen62 opened this issue Apr 8, 2022 · 5 comments

Comments

@pvbemmelen62
Copy link

I would like to be able to step through the lines of a table template: before each line is executed, a pause popup should be shown with the text of the line about to be executed.
That would be somewhat similar to the behaviour of a "debug script" table; but different, because

|debug script|
|show|echo|mama|
|show|echo|papa|

would step through the two show echo lines,
whereas

|create person|
|name|birthdate|address|
|sammy|2020-01-02|Sunny Vale, Backstreet 2|
|johnny|2021-03-04|Sunny Vale, Backstreet 4|

would step for each line above, through the lines defined in

|table template|create person|
|process name|$name|
|process address|$address|
|process birthdate|$birthdate|

I've asked this question also on
praegus/toolchain-fitnesse-plugin#33
but got no response; maybe I should have asked it here, under fhoeben.

For reference:

https://github.com/fhoeben/hsac-fitnesse-plugin/wiki/2.-Table-Template-Example

https://github.com/praegus/toolchain-fitnesse-plugin
Pausing table
Usage
| debug script | instead of | script | This will pause execution before each script table row and prompt the user to continue of stop the test, informing the user what the next instruction will be.

@fhoeben
Copy link
Owner

fhoeben commented Apr 8, 2022

@tcnh can you help @pvbemmelen62 ?

I never used the debug script feature of the praegus toolchain. I would just run the test page via my Java debugger (using FixtureDebugTest, replace 'HsacAcceptanceTests.SlimTests.UtilityFixtures' with the correct test) and place breakpoints at the appropriate methods of my fixtures being called.

@fhoeben fhoeben closed this as completed Apr 8, 2022
@tcnh
Copy link
Contributor

tcnh commented Apr 8, 2022

Just replace script before the table template call with debug script. This will step through the table template script line by line.

@pvbemmelen62
Copy link
Author

Many thanks fhoeben and tcnh .

The feature where a "debug script" table that precedes the table template call, will cause the table template call also to be of the "debug" type, is most useful.
For example:

|table template|show the family|
|show          |echo  |@{mama} |
|show          |echo  |@{papa} |

|debug script                |
|show|echo|debug script table|

|show the family|
|mama   |papa   |
|riet   |bert   |

The call to "show the family" will be of debug type: a pause popup will appear for each show echo line.
A somewhat unexpected feature, that deserves mentioning in the documentation.

I also tried the approach suggested by tcnh ; a breakpoint in

nl.hsac.fitnesse.fixture.slim.SlimFixture
    protected Object invoke(FixtureInteraction interaction, Method method, Object[] arguments) throws Throwable {
        return interaction.methodInvoke(method, this, arguments);
    }

allows me to see each Fitnesse line as it is being executed. It requires inspecting java variables, and takes more effort than the "debug script" approach, where a pause popup clearly shows each line being executed.

@tcnh
Copy link
Contributor

tcnh commented Apr 11, 2022

I can see how it may be surprising, but to call a template table you already have to be using a ScriptTableActor (this can be any script table, so it may also be a scenario, other table template, or - a debug script table or any other script table extension)

@pvbemmelen62
Copy link
Author

Is it the ScriptTableActor that is responsible for the debug behaviour ? I assumed it was the table type that implements the debug behaviour.

A scenario doesn't allow you to specify a table actor . Nor does a table template. So somewhere preceding them, there must always be a "script" or "debug script" table. Is that right ?

How can I definitively determine whether a certain table type is an extension of a script table ?

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

3 participants