How to create and launch UI tests on NetBeans platform and NetBeans 23 IDE #7867
Sova777
started this conversation in
Tips, Tricks and Workarounds
Replies: 3 comments 1 reply
-
hey @Sova777 thank you very much for this cool tutorial. There is an official Wiki where it should be better put this: https://netbeans.apache.org/wiki/main/wiki/ If you want. It is like the old wiki how to do thngs :). Great work. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Example of real test. Create Java project, open Project Properties window, switch off Compile on Save checkbox: final String SAMPLE_PROJECT_NAME = "uitest_" + System.currentTimeMillis();
NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
// "Standard"
String standardLabel = "Java with Maven";
npwo.selectCategory(standardLabel);
// "Java Application"
String javaApplicationLabel = "Java Application";
npwo.selectProject(javaApplicationLabel);
npwo.next();
NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user"));
npnlso.btFinish().pushNoBlock();
npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
npnlso.waitClosed();
// wait project appear in projects view
new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);
//disable the compile on save:
ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
// "Project Properties"
String projectPropertiesTitle = "Project Properties";
NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
// select "Compile" category
String buildCategoryTitle = "Build";
String compileCategoryTitle = "Compile";
new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
// actually disable the quick run:
String compileOnSaveLabel = "Compile on Save";
JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
if (cb.isSelected()) {
cb.doClick();
}
// confirm properties dialog
propertiesDialogOper.ok(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
And video tutorial: https://www.youtube.com/watch?v=qPFJk6VqD3U |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Create UI test for NetBeans platform
Create UI test for NetBeans IDE
Beta Was this translation helpful? Give feedback.
All reactions