Skip to content

Commit

Permalink
filter the project before trying to open it in the DSP view
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAlonso committed Aug 1, 2024
1 parent b564769 commit 4e5953a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
12 changes: 12 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ class ProjectListPage {
findProjectsTypeDropdownByText(projectType: string) {
return cy.contains('button', projectType);
}

findProjectsDropdownFilter(){

Check failure on line 107 in frontend/src/__tests__/cypress/cypress/pages/projects.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Insert `·`
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createDSPASecret, createDSPA } from '~/__tests__/cypress/cypress/utils/
import { replacePlaceholdersInYaml } from '~/__tests__/cypress/cypress/utils/yaml_files';

Check failure on line 7 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'replacePlaceholdersInYaml' is defined but never used
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';
Expand Down Expand Up @@ -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();

Check failure on line 72 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Delete `····`
// Open the project
filterProjectByName(projectName);
projectListPage.findProjectLink(projectName).click();

// Increasing the timeout to ~3mins so the DSPA can be loaded
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/__tests__/cypress/cypress/utils/projects.ts
Original file line number Diff line number Diff line change
@@ -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);
};

0 comments on commit 4e5953a

Please sign in to comment.