Skip to content

Commit

Permalink
Support new instance/schema dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhy committed Apr 27, 2021
1 parent 693894e commit 1475c46
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
24 changes: 14 additions & 10 deletions datamapper-e2e/src/test/java/io/atlasmap/qe/test/AtlasMapInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,27 @@ public class AtlasMapInit implements EventListener {
page.enableTargetClass(TargetNestedCollectionClass.class.getName());

// Source documents:
page.enableSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceArrays.json");
page.enableSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceJsonArray.json");
page.enableSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceJson.schema.json");
page.enableSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceXMLInstance.xml");
page.enableSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceXMLSchema.xsd");
page.enableSourceDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "sourceArrays.json");
page.enableSourceDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "sourceJsonArray.json");
page.enableSourceDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "sourceXMLInstance.xml");

page.enableSourceDocumentSchema(TestConfiguration.getDocumentsFolderPath() + "sourceJson.schema.json");
page.enableSourceDocumentSchema(TestConfiguration.getDocumentsFolderPath() + "sourceXMLSchema.xsd");

page.enableCsvSourceDocument(TestConfiguration.getDocumentsFolderPath() + "sourceCsv.csv", "Default",
new HashMap<String, String>() {{
put("First Record As Header", "true");
}}
);

// Target documents:
page.enableTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetArrays.json");
page.enableTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetJsonArray.json");
page.enableTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetJson.schema.json");
page.enableTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetXMLSchema.xsd");
page.enableTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetXMLInstance.xml");
page.enableTargetDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "targetArrays.json");
page.enableTargetDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "targetJsonArray.json");
page.enableTargetDocumentInstance(TestConfiguration.getDocumentsFolderPath() + "targetXMLInstance.xml");

page.enableTargetDocumentSchema(TestConfiguration.getDocumentsFolderPath() + "targetJson.schema.json");
page.enableTargetDocumentSchema(TestConfiguration.getDocumentsFolderPath() + "targetXMLSchema.xsd");

page.enableCsvTargetDocument(TestConfiguration.getDocumentsFolderPath() + "targetCsv.csv", "Default",
new HashMap<String, String>() {{
put("First Record As Header", "true");
Expand Down
29 changes: 27 additions & 2 deletions datamapper-e2e/src/test/java/io/atlasmap/qe/test/AtlasMapPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,41 @@ public void enableCsvTargetDocument(String path, String format, Map<String, Stri
checkIfDocumentAppeared(path);
}

public void enableSourceDocument(String path) {
public void enableSourceDocumentInstance(String path) {
enableDocument(path, true);
setDocumentAsInstance(true);
checkIfDocumentAppeared(path);
}

public void enableTargetDocument(String path) {
public void enableTargetDocumentInstance(String path) {
enableDocument(path, false);
setDocumentAsInstance(true);
checkIfDocumentAppeared(path);
}

public void enableSourceDocumentSchema(String path) {
enableDocument(path, true);
setDocumentAsInstance(false);
checkIfDocumentAppeared(path);
}

public void enableTargetDocumentSchema(String path) {
enableDocument(path, false);
setDocumentAsInstance(false);
checkIfDocumentAppeared(path);
}

private void setDocumentAsInstance(boolean isInstance) {
$(ByUtils.dataTestId("specify-instance-schema-dialog-ok-button-test"))
.waitUntil(visible, TestConfiguration.getWaitTimeout());
if (isInstance) {
$(ByUtils.dataTestId("instance-radio-button-test")).click();
} else {
$(ByUtils.dataTestId("schema-radio-button-test")).click();
}
$(ByUtils.dataTestId("specify-instance-schema-dialog-ok-button-test")).click();
}

/**
* Gets filename from {@code path}. And checks if element with this filename appeared.
*/
Expand Down

0 comments on commit 1475c46

Please sign in to comment.