Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] adapt field validation in custom migration targets #690

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.");
Neilhamza marked this conversation as resolved.
Show resolved Hide resolved

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
Loading