@Test(groups = "web") public void testListDefaultGroupsValidationUser() throws IOException { tester.clickLinkWithText(getProperty("action.logout")); if (!personDao.usernameExists("*****@*****.**")) { Person person = TestUtils.createPersonForTesting("*****@*****.**", Util.ROLE_USER); person.setConfirmed(true); personDao.create(person); } tester.setTextField("userName", "*****@*****.**"); tester.setTextField("password", "stebjan"); tester.clickButtonWithText(getProperty("action.login")); tester.assertTextPresent(getProperty("action.logout")); tester.clickLinkWithText(getProperty("menuItem.lists")); tester.assertTextPresent(getProperty("pageTitle.listOfDefinitions")); tester.assertLinkPresentWithText(getProperty("menuItem.hardwareDefinitions")); tester.clickLinkWithText(getProperty("menuItem.hardwareDefinitions")); tester.assertSelectOptionNotPresent("groups", "Default hardware"); tester.clickLinkWithText(getProperty("menuItem.optionalParametersForPeople")); tester.assertSelectOptionNotPresent("groups", "Default optional parameters"); tester.clickLinkWithText(getProperty("menuItem.optionalParametersForExperiments")); tester.assertSelectOptionNotPresent("groups", "Default optional parameters"); tester.clickLinkWithText(getProperty("menuItem.fileMetadataDefinitions")); tester.assertSelectOptionNotPresent("groups", "Default metadata parameters"); tester.clickLinkWithText(getProperty("menuItem.weatherDefinitions")); tester.assertSelectOptionNotPresent("groups", "Default weather"); tester.clickLinkWithText(getProperty("action.logout")); }
@BeforeMethod(groups = "web") public void setUp() { if (!personDao.usernameExists("*****@*****.**")) { Person person = TestUtils.createPersonForTesting("*****@*****.**", Util.ROLE_USER); person.setConfirmed(true); personDao.create(person); } tester = new WebTester(); tester.setScriptingEnabled(false); // tester.setBaseUrl("http://eeg2.kiv.zcu.cz:8080"); tester.setBaseUrl(url); tester.beginAt("/home-page"); }
@BeforeMethod(groups = "unit") public void setUp() throws Exception { Person person = TestUtils.createPersonForTesting("*****@*****.**", Util.ROLE_ADMIN); personDao.create(person); researchGroup = new ResearchGroup(); researchGroup.setDescription("test-description"); researchGroup.setTitle("test-title"); researchGroup.setPerson(person); researchGroupDao.create(researchGroup); artifact = new Artifact(); artifact.setCompensation("test comp"); artifact.setRejectCondition("test condition"); }
@BeforeMethod(groups = "web") public void setUp() throws IOException { if (!personDao.usernameExists("*****@*****.**")) { Person person = TestUtils.createPersonForTesting("*****@*****.**", Util.ROLE_USER); person.setConfirmed(true); personDao.create(person); } tester = new WebTester(); tester.setBaseUrl(url); tester.beginAt("/home-page"); tester.setTextField("userName", "*****@*****.**"); tester.setTextField("password", "stebjan"); tester.clickButtonWithText(getProperty("action.login")); tester.assertTextPresent(getProperty("action.logout")); }