RFR: 8319555: [TestBug] Utility for creating instruction window for manual tests [v4]

Alexander Matveev almatvee at openjdk.org
Mon Apr 8 22:50:09 UTC 2024


On Mon, 8 Apr 2024 15:04:24 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> ## ManualTestWindow
>> 
>> This facility provides a framework for manual tests to display test instructions, test pane, and Pass/Fail buttons.
>> 
>> A simple test would look like this:
>> 
>> 
>> public class SampleManualTest {
>>      public static void main(String[] args) throws Exception {
>>          ManualTestWindow.builder().
>>              title("Sample Manual Test").
>>              instructions(
>>                  """
>>                  Provide
>>                  multi-line instructions here.
>>                  """
>>              ).
>>              ui(() -> createTestUI()).
>>              buildAndRun();
>>      }
>> 
>>      private static Node createTestUI() {
>>          return new Label("Test UI");
>>      }
>> }
>> 
>> 
>> Resulting application window:
>> 
>> ![ManualTestWindow](https://github.com/openjdk/jfx/assets/107069028/15b34a8f-cb0d-4469-85bc-ec5962e448c7)
>> 
>> Readme:
>> 
>> https://github.com/openjdk/jfx/blob/1cc095049be3773e1211ad570eb2285f08f25cec/tests/manual/util/README.md
>> 
>> @prrace 's test EmojiTest has been converted to use the new test window as a demonstration (also fixed the Eclipse project so it works now).
>> 
>> Q: What other features can be added to the test window?
>> 
>> Edit: the sources are left in their original place at the root of the project.
>
> Andy Goryachev has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - works
>  - .

tests/manual/util/README.md line 19:

> 17:                  multi-line instructions here.
> 18:                  """
> 19:              ).

Add `size(1200, 800).` to example. I think adjusting size will be common enough and no need to look at `ManualTestWindow` to figure it out.

tests/manual/util/README.md line 30:

> 28: ```
> 29: 
> 30: Resulting application window:

Resulting application window does not look like it is from example above. Not sure if it is important.

tests/manual/util/src/com/oracle/util/testing/ManualTestWindow.java line 89:

> 87: // TODO log area
> 88: // TODO screenshots on failure?
> 89: // TODO initial position?

In general I do not like TODO in comments. You can file follow up issue to improve/extend `ManualTestWindow` if needed.

tests/manual/util/src/com/oracle/util/testing/ManualTestWindow.java line 250:

> 248:             Scene scene = new Scene(vb);
> 249:             stage.setWidth(width == 0 ? 800 : width);
> 250:             stage.setHeight(height == 0 ? 600 : height);

I think `width` and `height` is `double` and not `int`. Also, lets not change it. If test wants 0, then pass 0.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1413#discussion_r1556487869
PR Review Comment: https://git.openjdk.org/jfx/pull/1413#discussion_r1556488908
PR Review Comment: https://git.openjdk.org/jfx/pull/1413#discussion_r1556491820
PR Review Comment: https://git.openjdk.org/jfx/pull/1413#discussion_r1556500553


More information about the openjfx-dev mailing list