-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RHOAIENG-1124] Initial pipeline runs global page test setup
- Loading branch information
Showing
13 changed files
with
147 additions
and
31 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
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
49 changes: 49 additions & 0 deletions
49
frontend/src/__tests__/cypress/cypress/e2e/pipelines/PipelineRunsGlobal.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,49 @@ | ||
import { mockStatus } from '~/__mocks__/mockStatus'; | ||
import { mockDashboardConfig } from '~/__mocks__/mockDashboardConfig'; | ||
import { mockDataSciencePipelineApplicationK8sResource } from '~/__mocks__/mockDataSciencePipelinesApplicationK8sResource'; | ||
import { mockRouteK8sResource } from '~/__mocks__/mockRouteK8sResource'; | ||
import { mockK8sResourceList } from '~/__mocks__/mockK8sResourceList'; | ||
import { mockProjectK8sResource } from '~/__mocks__/mockProjectK8sResource'; | ||
import { pipelineRunsGlobal } from '~/__tests__/cypress/cypress/pages/pipelines'; | ||
|
||
const projectName = 'test-project-name'; | ||
|
||
describe('Pipeline Runs Global', () => { | ||
beforeEach(() => { | ||
initIntercepts(); | ||
pipelineRunsGlobal.visit(projectName); | ||
}); | ||
|
||
it('renders the page with scheduled and triggered runs table data', () => { | ||
// TODO | ||
}); | ||
}); | ||
|
||
const initIntercepts = () => { | ||
cy.intercept('/api/status', mockStatus()); | ||
cy.intercept('/api/config', mockDashboardConfig({})); | ||
cy.intercept( | ||
{ | ||
pathname: `/api/k8s/apis/datasciencepipelinesapplications.opendatahub.io/v1alpha1/namespaces/${projectName}/datasciencepipelinesapplications/pipelines-definition`, | ||
}, | ||
mockDataSciencePipelineApplicationK8sResource({ namespace: projectName }), | ||
); | ||
cy.intercept( | ||
{ | ||
pathname: `/api/k8s/apis/route.openshift.io/v1/namespaces/${projectName}/routes/ds-pipeline-pipelines-definition`, | ||
}, | ||
mockRouteK8sResource({ | ||
notebookName: 'ds-pipeline-pipelines-definition', | ||
namespace: projectName, | ||
}), | ||
); | ||
cy.intercept( | ||
{ | ||
pathname: '/api/k8s/apis/project.openshift.io/v1/projects', | ||
}, | ||
mockK8sResourceList([ | ||
mockProjectK8sResource({ k8sName: projectName }), | ||
mockProjectK8sResource({ k8sName: `${projectName}-2`, displayName: 'Test Project 2' }), | ||
]), | ||
); | ||
}; |
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
9 changes: 9 additions & 0 deletions
9
frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelineRunJobTable.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,9 @@ | ||
class PipelineRunJobTable { | ||
private testId = 'pipeline-run-job-table'; | ||
|
||
find() { | ||
return cy.findByTestId(this.testId); | ||
} | ||
} | ||
|
||
export const pipelineRunJobTable = new PipelineRunJobTable(); |
9 changes: 9 additions & 0 deletions
9
frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelineRunTable.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,9 @@ | ||
class PipelineRunTable { | ||
private testId = 'pipeline-run-table'; | ||
|
||
find() { | ||
return cy.findByTestId(this.testId); | ||
} | ||
} | ||
|
||
export const pipelineRunTable = new PipelineRunTable(); |
30 changes: 30 additions & 0 deletions
30
frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelineRunsGlobal.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,30 @@ | ||
class PipelineRunsGlobal { | ||
private testId = 'pipeline-runs-global-page'; | ||
|
||
visit(projectName: string) { | ||
cy.visitWithLogin(`/pipelineRuns/${projectName}`); | ||
this.find(); | ||
} | ||
|
||
find() { | ||
return cy.findByTestId(this.testId); | ||
} | ||
|
||
findScheduledTab() { | ||
return cy.findByRole('tab', { name: 'Scheduled runs tab' }); | ||
} | ||
|
||
findTriggeredTab() { | ||
return cy.findByRole('tab', { name: 'Triggered runs tab' }); | ||
} | ||
|
||
findProjectSelect() { | ||
return this.find().findByTestId('project-selector-dropdown'); | ||
} | ||
|
||
selectProjectByName(name: string) { | ||
this.findProjectSelect().findDropdownItem(name).click(); | ||
} | ||
} | ||
|
||
export const pipelineRunsGlobal = new PipelineRunsGlobal(); |
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