Skip to content

Commit

Permalink
[RFR] adapt field validation in custom migration targets
Browse files Browse the repository at this point in the history
Signed-off-by: Neilhamza <[email protected]>
  • Loading branch information
Neilhamza committed Aug 23, 2023
1 parent 098fd5d commit 71947cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe(["@tier1"], "Custom Migration Target Validations", () => {
validateTooLongInput(CustomMigrationTargetView.nameInput);

CustomMigrationTarget.fillName("Containerization");
cy.get(CustomMigrationTargetView.nameHelper).contains(
cy.get(CustomMigrationTargetView.helperText).contains(
"A custom target with this name already exists. Use a different name"
);

Expand Down Expand Up @@ -113,18 +113,12 @@ describe(["@tier1"], "Custom Migration Target Validations", () => {
CustomMigrationTarget.selectRepositoryType(RepositoryType.git);

CustomMigrationTarget.fillRepositoryUrl(" ");
cy.get(CustomMigrationTargetView.repositoryUrlHelper).should(
"contain",
"Must be a valid URL."
);
cy.get(CustomMigrationTargetView.helperText).should("contain", "Must be a valid URL.");

CustomMigrationTarget.fillRepositoryUrl("Invalid url");
cy.get(CustomMigrationTargetView.repositoryUrlHelper).should(
"contain",
"Must be a valid URL."
);
cy.get(CustomMigrationTargetView.helperText).should("contain", "Must be a valid URL.");

CustomMigrationTarget.fillRepositoryUrl("https://github.com/konveyor/tackle-testapp");
cy.get(CustomMigrationTargetView.repositoryUrlHelper).should("not.exist");
cy.get(CustomMigrationTargetView.helperText).should("not.contain", "Must be a valid URL.");
});
});
7 changes: 3 additions & 4 deletions cypress/e2e/views/custom-migration-target.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ export enum CustomMigrationTargetView {
editSubmitButton = "button[id='identity-form-submit']:contains('Save')",
actionsButton = "button[aria-label=Actions]",
nameInput = "#name",
nameHelper = "#name-helper",
helperText = "span[class*='helper-text']",
descriptionInput = "#description",
imageInput = "#custom-migration-target-upload-image-filename",
imageHelper = "#custom-migration-target-upload-image-helper",
ruleInput = "input[accept='.xml']",
ruleHelper = "div[aria-label='Danger Alert']",
ruleInput = "input[accept*='.xml']",
ruleHelper = "h4[class*='alert__title']",
ruleFilesToggle = "button[aria-expanded='true']",
takeMeThereNotification = "Take me there",
repositoryTypeDropdown = "#repo-type-select-toggle",
repositoryUrl = "#sourceRepository",
repositoryUrlHelper = "#sourceRepository-helper",
branch = "#branch",
rootPath = "#rootPath",
credentialsDropdown = "#associated-credentials-select-toggle",
Expand Down

0 comments on commit 71947cc

Please sign in to comment.