Skip to content

Commit e42bb49

Browse files
feat: bring in staging (#504)
1 parent 8ccaef3 commit e42bb49

File tree

53 files changed

+1879
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1879
-198
lines changed

cypress.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
6+
baseUrl: 'http://localhost:3000',
7+
setupNodeEvents(on, config) {
8+
// implement node event listeners here
9+
},
10+
},
11+
});
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import { filterByBoolean } from '../utils/filterByBooleanUtils';
2+
import { filterByString } from '../utils/filterByStringUtils';
3+
import { login } from '../utils/loginUtils';
4+
import { pagination } from '../utils/paginationUtils';
5+
import { search } from '../utils/searchUtils';
6+
import { tableColumnsSorting } from '../utils/tableColumnSortingUtils';
7+
import { tableColumns } from '../utils/tableColumnUtils';
8+
9+
describe('FilterComponent E2E Tests', () => {
10+
beforeEach(() => {
11+
login();
12+
cy.waitUntilDashboardIsLoaded();
13+
cy.wait(500);
14+
cy.get('[id="connector"]').click(); // Replace with your custom wait command
15+
});
16+
17+
it('should display the correct columns', () => {
18+
const emptyText =
19+
'Nothing to see here, it seems like no stack has been configured yet.';
20+
const columnList = [
21+
'ID',
22+
'NAME',
23+
'Connector Type',
24+
'Resource Types',
25+
'Resource ID',
26+
'Authentication',
27+
'Author',
28+
'Created',
29+
'Shared',
30+
];
31+
tableColumns(columnList, emptyText);
32+
});
33+
34+
it('should sort table columns', () => {
35+
const columnTestIds = [
36+
'Id',
37+
'Name',
38+
'connector_type',
39+
// 'resource_types',
40+
'resource_id',
41+
'Authentication',
42+
'Author',
43+
'created_at',
44+
'Shared',
45+
];
46+
columnTestIds.forEach((col) => {
47+
tableColumnsSorting(col);
48+
// cy.wait(2000);
49+
});
50+
});
51+
52+
it('should work with valid value', () => {
53+
const emptyText = 'We are sorry';
54+
search('asd', emptyText);
55+
});
56+
57+
it('should apply filters where string', () => {
58+
const emptyText = 'We are sorry';
59+
const columnList = [
60+
'ID',
61+
'Name',
62+
'Connector Type',
63+
'Resource Type',
64+
'Resource ID',
65+
'Authentication',
66+
];
67+
columnList.forEach((col) => {
68+
filterByString(col, emptyText);
69+
});
70+
filterByBoolean();
71+
});
72+
it('should navigate through pagination', () => {
73+
// Assuming you have a button or link for next and previous pagination
74+
// You can click these buttons to navigate through pages
75+
pagination(); // Click the "Previous" button
76+
// Add more assertions as needed
77+
});
78+
it("should display connector's component", () => {
79+
// cy.wait(5000);
80+
cy.get('table').should('exist');
81+
82+
// Select the first row within the table (modify the selector as needed)
83+
cy.get('table tbody tr:eq(4)').click({ force: true });
84+
85+
cy.get('[data-testid="component_tab"]').click();
86+
// cy.get('table').should('exist');
87+
88+
// cy.get('table').should('exist');
89+
const columnList = ['ID', 'Name', 'Flavor'];
90+
const emptyText = 'No components';
91+
columnList.forEach((col) => {
92+
filterByString(col, emptyText);
93+
});
94+
filterByBoolean();
95+
});
96+
});

cypress/e2e/dashboard.spec.cy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('render dashboard', () => {
2+
it('render successful', () => {
3+
cy.visit('/');
4+
});
5+
});
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { apiCall } from '../utils/apiCallUtils';
2+
import { dag } from '../utils/dagUtils';
3+
import { filterByStatus } from '../utils/filterByStatusUtils';
4+
import { filterByString } from '../utils/filterByStringUtils';
5+
import { login } from '../utils/loginUtils';
6+
import { pagination } from '../utils/paginationUtils';
7+
import { search } from '../utils/searchUtils';
8+
import { tableColumnsSorting } from '../utils/tableColumnSortingUtils';
9+
import { tableColumns } from '../utils/tableColumnUtils';
10+
11+
describe('FilterComponent E2E Tests', () => {
12+
beforeEach(() => {
13+
login();
14+
cy.waitUntilDashboardIsLoaded();
15+
apiCall();
16+
cy.get('[id="pipelines"]').click();
17+
18+
// Replace with your custom wait command
19+
});
20+
21+
it('should display the correct columns', () => {
22+
const emptyText =
23+
'Nothing to see here, it seems like no pipeline has been configured yet.';
24+
const columnList = [
25+
'ID',
26+
'NAME',
27+
'STATUS',
28+
'VERSION',
29+
'AUTHOR',
30+
'CREATED AT',
31+
];
32+
tableColumns(columnList, emptyText);
33+
});
34+
35+
it('should sort table columns', () => {
36+
const columnTestIds = [
37+
'Id',
38+
'Name',
39+
'Status',
40+
'Version',
41+
'Author',
42+
'created_at',
43+
];
44+
columnTestIds.forEach((col) => {
45+
tableColumnsSorting(col);
46+
});
47+
});
48+
49+
it('should work with valid value', () => {
50+
search('pipeline');
51+
});
52+
53+
it('should apply filters where string', () => {
54+
const columnList = ['ID', 'Name', 'Version'];
55+
const emptyText = 'We are sorry';
56+
columnList.forEach((col) => {
57+
filterByString(col, emptyText);
58+
});
59+
});
60+
61+
it('should navigate through pagination', () => {
62+
// Assuming you have a button or link for next and previous pagination
63+
// You can click these buttons to navigate through pages
64+
pagination(); // Click the "Previous" button
65+
// Add more assertions as needed
66+
});
67+
68+
it('should display pipelineDetails', () => {
69+
// cy.wait(5000);
70+
cy.get('table').should('exist');
71+
72+
// Select the first row within the table (modify the selector as needed)
73+
cy.get('table tbody tr:first').should('exist');
74+
75+
// Click on the first row
76+
cy.get('table tbody tr:first').click({ force: true });
77+
cy.wait(5000);
78+
cy.get('table').should('exist');
79+
80+
// Select the first row within the table (modify the selector as needed)
81+
cy.get('table:eq(1) tbody tr:first').should('exist');
82+
83+
// Click on the first row
84+
cy.get('table:eq(1) tbody tr:first').click({ force: true });
85+
dag();
86+
});
87+
it("should display pipeline's runs", () => {
88+
// cy.wait(5000);
89+
cy.waitForLoaderToDisappear();
90+
cy.get('table').should('exist');
91+
92+
// Select the first row within the table (modify the selector as needed)
93+
cy.get('table tbody tr:first').click({ force: true });
94+
95+
cy.get('table').should('exist');
96+
cy.waitForLoaderToDisappear();
97+
const columnList = ['Run ID', 'Run Name'];
98+
const emptyText = 'No runs';
99+
columnList.forEach((col) => {
100+
filterByString(col, emptyText);
101+
});
102+
filterByStatus();
103+
});
104+
});
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import { apiCall } from '../utils/apiCallUtils';
2+
3+
import { filterByStatus } from '../utils/filterByStatusUtils';
4+
import { filterByString } from '../utils/filterByStringUtils';
5+
import { login } from '../utils/loginUtils';
6+
import { pagination } from '../utils/paginationUtils';
7+
8+
describe('FilterComponent E2E Tests', () => {
9+
beforeEach(() => {
10+
login();
11+
cy.waitUntilDashboardIsLoaded();
12+
apiCall();
13+
cy.get('[id="repositories"]').click();
14+
15+
// Replace with your custom wait command
16+
});
17+
it('should work with valid value', () => {
18+
cy.get('[data-testid="search-input"]').type('repo');
19+
cy.get('[data-testid="repository_card"]').should('exist');
20+
cy.get('[data-testid="search-input"]').clear();
21+
cy.get('[data-testid="search-input"]').type('random value');
22+
cy.get('h4').contains('No Repositories found');
23+
});
24+
it('should apply filters where string', () => {
25+
// const columnList = ['ID', 'Name', '\];
26+
// columnList.forEach((col) => {
27+
// filterByString(col);
28+
// });
29+
const filterBy = ['ID', 'Name'];
30+
31+
filterBy.forEach((item) => {
32+
const emptyText = 'No Repositories found';
33+
cy.get('[data-testid="filter-icon"]').click();
34+
cy.get('[data-testid="column-name-dropdown"]').select(item);
35+
cy.get('[data-testid="category-dropdown"]').select('Contains');
36+
cy.get('[data-testid="filter-value-input"]').type('random value');
37+
cy.checkRepoCardAndH4Visibility(emptyText);
38+
cy.get('[data-testid="filter-value-input"]').clear();
39+
// Apply filters as needed
40+
cy.get('[data-testid="column-name-dropdown"]').select(item);
41+
cy.get('[data-testid="category-dropdown"]').select('Contains');
42+
cy.get('[data-testid="filter-value-input"]').type('12');
43+
cy.checkRepoCardAndH4Visibility(emptyText);
44+
cy.get('[data-testid="filter-value-input"]').clear();
45+
46+
cy.get('[data-testid="category-dropdown"]').select('Start With');
47+
cy.get('[data-testid="filter-value-input"]').type('ee');
48+
cy.checkRepoCardAndH4Visibility(emptyText);
49+
cy.get('[data-testid="filter-value-input"]').clear();
50+
51+
cy.get('[data-testid="category-dropdown"]').select('End With');
52+
cy.get('[data-testid="filter-value-input"]').type('f3');
53+
cy.checkRepoCardAndH4Visibility(emptyText);
54+
cy.get('[data-testid="filter-value-input"]').clear();
55+
56+
// cy.get('[data-testid="category-dropdown"]').select('Equal');
57+
// cy.get('[data-testid="filter-value-input"]').type('1');
58+
// cy.checkRepoCardAndH4Visibility(emptyText);
59+
// cy.get('[data-testid="filter-value-input"]').clear();
60+
cy.get('[data-testid="filter-icon"]').click();
61+
});
62+
});
63+
64+
it('should navigate through pagination', () => {
65+
// Assuming you have a button or link for next and previous pagination
66+
// You can click these buttons to navigate through pages
67+
pagination(); // Click the "Previous" button
68+
// Add more assertions as needed
69+
});
70+
71+
it("should display respository's runs", () => {
72+
// cy.wait(5000);
73+
cy.waitForLoaderToDisappear();
74+
// cy.get('table').should('exist');
75+
76+
// Select the first row within the table (modify the selector as needed)
77+
cy.get('[data-testid="repository_card"]')
78+
.first() // Select the first element with the data-testid
79+
.children() // Get the child elements
80+
.first() // Select the first child element
81+
.click({ force: true });
82+
cy.get('[data-testid="run_tab"]').click();
83+
cy.waitForLoaderToDisappear();
84+
// cy.get('table').should('exist');
85+
const columnList = ['Run ID', 'Run Name'];
86+
const emptyText = 'No runs';
87+
columnList.forEach((col) => {
88+
filterByString(col, emptyText);
89+
});
90+
filterByStatus();
91+
});
92+
});
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// import { apiCall } from '../utils/apiCallUtils';
2+
import { dag } from '../utils/dagUtils';
3+
import { filterByStatus } from '../utils/filterByStatusUtils';
4+
import { filterByString } from '../utils/filterByStringUtils';
5+
import { login } from '../utils/loginUtils';
6+
import { pagination } from '../utils/paginationUtils';
7+
import { search } from '../utils/searchUtils';
8+
import { tableColumnsSorting } from '../utils/tableColumnSortingUtils';
9+
import { tableColumns } from '../utils/tableColumnUtils';
10+
11+
describe('FilterComponent E2E Tests', () => {
12+
beforeEach(() => {
13+
login();
14+
cy.waitUntilDashboardIsLoaded();
15+
cy.wait(700);
16+
// apiCall();
17+
cy.get('[id="runs"]').click();
18+
});
19+
20+
it('should display the correct columns', () => {
21+
const emptyText =
22+
'Nothing to see here, it seems like no run has been configured yet.';
23+
const columnList = [
24+
'RUN ID',
25+
'RUN NAME',
26+
'PIPELINE',
27+
'STATUS',
28+
'STACK NAME',
29+
'AUTHOR',
30+
'CREATED AT',
31+
];
32+
cy.wait(5000);
33+
tableColumns(columnList, emptyText);
34+
});
35+
36+
it('should sort table columns', () => {
37+
const columnTestIds = [
38+
'Id',
39+
'Name',
40+
'Pipeline',
41+
'Status',
42+
'stack_name',
43+
'Author',
44+
'created_at',
45+
];
46+
columnTestIds.forEach((col) => {
47+
// apiCall();
48+
tableColumnsSorting(col);
49+
});
50+
});
51+
52+
it('should work with valid value', () => {
53+
search('pipeline');
54+
});
55+
56+
it('should apply filters where string', () => {
57+
const columnList = ['Run ID', 'Run Name'];
58+
const emptyText = 'We are sorry';
59+
columnList.forEach((col) => {
60+
filterByString(col, emptyText);
61+
});
62+
filterByStatus();
63+
});
64+
it('should navigate through pagination', () => {
65+
// Assuming you have a button or link for next and previous pagination
66+
// You can click these buttons to navigate through pages
67+
pagination(); // Click the "Previous" button
68+
// Add more assertions as needed
69+
});
70+
71+
it('should display runDetail', () => {
72+
cy.waitForLoaderToDisappear();
73+
cy.get('table').should('exist');
74+
75+
// Select the first row within the table (modify the selector as needed)
76+
cy.get('table tbody tr:first').should('exist');
77+
78+
// Click on the first row
79+
cy.get('table tbody tr:first').click({ force: true });
80+
dag();
81+
});
82+
});

0 commit comments

Comments
 (0)