Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD schrodinger test classes, AboutPage test suite
- Loading branch information
1 parent
8f14800
commit 8459fea
Showing
12 changed files
with
289 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,6 @@ dependency-reduced-pom.xml | |
/nb-configuration.xml | ||
/nbactions.xml | ||
|
||
.DS_Store | ||
.DS_Store | ||
|
||
tools/schrodinger/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...odinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/FeedbackBox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.evolveum.midpoint.schrodinger.component.common; | ||
|
||
|
||
import com.codeborne.selenide.Condition; | ||
import com.codeborne.selenide.SelenideElement; | ||
import com.evolveum.midpoint.schrodinger.MidPoint; | ||
import com.evolveum.midpoint.schrodinger.component.Component; | ||
import com.evolveum.midpoint.schrodinger.component.task.TaskBasicTab; | ||
import com.evolveum.midpoint.schrodinger.page.task.EditTaskPage; | ||
import com.evolveum.midpoint.schrodinger.util.Schrodinger; | ||
import org.openqa.selenium.By; | ||
|
||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
|
||
/** | ||
* Created by matus on 3/20/2018. | ||
*/ | ||
public class FeedbackBox<T> extends Component<T> { | ||
|
||
public FeedbackBox(T parent, SelenideElement parentElement) { | ||
super(parent, parentElement); | ||
} | ||
|
||
public Boolean isSuccess() { | ||
|
||
return getParentElement().$(By.cssSelector("div.feedback-message.box.box-solid.box-success")).waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT).exists(); | ||
|
||
} | ||
|
||
public Boolean isWarning() { | ||
|
||
return getParentElement().$(By.cssSelector("div.feedback-message.box.box-solid.box-warning")).waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT).exists(); | ||
|
||
} | ||
|
||
public Boolean isError() { | ||
|
||
return getParentElement().$(By.cssSelector("div.feedback-message.box.box-solid.box-danger")).waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT).exists(); | ||
|
||
} | ||
|
||
public Boolean isInfo() { | ||
|
||
return getParentElement().$(By.cssSelector("div.feedback-message.box.box-solid.box-info")).waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT).exists(); | ||
|
||
} | ||
|
||
public FeedbackBox clickShowAll() { | ||
|
||
$(Schrodinger.byDataId("showAll")).click(); | ||
|
||
return this; | ||
} | ||
|
||
public FeedbackBox clickClose() { | ||
|
||
$(Schrodinger.byDataId("close")).click(); | ||
|
||
return this; | ||
} | ||
|
||
public TaskBasicTab clickShowTask() { | ||
|
||
$(Schrodinger.byDataId("backgroundTask")).click(); | ||
SelenideElement taskBasicTab = $(Schrodinger.byDataResourceKey("pageTaskEdit.basic")); | ||
return new TaskBasicTab(new EditTaskPage(), taskBasicTab); | ||
} | ||
|
||
public Boolean isFeedbackBoxPresent() { | ||
|
||
return getParentElement().isDisplayed(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...rodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/SummaryBox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.evolveum.midpoint.schrodinger.component.common; | ||
|
||
import com.codeborne.selenide.SelenideElement; | ||
import com.evolveum.midpoint.schrodinger.component.Component; | ||
import com.evolveum.midpoint.schrodinger.util.Schrodinger; | ||
import org.openqa.selenium.By; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
/** | ||
* Created by matus on 3/21/2018. | ||
*/ | ||
public class SummaryBox<T> extends Component<T> { | ||
public SummaryBox(T parent, SelenideElement parentElement) { | ||
super(parent, parentElement); | ||
} | ||
|
||
public String fetchDisplayName() { | ||
|
||
return $(Schrodinger.byDataId("summaryDisplayName")).getText(); | ||
|
||
} | ||
|
||
// public String fetchCategory(){ | ||
// | ||
// return $(Schrodinger.byDataId("category")).getValue(); | ||
// | ||
// } | ||
} |
21 changes: 21 additions & 0 deletions
21
...rodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/task/TaskBasicTab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.evolveum.midpoint.schrodinger.component.task; | ||
|
||
import com.codeborne.selenide.SelenideElement; | ||
import com.evolveum.midpoint.schrodinger.component.Component; | ||
import com.evolveum.midpoint.schrodinger.page.task.EditTaskPage; | ||
import com.evolveum.midpoint.schrodinger.util.Schrodinger; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
/** | ||
* Created by matus on 3/21/2018. | ||
*/ | ||
public class TaskBasicTab extends Component<EditTaskPage> { | ||
public TaskBasicTab(EditTaskPage parent, SelenideElement parentElement) { | ||
super(parent, parentElement); | ||
} | ||
|
||
public String utility() { | ||
return getParentElement().$(Schrodinger.byDataId("category")).getText(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 28 additions & 14 deletions
42
...odinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/AboutPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,73 @@ | ||
package com.evolveum.midpoint.schrodinger.page.configuration; | ||
|
||
import com.codeborne.selenide.SelenideElement; | ||
import com.evolveum.midpoint.schrodinger.component.common.FeedbackBox; | ||
import com.evolveum.midpoint.schrodinger.page.BasicPage; | ||
import com.evolveum.midpoint.schrodinger.util.Schrodinger; | ||
import org.openqa.selenium.By; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class AboutPage extends BasicPage { | ||
|
||
public AboutPage repositorySelfTest() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.testRepository")).click(); | ||
return this; | ||
} | ||
|
||
public AboutPage checkAndRepairOrgClosureConsistency() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.testRepositoryCheckOrgClosure")).click(); | ||
return this; | ||
} | ||
|
||
public AboutPage reindexRepositoryObjects() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.reindexRepositoryObjects")).click(); | ||
return this; | ||
} | ||
|
||
public AboutPage provisioningSelfTest() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.testProvisioning")).click(); | ||
return this; | ||
} | ||
|
||
public AboutPage cleanupActivitiProcesses() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.cleanupActivitiProcesses")).click(); | ||
return this; | ||
} | ||
|
||
public AboutPage clearCssJsCache() { | ||
// todo implement | ||
$(Schrodinger.byDataResourceKey("PageAbout.button.clearCssJsCache")).click(); | ||
return this; | ||
} | ||
|
||
public String version() { | ||
// todo implement | ||
return null; | ||
return $(Schrodinger.bySchrodingerDataId("wicket_message-1130625241")).parent().getText(); | ||
} | ||
|
||
public String gitDescribe() { | ||
// todo implement | ||
return null; | ||
return $(Schrodinger.bySchrodingerDataResourceKey("PageAbout.midPointRevision")).parent().getText(); | ||
} | ||
|
||
public String buildAt() { | ||
// todo implement | ||
return null; | ||
return $(Schrodinger.bySchrodingerDataId("build")).parent().getText(); | ||
} | ||
|
||
public String hibernateDialect() { | ||
// todo implement | ||
return null; | ||
SelenideElement aditionalDetails = $(Schrodinger.bySchrodingerDataId("wicket_message-1130625231")); | ||
return $(Schrodinger.bySchrodingerDataId("detailValue")).parent().getText(); | ||
} | ||
|
||
public String connIdFrameworkVersion() { | ||
return $(Schrodinger.bySchrodingerDataId("provisioningDetailValue")).parent().getText(); | ||
} | ||
|
||
public FeedbackBox<AboutPage> feedback() { | ||
|
||
SelenideElement feedback = $(By.cssSelector("div.feedbackContainer")); | ||
return new FeedbackBox<>(this, feedback); | ||
} | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
...s/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/task/EditTaskPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.evolveum.midpoint.schrodinger.page.task; | ||
|
||
import com.codeborne.selenide.SelenideElement; | ||
import com.evolveum.midpoint.schrodinger.component.common.SummaryBox; | ||
import com.evolveum.midpoint.schrodinger.page.BasicPage; | ||
import org.openqa.selenium.By; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
|
||
/** | ||
* Created by matus on 3/21/2018. | ||
*/ | ||
public class EditTaskPage extends BasicPage { | ||
|
||
|
||
|
||
public SummaryBox<EditTaskPage> summary (){ | ||
|
||
SelenideElement summaryBox =$(By.cssSelector("div.info-box-content")); | ||
|
||
return new SummaryBox(this,summaryBox); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class NewTaskPage extends BasicPage { | ||
|
||
} |
98 changes: 98 additions & 0 deletions
98
tools/schrodinger/src/test/java/schrodinger/AboutPageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package schrodinger; | ||
|
||
import com.evolveum.midpoint.schrodinger.page.configuration.AboutPage; | ||
import org.testng.Assert; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Created by matus on 3/16/2018. | ||
*/ | ||
public class AboutPageTest extends TestBase { | ||
|
||
private static final String VERSION_EXPECTED = "3.8-SNAPSHOT"; // Static value, should be changed each version change. | ||
private static final String HIBERNATE_DIALECT_EXPECTED = "org.hibernate.dialect.H2Dialect"; | ||
private static final String CONNID_VERSION_EXPECTED = "1.4.3.11"; // Static value, should be changed each version change. | ||
private static final String REINDEX_REPO_TASK_CATEGORY_EXPECTED = "Utility"; | ||
private static final String REINDEX_REPO_TASK_DISPLAY_NAME_EXPECTED = "Reindex repository objects"; | ||
private AboutPage aboutPage; | ||
|
||
@BeforeMethod | ||
private void openPage() { | ||
aboutPage = basicPage.aboutPage(); | ||
} | ||
|
||
@Test | ||
public void checkMidpointVersion() { | ||
Assert.assertEquals(aboutPage.version(), VERSION_EXPECTED); | ||
} | ||
|
||
@Test | ||
public void checkGitDescribeValue() { | ||
Assert.assertTrue(!aboutPage | ||
.gitDescribe() | ||
.isEmpty() | ||
); | ||
} | ||
|
||
@Test | ||
public void checkBuildAt() { | ||
Assert.assertTrue(!aboutPage | ||
.buildAt() | ||
.isEmpty() | ||
); | ||
} | ||
|
||
//@Test // TODO fix select the right element | ||
public void checkHibernateDialect() { | ||
Assert.assertEquals(aboutPage.hibernateDialect(), HIBERNATE_DIALECT_EXPECTED); | ||
} | ||
|
||
@Test | ||
public void checkConnIdVersion() { | ||
Assert.assertEquals(aboutPage.connIdFrameworkVersion(), CONNID_VERSION_EXPECTED); | ||
} | ||
|
||
@Test | ||
public void repoSelfTestFeedbackPositive() { | ||
|
||
Assert.assertTrue(aboutPage | ||
.repositorySelfTest() | ||
.feedback() | ||
.isSuccess() | ||
); | ||
} | ||
|
||
@Test | ||
public void reindexRepositoryObjectsFeedbackInfo() { | ||
Assert.assertTrue(aboutPage | ||
.reindexRepositoryObjects() | ||
.feedback() | ||
.isInfo() | ||
); | ||
|
||
} | ||
|
||
@Test | ||
public void checkReindexRepositoryObjectsCategory() { | ||
|
||
Assert.assertEquals(aboutPage | ||
.reindexRepositoryObjects() | ||
.feedback() | ||
.clickShowTask() | ||
.utility() | ||
, REINDEX_REPO_TASK_CATEGORY_EXPECTED); | ||
} | ||
|
||
@Test | ||
public void checkReindexRepositoryObjectsDisplayName() { | ||
Assert.assertEquals(aboutPage | ||
.reindexRepositoryObjects() | ||
.feedback() | ||
.clickShowTask() | ||
.and() | ||
.summary() | ||
.fetchDisplayName() | ||
, REINDEX_REPO_TASK_DISPLAY_NAME_EXPECTED); | ||
} | ||
} |
Oops, something went wrong.