Add Files to Discover entry flow E2E tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 22:27:38 +08:00
parent 6dd182b5e9
commit c91d278f1b
2 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
import { loginWithFixtures } from '../support/intercept';
describe('Files to Discover Entry Flow', () => {
beforeEach(() => {
loginWithFixtures();
// Suppress Cytoscape rendering errors in headless mode
cy.on('uncaught:exception', () => false);
cy.visit('/files');
cy.wait('@getFiles');
});
describe('double-click table row to enter Discover', () => {
it('double-click log file navigates to Map page', () => {
// Target the Name column (has class .fileName) to avoid matching Dependency column
cy.contains('td.fileName', 'sample-process.xes').parent('tr').dblclick();
cy.url().should('include', '/discover/log/1/map');
cy.wait('@getDiscover');
cy.get('#cy').should('exist');
});
it('double-click filter file navigates to Map page', () => {
cy.contains('td.fileName', 'filtered-sample').parent('tr').dblclick();
cy.url().should('include', '/discover/filter/10/map');
cy.wait('@getFilterDiscover');
cy.get('#cy').should('exist');
});
});
describe('double-click grid card to enter Discover', () => {
beforeEach(() => {
// Switch to grid view
cy.get('svg').parent('li.cursor-pointer').last().click();
});
it('double-click log file grid card navigates to Map page', () => {
// Use last() to target the All Files grid section (not Recently Used)
cy.get('li[title="sample-process.xes"]').last().dblclick();
cy.url().should('include', '/discover/log/1/map');
cy.wait('@getDiscover');
cy.get('#cy').should('exist');
});
});
describe('DISCOVER tab filters files', () => {
it('clicking DISCOVER tab shows only Log, Filter, and Rule files', () => {
cy.get('.nav-item').contains('DISCOVER').click();
cy.contains('td.fileName', 'sample-process.xes').should('exist');
cy.contains('td.fileName', 'filtered-sample').should('exist');
cy.contains('td.fileName', 'conformance-check-1').should('exist');
});
});
describe('Navbar state after entering Discover', () => {
it('shows DISCOVER heading and tabs after entering from Files', () => {
cy.contains('td.fileName', 'sample-process.xes').parent('tr').dblclick();
cy.url().should('include', '/discover/');
cy.get('#nav_bar').contains('DISCOVER').should('be.visible');
cy.get('.nav-item').contains('MAP').should('exist');
cy.get('.nav-item').contains('CONFORMANCE').should('exist');
cy.get('.nav-item').contains('PERFORMANCE').should('exist');
});
it('shows back arrow pointing to /files', () => {
cy.contains('td.fileName', 'sample-process.xes').parent('tr').dblclick();
cy.url().should('include', '/discover/');
cy.get('#backPage').should('have.attr', 'href', '/files');
});
});
});

View File

@@ -59,6 +59,12 @@ export function setupApiIntercepts() {
body: { success: true }, body: { success: true },
}).as('deleteUserRole'); }).as('deleteUserRole');
// Filter detail (for fetchFunnel when entering filter from Files)
cy.intercept('GET', /\/api\/filters\/\d+$/, {
statusCode: 200,
body: { rules: [], log: { id: 1 }, name: 'filtered-sample' },
}).as('getFilterDetail');
// Discover (map data) // Discover (map data)
cy.intercept('GET', '/api/logs/*/discover', { cy.intercept('GET', '/api/logs/*/discover', {
fixture: 'api/discover.json', fixture: 'api/discover.json',