diff --git a/cypress/support/actions/organizations/ProjectsActions.ts b/cypress/support/actions/organizations/ProjectsActions.ts index 18547b44..1744db1b 100644 --- a/cypress/support/actions/organizations/ProjectsActions.ts +++ b/cypress/support/actions/organizations/ProjectsActions.ts @@ -44,7 +44,13 @@ export default class ProjectsActions { }); } doDeleteProject(projectName: string) { - projects.getDeleteBtn().eq(1).click(); + projects.getDeleteBtn().first().click(); + + cy.get('.highlight') + .invoke('text') + .then(highlightText => { + projects.getDeleteConfirmInput().focus().type(highlightText); + }); projects.getDeleteConfirm().click(); diff --git a/cypress/support/repositories/organizations/ProjectsRepository.ts b/cypress/support/repositories/organizations/ProjectsRepository.ts index 65c6ed9f..e9a602e7 100644 --- a/cypress/support/repositories/organizations/ProjectsRepository.ts +++ b/cypress/support/repositories/organizations/ProjectsRepository.ts @@ -24,7 +24,10 @@ export default class ProjectsRepository { return cy.getBySel('table-row'); } getDeleteBtn() { - return cy.get("[aria-label='delete']"); + return cy.getBySel('deleteProject'); + } + getDeleteConfirmInput() { + return cy.getBySel('deleteProjectConfirm'); } getDeleteConfirm() { return cy.getBySel('deleteConfirm'); diff --git a/src/components/Organizations/Projects/index.js b/src/components/Organizations/Projects/index.js index 0b904612..7b6651ad 100644 --- a/src/components/Organizations/Projects/index.js +++ b/src/components/Organizations/Projects/index.js @@ -102,6 +102,7 @@ const OrgProjects = ({ projects = [], organizationId, organizationName, refresh, { setModalState({ open: true, current: project.name }); }} @@ -122,6 +123,7 @@ const OrgProjects = ({ projects = [], organizationId, organizationName, refresh, { setModalState({ ...modalState, confirmValue: e.target.value }); }}