Skip to content
Snippets Groups Projects
Commit 00b01329 authored by Arthur Vuagniaux's avatar Arthur Vuagniaux
Browse files

Issue #71: Update tests of ModelCreationTests.java

parent 08a96762
No related branches found
No related tags found
2 merge requests!87Test merge gui,!86Resolve "GUI automated tests"
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
package ui.bot; package ui.bot;
import org.assertj.swing.edt.GuiActionRunner; import org.assertj.swing.edt.GuiActionRunner;
import org.assertj.swing.finder.JFileChooserFinder;
import org.assertj.swing.fixture.FrameFixture; import org.assertj.swing.fixture.FrameFixture;
import org.assertj.swing.fixture.JFileChooserFixture;
import org.assertj.swing.fixture.JMenuItemFixture; import org.assertj.swing.fixture.JMenuItemFixture;
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase; import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
import org.junit.Test; import org.junit.Test;
...@@ -35,13 +37,61 @@ public class ModelCreationTests extends AssertJSwingJUnitTestCase { ...@@ -35,13 +37,61 @@ public class ModelCreationTests extends AssertJSwingJUnitTestCase {
* the tab New. Then save it. * the tab New. Then save it.
*/ */
TraceManager.addDev("==============" + System.lineSeparator() + TraceManager.addDev("==============" + System.lineSeparator() +
"MainFrameTest: createANewFile: Started"); "ModelCreationTests: creationOfAFile: Started");
JMenuItemFixture jmf = window.menuItem("File New"); JMenuItemFixture jmf = window.menuItem("File New");
TraceManager.addDev("MainFrameTest: createANewFile: Creating a new file by clicking on New"); TraceManager.addDev("ModelCreationTests: creationOfAFile: Creating a new file by clicking on New");
jmf.click(); jmf.click();
if (debug) if (debug)
ut.debugThread(3600, "MainFrameTest: createANewFile: "); ut.debugThread(3600, "ModelCreationTests: ccreationOfAFile: ");
TraceManager.addDev("MainFrameTest: createANewFile: File created"); TraceManager.addDev("ModelCreationTests: creationOfAFile: File created");
jmf = window.menuItem("File Save As Model");
TraceManager.addDev("ModelCreationTests: creationOfAFile: Saving the new model by clicking on Save As Model");
jmf.click();
if (debug)
ut.debugThread(3600, "ModelCreationTests: creationOfAFile: ");
JFileChooserFixture jfc = JFileChooserFinder.findFileChooser().using(robot());
TraceManager.addDev("ModelCreationTests: creationOfAFile: Writting the path ");
jfc.fileNameTextBox().pressAndReleaseKeys(ut.stringToKeyEvent("git/TTool/modeling/test"));
TraceManager.addDev("ModelCreationTests: creationOfAFile: End writting");
TraceManager.addDev("ModelCreationTests: creationOfAFile: Clicking on the Approval Button");
jfc.approveButton().click();
TraceManager.addDev("ModelCreationTests: creationOfAFile: Approve");
TraceManager.addDev("ModelCreationTests: creationOfAFile: File saved");
TraceManager.addDev("ModelCreationTests: creationOfAFile: Finished" +
System.lineSeparator() + "==============");
}
@Test
public void openAFile() {
/*
* Description : Open the file that had been created.
*/
TraceManager.addDev("==============" + System.lineSeparator() +
"ModelCreationTests: openAFile: Started");
JMenuItemFixture jmf = window.menuItem("File Model Project");
TraceManager.addDev("ModelCreationTests: openAFile: Clicking on Open Model, in order to open test.xml");
jmf.click();
if (debug)
ut.debugThread(3600, "ModelCreationTests: openAFile: ");
TraceManager.addDev("ModelCreationTests: openAFile: End Clicking");
TraceManager.addDev("ModelCreationTests: openAFile: Try to open the file test.xml");
JFileChooserFixture jfc = JFileChooserFinder.findFileChooser().using(robot());
TraceManager.addDev("ModelCreationTests: openAFile: Writting the path ");
jfc.fileNameTextBox().pressAndReleaseKeys(ut.stringToKeyEvent("git/TTool/modeling/test.xml"));
TraceManager.addDev("ModelCreationTests: openAFile: End writting");
TraceManager.addDev("ModelCreationTests: openAFile: Clicking on the Approval Button");
jfc.approveButton().click();
if (debug)
ut.debugThread(3600, "ModelCreationTests: openAFile: ");
TraceManager.addDev("ModelCreationTests: openAFile: Approve");
TraceManager.addDev("ModelCreationTests: openAFile: End loading the file");
TraceManager.addDev("ModelCreationTests: openAFile: Finished" +
System.lineSeparator() + "==============");
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment