Added option to skip screenshot for cypress tests

This commit is contained in:
saurabhg772244
2025-09-05 12:47:07 +05:30
parent e6fb4a84da
commit 56cc12690f
3 changed files with 11 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ interface CypressConfig {
listUrl?: boolean;
listId?: string;
name?: string;
screenshot?: boolean;
}
type CypressMermaidConfig = MermaidConfig & CypressConfig;
@@ -92,7 +93,7 @@ export const renderGraph = (
export const openURLAndVerifyRendering = (
url: string,
options: CypressMermaidConfig,
{ screenshot = true, ...options }: CypressMermaidConfig,
validation?: any
): void => {
const name: string = (options.name ?? cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
@@ -105,7 +106,9 @@ export const openURLAndVerifyRendering = (
cy.get('svg').should(validation);
}
verifyScreenshot(name);
if (screenshot) {
verifyScreenshot(name);
}
};
export const verifyScreenshot = (name: string): void => {