diff --git a/frontend/src/__tests__/cypress/cypress/pages/projects.ts b/frontend/src/__tests__/cypress/cypress/pages/projects.ts index 5804a7765a..4ca33cb1c8 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/projects.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/projects.ts @@ -103,6 +103,18 @@ class ProjectListPage { findProjectsTypeDropdownByText(projectType: string) { return cy.contains('button', projectType); } + + findProjectsDropdownFilter(){ + return cy.findByTestId('filter-dropdown-select'); + } + + findProjectsDropdownFilterButtonByText(buttonTitle: string) { + return cy.contains('button', buttonTitle); + } + + findProjectsFilterInput() { + return cy.findByPlaceholderText('Find by name'); + } } class CreateEditProjectModal extends Modal { diff --git a/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts index 867596c1f2..7ce13434d9 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts @@ -7,6 +7,7 @@ import { createDSPASecret, createDSPA } from '~/__tests__/cypress/cypress/utils/ import { replacePlaceholdersInYaml } from '~/__tests__/cypress/cypress/utils/yaml_files'; import { ADMIN_USER } from '~/__tests__/cypress/cypress/utils/e2eUsers'; import { AWS_BUCKETS } from '~/__tests__/cypress/cypress/utils/s3Buckets'; +import { filterProjectByName } from '~/__tests__/cypress/cypress/utils/projects'; import { projectListPage, projectDetails } from '~/__tests__/cypress/cypress/pages/projects'; import { pipelineImportModal } from '~/__tests__/cypress/cypress/pages/pipelines/pipelineImportModal'; @@ -68,8 +69,9 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } * Import Pipeline by URL from Project Details view */ projectListPage.navigate(); - + // Open the project + filterProjectByName(projectName); projectListPage.findProjectLink(projectName).click(); // Increasing the timeout to ~3mins so the DSPA can be loaded diff --git a/frontend/src/__tests__/cypress/cypress/utils/projects.ts b/frontend/src/__tests__/cypress/cypress/utils/projects.ts new file mode 100644 index 0000000000..5504642322 --- /dev/null +++ b/frontend/src/__tests__/cypress/cypress/utils/projects.ts @@ -0,0 +1,11 @@ +import { projectListPage } from '~/__tests__/cypress/cypress/pages/projects'; + +/** + * Filter Project by name using the Project filter from the Data Science Projects view + * @param projectName Project Name + */ +export const filterProjectByName = (projectName: string) => { + projectListPage.findProjectsDropdownFilter().click(); + projectListPage.findProjectsDropdownFilterButtonByText("Name").click(); + projectListPage.findProjectsFilterInput().type(projectName); +}; \ No newline at end of file