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
feat: Enable usage of ${...} expressions for checkbox controls #5944
Conversation
Yes interresting feature. Be carreful with compatibility with current Jmeter script. |
I've added property descriptors, and the missing bit is to link "editable combobox" with |
71951f9
to
3943b08
Compare
I rearranged the commits, and will split them into different PRs soon. For reference, here are the changes to migrate - private final JCheckBox serializedMode;
+ private final JBooleanPropertyEditor serializedMode =
+ new JBooleanPropertyEditor(TestPlanSchema.INSTANCE.getSerializeThreadgroups(), "testplan.serialized");
- tp.setSerialized(serializedMode.isSelected());
+ serializedMode.updateElement(tp);
- serializedMode.setSelected(tp.isSerialized());
+ serializedMode.updateUi(tp);
- serializedMode.setSelected(false);
+ serializedMode.reset(); It looks good to me. |
abef36a
to
3ad3446
Compare
bad1471
to
5a19be5
Compare
JMeterProperty jmp = getPropertyOrNull(key); | ||
return jmp == null || jmp instanceof NullProperty ? defaultValue : jmp.getIntValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly speaking, getPropertyOrNull
followed by instanceof NullProperty
look strange, however, I do not change it in the current PR.
However, it would probably make sense to revise it later.
65cb835
to
f9f292e
Compare
I'm happy with the code and behaviour, so I will merge this soon |
…rmer The existing ValueTransformer includes "master function" and "variables" that make no sense for most transformers. The old interface is kept for backward compatibility
The checkbox can be converted to an editable field by calling a context menu: * right-click on the checkbox * or press shift+F10 The editable box converts back to a checkbox if you select "true" or "false" Fixes apache#1252 See apache#5761
…ve, use_multipart_post, and browser_compatible_multipart fixes apache#1252
Perhaps need add refresh the UI when it's switch the checkbox to expression field (and return). See video. simplescreenrecorder-2023-06-07_09.39.21.mp4 |
Good catch. It updates automatically in Darklaf themes, and almost all the others fail to update. |
I've added relayout in f4d312c |
…nges visible element By default, CardLayout consumes the space which accomodates all its children, however CardLayoutWithSizeOfCurrentVisibleElement consumes only the space needed for the currently visible element. That is why CardLayout does not need to trigger layout on changes. Fixes #5944 (comment)
Hi, Regards. |
Description
The checkbox can be converted to an editable field by calling a context menu:
The editable box converts back to a checkbox if you select "true" or "false"
Fixes #1252
See #5761
Motivation and Context
Previously, JMeter did not allow users to use
${...}
expressions for checkbox elements, however, there are cases when the checkbox should be customizable.For instance, users might want to test different values
enable keepalive
setting, and currently it is not possible to configure it from a property file.How Has This Been Tested?
Only manual testing for now :-/
Screenshots (if appropriate):
The second
Run Thread Groups consecutively
element is the new checkbox. It behaves like a usual checkbox.However, it has a popup menu (right-click or shift+F10) so the users can convert it to an expression:
The editable element looks like an editable combobox:
Users can type
up
,down
to select a predefined value, or they can selecttrue
orfalse
in which case the element would collapse to a checkbox again:Open questions
It is unclear what we do with methods like
org.apache.jmeter.testelement.TestPlan#setSerialized(boolean)
andboolean org.apache.jmeter.testelement.TestPlan#isSerialized()
.We might add a second pair of getter and setter for exposing the property as
String
, so the UI element can propagate the free-form text expression to the test plan configuration.I remember I had the same issue with
OpenModelThreadGroup
where I created two propertiesrandomSeed: Long
andrandomSeedString: String
:jmeter/src/core/src/main/kotlin/org/apache/jmeter/threads/openmodel/OpenModelThreadGroup.kt
Lines 91 to 100 in 4d9d99a
Duplicating properties does not look nice :-(
Checklist: