Commit 63970f26 authored by Robert Smith's avatar Robert Smith

Updated swtbot tests

Updated the swtbot integration tests.
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent 7f0d9d9e
......@@ -66,21 +66,21 @@ public class VIBEKeyValuePairTester extends AbstractWorkbenchTester {
assertTrue(bot.button("Cancel").isEnabled());
//The table should be empty at the start
assertEquals(0, bot.table().rowCount());
assertEquals(0, bot.table(1).rowCount());
//Set the table to the NTG template
bot.radio(1).click();
// Check the table's values for the default settings
assertTrue("ELECTRICAL".equals(bot.table().cell(0, 0)));
assertTrue("ELECTRICAL".equals(bot.table(1).cell(0, 0)));
// Change the first row's value to two
bot.table().click(0, 1);
bot.table(1).click(0, 1);
bot.text("1 ", 0).setText("2");
bot.table().click(0, 0);
bot.table(1).click(0, 0);
// Check that the cell was set
assertTrue("2".equals(bot.table().cell(0, 1)));
assertTrue("2".equals(bot.table(1).cell(0, 1)));
// Makes sure the form registers that it is dirty
assertTrue("There are unsaved changes on the form."
......@@ -91,19 +91,19 @@ public class VIBEKeyValuePairTester extends AbstractWorkbenchTester {
assertTrue(bot.clabel(0).getText().equals("Ready to process."));
// Make sure there are 21 rows
assertEquals(21, bot.table().rowCount());
assertEquals(21, bot.table(1).rowCount());
// Add a row and check that it is there.
bot.button("+").click();
assertEquals(22, bot.table().rowCount());
assertEquals(22, bot.table(1).rowCount());
// Remove the second from last row and test that there are one fewer
// rows and that the last row is empty.
bot.table().click(20, 0);
bot.table(1).click(20, 0);
bot.button("-").click();
assertEquals(21, bot.table().rowCount());
System.out.println(bot.table().cell(20, 0));
assertTrue("".equals(bot.table().cell(20, 0)));
assertEquals(21, bot.table(1).rowCount());
System.out.println(bot.table(1).cell(20, 0));
assertTrue("".equals(bot.table(1).cell(20, 0)));
// Check that the form reports the job as complete after performing it.
bot.button("Go!").click();
......@@ -113,27 +113,27 @@ public class VIBEKeyValuePairTester extends AbstractWorkbenchTester {
bot.radio(2).click();
// Check that a couple of the DualFoil's rows are set up correctly
assertTrue("NUMSEG".equals(bot.table().cell(14, 0)));
assertTrue("CUTOFFL".equals(bot.table().cell(17, 0)));
assertTrue("2.0,2.0,2.0,2.0,2.0".equals(bot.table().cell(17, 1)));
assertTrue("NUMSEG".equals(bot.table(1).cell(14, 0)));
assertTrue("CUTOFFL".equals(bot.table(1).cell(17, 0)));
assertTrue("2.0,2.0,2.0,2.0,2.0".equals(bot.table(1).cell(17, 1)));
// Set the NUMSEG key to 8.
bot.table().click(14, 1);
bot.table(1).click(14, 1);
bot.text("5", 0).setText("8");
bot.table().click(14, 0);
bot.table(1).click(14, 0);
// CUTOFFL should have had its vector increased in size to account for
// the new NUMSEG value
assertTrue("2.0,2.0,2.0,2.0,2.0,0.0,0.0,0.0"
.equals(bot.table().cell(17, 1)));
.equals(bot.table(1).cell(17, 1)));
// Set NUMSEG to 4
bot.table().click(14, 1);
bot.table(1).click(14, 1);
bot.text("8", 0).setText("4");
bot.table().click(14, 0);
bot.table(1).click(14, 0);
// CUTOFFL should have been reduced to only 4 numbers
assertTrue("2.0,2.0,2.0,2.0".equals(bot.table().cell(17, 1)));
assertTrue("2.0,2.0,2.0,2.0".equals(bot.table(1).cell(17, 1)));
}
}
......@@ -86,24 +86,24 @@ public class VIBELauncherTester extends AbstractWorkbenchTester {
assertTrue(bot.button("Browse...", 1).isEnabled());
//Check the host table's initial contents
assertTrue("localhost".equals(bot.table().cell(0, 0)));
assertEquals(1, bot.table().rowCount());
assertTrue("localhost".equals(bot.table(1).cell(0, 0)));
assertEquals(1, bot.table(1).rowCount());
//Add a row and check that it was added correctly
bot.button("+").click();
assertEquals(2, bot.table().rowCount());
assertTrue("".equals(bot.table().cell(1, 0)));
assertEquals(2, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(1, 0)));
//Try editing the table and ensure the change was accepted
bot.table().click(1, 0);
bot.table(1).click(1, 0);
bot.text("").typeText("8.8.8.8");
bot.table().click(0, 0);
assertTrue("8.8.8.8".equals(bot.table().cell(1, 0)));
bot.table(1).click(0, 0);
assertTrue("8.8.8.8".equals(bot.table(1).cell(1, 0)));
//Remove a row from the table and check that it is gone
bot.button("-").click();
assertEquals(1, bot.table().rowCount());
assertTrue("8.8.8.8".equals(bot.table().cell(0, 0)));
assertEquals(1, bot.table(1).rowCount());
assertTrue("8.8.8.8".equals(bot.table(1).cell(0, 0)));
//Remove rows until the table is empty and remove another. Nothing should happen.
bot.button("-").click();
......
......@@ -54,29 +54,29 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
// Save after each one to reset the header.
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
bot.comboBox().setSelection(1);
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
bot.comboBox().setSelection(2);
bot.button("Go!").click();
assertTrue("Done!".equals(bot.clabel(0).getText()));
bot.table(0).click(0, 0);
bot.table(0).click(1, 0);
bot.table(1).click(0, 0);
bot.table(1).click(1, 0);
// Try editing the global configuration table and ensure the change
// was accepted
bot.table(0).click(1, 0);
bot.table(1).click(1, 0);
bot.text(5).typeText("Edited name");
// bot.text().setText("Edited name");
bot.table(0).click(0, 0);
assertTrue("Edited name".equals(bot.table(0).cell(1, 0)));
bot.table(1).click(0, 0);
assertTrue("Edited name".equals(bot.table(1).cell(1, 0)));
// Check that this made the form dirty
assertTrue("There are unsaved changes on the form."
......@@ -87,18 +87,18 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
assertTrue(bot.clabel(0).getText().equals("Ready to process."));
// Check the global configuration table's initial contents
assertEquals(20, bot.table(0).rowCount());
assertEquals(20, bot.table(1).rowCount());
// Add a row and check that it was added correctly
bot.button("+").click();
assertEquals(21, bot.table(0).rowCount());
assertTrue("".equals(bot.table(0).cell(20, 0)));
assertEquals(21, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(20, 0)));
// Remove a row from the table and check that it is gone
bot.table(0).click(0, 0);
bot.table(1).click(0, 0);
bot.button("-").click();
assertEquals(20, bot.table(0).rowCount());
assertTrue("".equals(bot.table(0).cell(19, 0)));
assertEquals(20, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(19, 0)));
// Remove rows until the table is empty and remove another. Nothing
// should happen.
......@@ -107,24 +107,24 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
}
// Try editing the table and ensure the change was accepted
bot.table(1).click(1, 0);
bot.table(2).click(1, 0);
bot.text("DRIVER").typeText("Edited port");
bot.table(1).click(0, 0);
assertTrue("Edited port".equals(bot.table(1).cell(1, 0)));
bot.table(2).click(0, 0);
assertTrue("Edited port".equals(bot.table(2).cell(1, 0)));
// Check the ports table's initial contents
assertEquals(5, bot.table(1).rowCount());
assertEquals(5, bot.table(2).rowCount());
// Add a row and check that it was added correctly
bot.button("+", 1).click();
assertEquals(6, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(5, 0)));
assertEquals(6, bot.table(2).rowCount());
assertTrue("".equals(bot.table(2).cell(5, 0)));
// Remove a row from the table and check that it is gone
bot.table(1).click(0, 0);
bot.table(2).click(0, 0);
bot.button("-", 1).click();
assertEquals(5, bot.table(1).rowCount());
assertTrue("".equals(bot.table(1).cell(4, 0)));
assertEquals(5, bot.table(2).rowCount());
assertTrue("".equals(bot.table(2).cell(4, 0)));
// Remove rows until the table is empty and remove another. Nothing
// should happen.
......@@ -142,15 +142,15 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
// Test each of the default options, making sure they have at least the
// correct number of text fields enabled.
bot.table(0).select(0);
bot.table(1).select(0);
bot.text(9).typeText("Test");
bot.table(0).select(1);
bot.table(1).select(1);
bot.text(11).typeText("Test");
bot.table(0).select(2);
bot.table(1).select(2);
bot.text(11).typeText("Test");
bot.table(0).select(3);
bot.table(1).select(3);
bot.text(11).typeText("Test");
bot.table(0).select(4);
bot.table(1).select(4);
bot.text(11).typeText("Test");
// Check each of the port types available in the menu and check the
......@@ -158,31 +158,31 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
bot.button(2).click();
bot.table().select("INIT_STATE");
bot.button("OK").click();
bot.table(0).select(5);
bot.table(1).select(5);
bot.text(11).typeText("Test");
bot.button(2).click();
bot.table().select("AMPERES_THERMAL");
bot.button("OK").click();
bot.table(0).select(6);
bot.table(1).select(6);
bot.text(11).typeText("Test");
bot.button(2).click();
bot.table().select("AMPERES_ELECTRICAL");
bot.button("OK").click();
bot.table(0).select(7);
bot.table(1).select(7);
bot.text(11).typeText("Test");
bot.button(2).click();
bot.table().select("CHARTRAN_ELECTRICAL_THERMAL_DRIVER");
bot.button("OK").click();
bot.table(0).select(8);
bot.table(1).select(8);
bot.text(9).typeText("Test");
bot.button(2).click();
bot.table().select("NTG");
bot.button("OK").click();
bot.table(0).select(9);
bot.table(1).select(9);
bot.text(11).typeText("Test");
bot.button(2).click();
......@@ -191,24 +191,24 @@ public class VIBEModelTester extends AbstractWorkbenchTester {
// Dualfoil doesn't have any text boxes, count the number of rows in the
// table to see if it was added instead.
assertEquals(11, bot.table(0).rowCount());
assertEquals(11, bot.table(1).rowCount());
bot.button(2).click();
bot.table().select("AMPERES");
bot.button("OK").click();
bot.table(0).select(11);
bot.table(1).select(11);
bot.text(11).typeText("Test");
bot.button(2).click();
bot.table().select("CHARTRAN_THERMAL_DRIVER");
bot.button("OK").click();
bot.table(0).select(12);
bot.table(1).select(12);
bot.text(8).typeText("Test");
// Delete a row and make sure it's gone
bot.table().select(0);
bot.button("Delete").click();
assertTrue("11 DUALFOIL".equals(bot.table(0).cell(9, 0)));
bot.button(3).click();
assertTrue("11 DUALFOIL".equals(bot.table(1).cell(9, 0)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment