Skip to content

Commit

Permalink
Microcopy for pipelines v2
Browse files Browse the repository at this point in the history
  • Loading branch information
DaoDaoNoCode committed May 22, 2024
1 parent bac0976 commit ba8cedb
Show file tree
Hide file tree
Showing 49 changed files with 256 additions and 246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Pipeline create runs', () => {
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create`);
createRunPage.find();
createRunPage.findRunTypeSwitchLink().click();
cy.url().should('include', '?runType=scheduled');
cy.url().should('include', '?runType=schedules');
});

it('creates an active run', () => {
Expand Down Expand Up @@ -487,10 +487,10 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=schedules`);
createSchedulePage.find();
createSchedulePage.findRunTypeSwitchLink().click();
cy.url().should('include', '?runType=active');
cy.url().should('include', '?runType=runs');
});

it('creates a schedule', () => {
Expand Down Expand Up @@ -518,7 +518,7 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=schedules`);
createSchedulePage.find();

// Fill out the form with a schedule and submit
Expand Down Expand Up @@ -594,7 +594,7 @@ describe('Pipeline create runs', () => {
.findKebabAction('Duplicate')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockRecurringRun.recurring_run_id}?runType=scheduled`,
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockRecurringRun.recurring_run_id}?runType=schedules`,
);

// Verify pre-populated values & submit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const mockActiveRuns = [
const mockExperimentIds = [...new Set(mockActiveRuns.map((mockRun) => mockRun.experiment_id))];
const mockVersionIds = [
...new Set(
mockActiveRuns.map((mockRun) => mockRun.pipeline_version_reference.pipeline_version_id),
mockActiveRuns.map((mockRun) => mockRun.pipeline_version_reference?.pipeline_version_id),
),
];
const mockExperiments = mockExperimentIds.map((experimentId) =>
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Pipeline runs', () => {
describe('empty state', () => {
beforeEach(() => {
activeRunsTable.mockGetActiveRuns([], projectName);
pipelineRunsGlobal.visit(projectName, 'active');
pipelineRunsGlobal.visit(projectName, 'runs');
});

it('shows empty state', () => {
Expand All @@ -167,7 +167,7 @@ describe('Pipeline runs', () => {

it('navigate to create run page', () => {
pipelineRunsGlobal.findCreateRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=active`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=runs`);
});
});

Expand Down Expand Up @@ -198,7 +198,7 @@ describe('Pipeline runs', () => {
},
).as('getActiveRuns');

pipelineRunsGlobal.visit(projectName, 'active');
pipelineRunsGlobal.visit(projectName, 'runs');

cy.wait('@getActiveRuns').then((interception) => {
expect(interception.request.query).to.eql({
Expand Down Expand Up @@ -279,7 +279,7 @@ describe('Pipeline runs', () => {
describe('with data', () => {
beforeEach(() => {
activeRunsTable.mockGetActiveRuns(mockActiveRuns, projectName);
pipelineRunsGlobal.visit(projectName, 'active');
pipelineRunsGlobal.visit(projectName, 'runs');
});

it('renders the page with table data', () => {
Expand Down Expand Up @@ -335,11 +335,11 @@ describe('Pipeline runs', () => {
});
it('navigate between tabs', () => {
pipelineRunsGlobal.findArchivedRunsTab().click();
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=archived`);
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=archive`);
pipelineRunsGlobal.findActiveRunsTab().click();
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=active`);
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=runs`);
pipelineRunsGlobal.findSchedulesTab().click();
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=schedules`);
});
it('navigate to run details page', () => {
activeRunsTable
Expand All @@ -355,7 +355,7 @@ describe('Pipeline runs', () => {
const selectedVersion = mockVersions.find(
(mockVersion) =>
mockVersion.pipeline_version_id ===
mockActiveRuns[0].pipeline_version_reference.pipeline_version_id,
mockActiveRuns[0].pipeline_version_reference?.pipeline_version_id,
);
if (!selectedVersion) {
return;
Expand Down Expand Up @@ -439,7 +439,7 @@ describe('Pipeline runs', () => {
activeRunsTable.mockGetActiveRuns(
mockActiveRuns.filter(
(mockRun) =>
mockRun.pipeline_version_reference.pipeline_version_id === 'test-version-1',
mockRun.pipeline_version_reference?.pipeline_version_id === 'test-version-1',
),
projectName,
1,
Expand Down Expand Up @@ -570,14 +570,14 @@ describe('Pipeline runs', () => {
describe('Archived runs', () => {
it('shows empty state', () => {
archivedRunsTable.mockGetArchivedRuns([], projectName);
pipelineRunsGlobal.visit(projectName, 'archived');
pipelineRunsGlobal.visit(projectName, 'archive');
archivedRunsTable.findEmptyState().should('exist');
});

describe('with data', () => {
beforeEach(() => {
archivedRunsTable.mockGetArchivedRuns(mockArchivedRuns, projectName);
pipelineRunsGlobal.visit(projectName, 'archived');
pipelineRunsGlobal.visit(projectName, 'archive');
});

it('renders the page with table data', () => {
Expand Down Expand Up @@ -688,7 +688,7 @@ describe('Pipeline runs', () => {
archivedRunsTable.mockGetArchivedRuns(
mockArchivedRuns.filter(
(mockRun) =>
mockRun.pipeline_version_reference.pipeline_version_id === 'test-version-1',
mockRun.pipeline_version_reference?.pipeline_version_id === 'test-version-1',
),
projectName,
1,
Expand Down Expand Up @@ -800,7 +800,7 @@ describe('Pipeline runs', () => {
describe('empty state', () => {
beforeEach(() => {
pipelineRunJobTable.mockGetJobs([], projectName);
pipelineRunsGlobal.visit(projectName, 'scheduled');
pipelineRunsGlobal.visit(projectName, 'schedules');
});

it('shows empty state', () => {
Expand All @@ -809,13 +809,13 @@ describe('Pipeline runs', () => {

it('navigate to create run page', () => {
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=schedules`);
});
});

it('shows empty state', () => {
pipelineRunJobTable.mockGetJobs([], projectName);
pipelineRunsGlobal.visit(projectName, 'scheduled');
pipelineRunsGlobal.visit(projectName, 'schedules');
pipelineRunJobTable.findEmptyState().should('exist');
});

Expand Down Expand Up @@ -844,7 +844,7 @@ describe('Pipeline runs', () => {
next_page_token: 'page-2-token',
},
).as('getScheduledRuns');
pipelineRunsGlobal.visit(projectName, 'scheduled');
pipelineRunsGlobal.visit(projectName, 'schedules');

cy.wait('@getScheduledRuns').then((interception) => {
expect(interception.request.query).to.eql({
Expand Down Expand Up @@ -977,7 +977,7 @@ describe('Pipeline runs', () => {
describe('with data', () => {
beforeEach(() => {
pipelineRunJobTable.mockGetJobs(mockJobs, projectName);
pipelineRunsGlobal.visit(projectName, 'scheduled');
pipelineRunsGlobal.visit(projectName, 'schedules');
});

it('renders the page with table rows', () => {
Expand All @@ -999,15 +999,15 @@ describe('Pipeline runs', () => {
describe('Navigation', () => {
it('navigate to create scheduled run page', () => {
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=schedules`);
});
it('navigate to clone scheduled run page', () => {
pipelineRunJobTable
.getRowByName(mockJobs[0].display_name)
.findKebabAction('Duplicate')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockJobs[0].recurring_run_id}?runType=scheduled`,
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockJobs[0].recurring_run_id}?runType=schedules`,
);
});
it('navigate to scheduled run details page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ describe('Pipelines', () => {
.findKebabAction('Schedule run')
.click();

verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=schedules`);
});

it('navigate to create run page from pipeline version row', () => {
Expand Down Expand Up @@ -997,7 +997,7 @@ describe('Pipelines', () => {
.findKebabAction('Schedule run')
.click();

verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=schedules`);
});

it('navigate to view runs page from pipeline version row', () => {
Expand All @@ -1012,7 +1012,7 @@ describe('Pipelines', () => {
.getPipelineVersionRowById(initialMockPipelineVersion.pipeline_version_id)
.findKebabAction('View runs')
.click();
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=active`);
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=runs`);
});

it('navigates to "Schedules" page from pipeline version row', () => {
Expand All @@ -1026,7 +1026,7 @@ describe('Pipelines', () => {
.getPipelineVersionRowById(initialMockPipelineVersion.pipeline_version_id)
.findKebabAction('View schedules')
.click();
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectName}?runType=schedules`);
});

it('Table pagination', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ describe('Pipeline topology', () => {

it('navigates to "Schedule run" page on "Schedule run" click', () => {
pipelineDetails.selectActionDropdownItem('Schedule run');
verifyRelativeURL(`/pipelineRuns/${projectId}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectId}/pipelineRun/create?runType=schedules`);
});

it('Test pipeline details view runs navigation', () => {
pipelineDetails.selectActionDropdownItem('View runs');
verifyRelativeURL(`/pipelineRuns/${projectId}?runType=active`);
verifyRelativeURL(`/pipelineRuns/${projectId}?runType=runs`);
});

it('navigates to "Schedules" on "View schedules" click', () => {
pipelineDetails.selectActionDropdownItem('View schedules');
verifyRelativeURL(`/pipelineRuns/${projectId}?runType=scheduled`);
verifyRelativeURL(`/pipelineRuns/${projectId}?runType=schedules`);
});
});

Expand Down Expand Up @@ -319,7 +319,7 @@ describe('Pipeline topology', () => {
pipelineRunJobDetails.visit(projectId, mockJob.recurring_run_id);
pipelineRunJobDetails.selectActionDropdownItem('Duplicate');
verifyRelativeURL(
`/pipelineRuns/${projectId}/pipelineRun/cloneJob/${mockJob.recurring_run_id}?runType=scheduled`,
`/pipelineRuns/${projectId}/pipelineRun/cloneJob/${mockJob.recurring_run_id}?runType=schedules`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class PipelineRunFilterBar extends PipelineFilterBar {
}

private findActiveRunsTable() {
return cy.findByTestId('active-runs-table');
return cy.findByTestId('runs-runs-table');
}

findSortButtonForArchive(name: string) {
return this.findArchiveRunsTable().find('thead').findByRole('button', { name });
}

private findArchiveRunsTable() {
return cy.findByTestId('archived-runs-table');
return cy.findByTestId('archive-runs-table');
}

findSortButtonforSchedules(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PipelineRunsTable {

protected emptyStateTestId = '';

constructor(tab?: 'active-runs' | 'archived-runs' | 'schedules') {
constructor(tab?: 'runs-runs' | 'archive-runs' | 'schedules') {
this.testId = `${tab}-table`;
this.emptyStateTestId = `${tab}-empty-state`;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ class PipelineRunsTable {

class ActiveRunsTable extends PipelineRunsTable {
constructor() {
super('active-runs');
super('runs-runs');
}

mockGetActiveRuns(runs: PipelineRunKFv2[], namespace: string, times?: number) {
Expand All @@ -123,7 +123,7 @@ class ActiveRunsTable extends PipelineRunsTable {
}
class ArchivedRunsTable extends PipelineRunsTable {
constructor() {
super('archived-runs');
super('archive-runs');
}

mockGetArchivedRuns(runs: PipelineRunKFv2[], namespace: string, times?: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PipelineRunSearchParam } from '~/concepts/pipelines/content/types';
import { DeleteModal } from '~/__tests__/cypress/cypress/pages/components/DeleteModal';

class PipelineRunsGlobal {
visit(projectName: string, runType?: 'active' | 'archived' | 'scheduled') {
visit(projectName: string, runType?: 'runs' | 'archive' | 'schedules') {
cy.visit(
`/pipelineRuns/${projectName}${
runType ? `?${PipelineRunSearchParam.RunType}=${runType}` : ''
Expand All @@ -21,15 +21,15 @@ class PipelineRunsGlobal {
}

findSchedulesTab() {
return cy.findByTestId('schedules-tab');
return cy.findByTestId('schedules-runs-tab');
}

findActiveRunsTab() {
return cy.findByRole('tab', { name: 'Active tab' });
return cy.findByTestId('active-runs-tab');
}

findArchivedRunsTab() {
return cy.findByRole('tab', { name: 'Archived tab' });
return cy.findByTestId('archived-runs-tab');
}

findProjectSelect() {
Expand All @@ -49,11 +49,11 @@ class PipelineRunsGlobal {
}

findActiveRunsToolbar() {
return cy.findByTestId('active-runs-table-toolbar');
return cy.findByTestId('runs-runs-table-toolbar');
}

findArchivedRunsToolbar() {
return cy.findByTestId('archived-runs-table-toolbar');
return cy.findByTestId('archive-runs-table-toolbar');
}

selectFilterByName(name: string) {
Expand Down
Loading

0 comments on commit ba8cedb

Please sign in to comment.