Skip to content

Commit

Permalink
Cypress e2e Test - Multiple Project Creation Negative Tests (opendata…
Browse files Browse the repository at this point in the history
…hub-io#3696)

* Initial WIP version of resource creation test

* Experimental changes to poll the UI for updates

* Working version if resource is present

* increase card timeout and delete active wait

* Added changes to find namespace from variables

* Final changes to read variables, cleaned up utils

* Small change to a comment

* Dummy change to trigger mocks

* Save changes on cypress-RHOAIENG-12649

* Changed file directories and names as requested on a PR comment

* Saving changes to current branch

* Additional directory/file name changes

* Additional changes to save

* Resolving timeout issue breaking mock tests, also resolved latest PR comments

* Further changes for this test

* Changes to revert the exist method appended to getCardView.

* Fixed linting

* Linting fixes

* Final comments added

* Fixed merge conflict

* Small change to page object name

* dummy commit

* Removed RHOAI bug workaround

* Removed comments

* Last comment change

* Cypress e2e Test - Admin Model Serving (Multi & Single Model) Tests (opendatahub-io#3662)

* Initial WIP version of resource creation test

* Experimental changes to poll the UI for updates

* Working version if resource is present

* increase card timeout and delete active wait

* Added changes to find namespace from variables

* Final changes to read variables, cleaned up utils

* Small change to a comment

* Dummy change to trigger mocks

* Save changes on cypress-RHOAIENG-12649

* Changed file directories and names as requested on a PR comment

* Saving changes to current branch

* Additional directory/file name changes

* Additional changes to save

* Resolving timeout issue breaking mock tests, also resolved latest PR comments

* Further changes for this test

* Changes to revert the exist method appended to getCardView.

* Fixed linting

* Linting fixes

* Final comments added

* Fixed merge conflict

* Small change to page object name

* dummy commit

* Removed RHOAI bug workaround

* Removed comments

* Last comment change

* Committing intermediate changes

* Initial changes

* Initial changes

* Messy working test

* Committing working test - not linted/cleaned up

* Committing working test with exception of status check on UI

* Committing fully working test on RHOAI

* Linting fixes

* Adding in description for bug relating to manifest links

* Actioning PR comments

* Comitting initial changes

* Comitting working test for Single Model Creation

* Comitting final completed test

* Small amendment to select model server on ODH

* Linting after merge conflict resolution

---------

Co-authored-by: Fede Alonso <fealonso@redhat.com>

made wording more consistent in storage dialog (opendatahub-io#3665)

remove deprecated enabled nvidia manifest from rhoai (opendatahub-io#3666)

Co-authored-by: “Bob <“bgregor@redhat.com”>

Add Exclusions to Cypress e2e Nightly Executions (opendatahub-io#3671)

* Initial WIP version of resource creation test

* Experimental changes to poll the UI for updates

* Working version if resource is present

* increase card timeout and delete active wait

* Added changes to find namespace from variables

* Final changes to read variables, cleaned up utils

* Small change to a comment

* Dummy change to trigger mocks

* Save changes on cypress-RHOAIENG-12649

* Changed file directories and names as requested on a PR comment

* Saving changes to current branch

* Additional directory/file name changes

* Additional changes to save

* Resolving timeout issue breaking mock tests, also resolved latest PR comments

* Further changes for this test

* Changes to revert the exist method appended to getCardView.

* Fixed linting

* Linting fixes

* Final comments added

* Fixed merge conflict

* Small change to page object name

* dummy commit

* Removed RHOAI bug workaround

* Removed comments

* Last comment change

* Initial commit

* Fixed linting

* adding package json

* Swapped out cypress:run for cypress:e2e

---------

Co-authored-by: Fede Alonso <fealonso@redhat.com>

Adds required to environment variables (opendatahub-io#3653)

* Adds required to environment variables

* Accessibility fix

Fix for notebook route link font size (opendatahub-io#3678)

Update the positions of DW tabs (opendatahub-io#3677)

Add default deployment mode selector as read only (opendatahub-io#3664)

* Add default deployment mode selector read only

* Use DashboardHelpTooltip and fix popper width

Fix for page header layout when page has long description (opendatahub-io#3679)

Update ownedByDSC to use correct label for checking what is created by operator (opendatahub-io#3682)

feat: remove the NIM tile from Enabled page (opendatahub-io#3663)

* feat: remove the NIM tile from Enabled page

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

* fix: rename function

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

* fix: add space after the here.

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

---------

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

fix: label update for nim project from single serving to NVIDIA NIM Serving Enabled (opendatahub-io#3680)

* fix: label update for nim from single serving to NVIDIA NIM Serving Enabled

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

* fix: label update

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

* fix: label update

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

* fix: fix cypress test

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

---------

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

fix: move the permissions from the cluster-role to the role yaml file (opendatahub-io#3687)

Signed-off-by: Olga Lavtar <olavtar@redhat.com>

Apply hardware profile to notebook image settings table (opendatahub-io#3645)

* Apply hardware profile to notebook image settings table

* address comment

* add name tooltip for the hardware profile table

* Reuse recommended accelerator annotation for hardware profiles

* Change name resource field to fix layout issues

* fix tests

refractor UsageBar and StorageSizeBar (opendatahub-io#3667)

Hardware Profile Display Name is not trimmed (opendatahub-io#3670)

Name, resource label, tolerations and Node selector fields - Unlimited size string (opendatahub-io#3672)

CVE-2025-22150 odh-dashboard-container: Undici Uses Insufficiently Random Values [main] (opendatahub-io#3685)

* Comitting working tests

* Small wording changes

---------

Co-authored-by: Fede Alonso <fealonso@redhat.com>
  • Loading branch information
2 people authored and manaswinidas committed Feb 24, 2025
1 parent 12cc772 commit cac5cb9
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,34 @@
projectDisplayName: "Cypress Test Project"
projectDescription: "Cypress Test project description."
projectResourceName: "cypress-test-project"
invalidResourceNames:
- Test-Project
- test project
- test.project
- test:project
- test/project
- test"project
- test[project]
- test(project)
- test&project
- test*project
- test?project
- largeprojectnametestthatshouldnotwork
- Test-Project-Invalid
- test project with spaces
- test.project.with.dots
- test:project:with:colons
- test/project/with/slashes
- test"project"with"quotes
- test[project]with[brackets]
- test(project)with(parentheses)
- test&project&with&ampersands
- test*project*with*asterisks
- test?project?with?questions
- -testprojectstartshyphen
- testprojectendswithhyphen-
- TestProjectUpperCase
- $testprojectspecialstart
- ^testprojectspecialstart
- (testproject)parentheses
- testprojecttoooooooooooooooooooooooooooooooooooooooooooooooooooolong
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,72 @@ describe('Verify Data Science Project - Creation and Deletion', () => {
projectListPage.findEmptyResults();
},
);
it(
'Verify users cannot create a project with Empty title',
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1783', '@Dashboard', '@Tier1'] },
() => {
// Authentication and navigation
cy.step('Log into the application');
cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER);
projectListPage.navigate();

// Initiate project creation
cy.step('Open Create Data Science Project modal');
createProjectModal.shouldBeOpen(false);
projectListPage.findCreateProjectButton().click();

// Input project details
cy.step('Enter valid project information');
createProjectModal.k8sNameDescription
.findDescriptionInput()
.type(testData.projectDescription);

// Confirm that the Submit button is disabled
cy.step('Verify the submit button is disabled');
createProjectModal.findSubmitButton().should('be.disabled');
},
);
it(
'Verify User cannot create a project using special characters or long names in the Resource name field',
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1875', '@Dashboard', '@Tier1'] },
() => {
// Authentication and navigation
cy.step('Log into the application');
cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER);
projectListPage.navigate();

// Initiate project creation
cy.step('Open Create Data Science Project modal');
createProjectModal.shouldBeOpen(false);
projectListPage.findCreateProjectButton().click();

// Enter invalid resource details
cy.step(
'Enter invalid resource details - iterate through the array defined in the fixtures file',
);
createProjectModal.k8sNameDescription.findResourceEditLink().click();
createProjectModal.k8sNameDescription
.findDisplayNameInput()
.type(testData.projectDisplayName);

// Test each invalid resource name
cy.step('Test invalid resource name and verify that project creation is prevented');

testData.invalidResourceNames.forEach((invalidResourceName) => {
cy.log(`Testing invalid resource name: ${invalidResourceName}`);

// Clear input, type invalid resource name, and validate behavior
createProjectModal.k8sNameDescription
.findResourceNameInput()
.clear()
.type(invalidResourceName);
createProjectModal.k8sNameDescription
.findResourceNameInput()
.should('have.attr', 'aria-invalid', 'true');
createProjectModal.findSubmitButton().should('be.disabled');
// Log success message for invalid resources names being rejected
cy.log(`✅ ${invalidResourceName}: not authorised as a Resource Name`);
});
},
);
});
1 change: 1 addition & 0 deletions frontend/src/__tests__/cypress/cypress/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type DataScienceProjectData = {
pvStorageName: string;
pvStorageDescription: string;
pvStorageNameEdited: string;
invalidResourceNames: string[];
};

export type NotebookImageData = {
Expand Down

0 comments on commit cac5cb9

Please sign in to comment.