-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into MGMT-17121-cluster-name-not-shown-validati…
…on-with-illegal-characters
- Loading branch information
Showing
19 changed files
with
124 additions
and
28 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
71 changes: 71 additions & 0 deletions
71
...lib-tests/cypress/integration/use-cases/create-cluster/validations-new-cluster-page.cy.ts
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,71 @@ | ||
import { NewClusterPage } from '../../../views/pages/NewClusterPage'; | ||
import { ClusterDetailsForm } from '../../../views/forms/ClusterDetails/ClusterDetailsForm'; | ||
import { clusterDetailsPage } from '../../../views/clusterDetails'; | ||
|
||
describe('Create a new cluster and show correct validations for every field', () => { | ||
const setTestStartSignal = (activeSignal: string) => { | ||
cy.setTestEnvironment({ | ||
activeSignal, | ||
activeScenario: 'AI_CREATE_MULTINODE', | ||
}); | ||
}; | ||
before(() => setTestStartSignal('')); | ||
|
||
beforeEach(() => { | ||
setTestStartSignal(''); | ||
NewClusterPage.visit(); | ||
ClusterDetailsForm.init(); | ||
}); | ||
|
||
it('Base Name (Invalid)', () => { | ||
const invalidDnsDomain = 'iamnotavaliddnsdomain-iamnotavaliddnsdomain-iamnotavaliddnsdomain'; | ||
clusterDetailsPage.inputClusterName(); | ||
clusterDetailsPage.inputBaseDnsDomain(invalidDnsDomain); | ||
clusterDetailsPage.clickClusterDetailsBody(); | ||
clusterDetailsPage.validateInputDnsDomainFieldHelper( | ||
`Every single host component in the base domain name cannot contain more than 63 characters and must not contain spaces.`, | ||
); | ||
}); | ||
|
||
it('Base Name (Field Not Empty)', () => { | ||
const emptyDns = ' '; | ||
clusterDetailsPage.inputBaseDnsDomain(emptyDns); | ||
clusterDetailsPage.clickClusterDetailsBody(); | ||
clusterDetailsPage.validateInputDnsDomainFieldHelper( | ||
`Every single host component in the base domain name cannot contain more than 63 characters and must not contain spaces.`, | ||
); | ||
}); | ||
|
||
it('Pull secret (Field not empty)', () => { | ||
const emptyPullSecret = '{}'; | ||
let pullSecretError = 'Required.'; | ||
clusterDetailsPage.inputPullSecret(emptyPullSecret); | ||
clusterDetailsPage.clearPullSecret(); | ||
clusterDetailsPage.validateInputPullSecretFieldHelper(pullSecretError); | ||
}); | ||
|
||
it('Pull Secret (Malformed)', () => { | ||
const malformedJsonPullSecret = '{{}}'; | ||
let pullSecretError = | ||
"Invalid pull secret format. You must use your Red Hat account's pull secret"; | ||
clusterDetailsPage.inputPullSecret(malformedJsonPullSecret); | ||
clusterDetailsPage.clickClusterDetailsBody(); | ||
clusterDetailsPage.validateInputPullSecretFieldHelper(pullSecretError); | ||
}); | ||
|
||
it('Pull secret (Invalid entry)', () => { | ||
const invalidPullSecret = '{"invalid": "pull-secret"}'; | ||
// Need to set valid name and DNS | ||
clusterDetailsPage.inputClusterName(); | ||
clusterDetailsPage.inputBaseDnsDomain(); | ||
clusterDetailsPage.inputPullSecret(invalidPullSecret); | ||
|
||
const errorSuffix = Cypress.env('OCM_USER') | ||
? 'Learn more about pull secrets and view examples' | ||
: "A Red Hat account's pull secret can be found in"; | ||
clusterDetailsPage.clickClusterDetailsBody(); | ||
clusterDetailsPage.validateInputPullSecretFieldHelper( | ||
`Invalid pull secret format. You must use your Red Hat account's pull secret`, | ||
); | ||
}); | ||
}); |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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