GH Issue 1257: Check for duplicates among field names, import aliases, and parent import aliases - #3128
Conversation
…, and parent import aliases
…le to all domains and tap into domain designer error messaging
| updatePage.getFieldsPanel().addField("DupeAliasCheck") | ||
| .setImportAliases(GOOD_PARENT_NAME); | ||
| errors = updatePage.clickSaveExpectingErrors(); | ||
| errorMsgExpectedTxt = "Field DupeAliasCheck has an import alias " + GOOD_PARENT_NAME + " that conflicts with a parent alias header."; |
There was a problem hiding this comment.
any reason we need to add some checks for the other cases here like having multiple fields that have the same import alias or having an import alias that matches a parent alias? Or maybe some of that could be covered with junit tests (not sure what our validation coverage looks like there for domains).
There was a problem hiding this comment.
I didn't include that here because this test class is specifically for SampleTypeParentColumnTest. So, tests aren't completely done for this branch.
| checker().verifyThat("Expected an error when two fields share an import alias differing only by case", | ||
| String.join("\n", createPage.clickSaveExpectingErrors()), | ||
| containsString("You have 2 field errors.")); | ||
| checker().screenShotIfNewError("duplicateImportAliasIgnoringCase"); |
There was a problem hiding this comment.
FYI, you can give a screenshot name to the .withScreenshot call:
checker().withScreenshot("duplicateImportAlias").verifyThat("Expected an error when two fields share an import alias",
| checker().verifyThat("Expected an error when an import alias matches another field's name", | ||
| String.join("\n", createPage.clickSaveExpectingErrors()), | ||
| containsString("Import alias '" + fieldTwo + "' on field '" + fieldOne + "' conflicts with a field name.")); | ||
| checker().screenShotIfNewError("importAliasConflictsWithFieldName"); |
There was a problem hiding this comment.
Same comment as above.
Rationale
Issue 1257:
Related Pull Requests
Changes