Skip to content

Commit 4ae1dec

Browse files
jstirnamanCopilot
andcommitted
Update cypress/e2e/content/article-links.cy.js
Co-authored-by: Copilot <[email protected]>
1 parent 891553a commit 4ae1dec

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

cypress/e2e/content/article-links.cy.js

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,39 @@ describe('Article', () => {
2929
}
3030

3131
// Run incremental validation analysis with source file paths
32-
cy.task('runIncrementalValidation', sourceFilePaths).then((results) => {
33-
validationStrategy = results.validationStrategy;
34-
35-
// Save cache statistics and validation strategy for reporting
36-
cy.task('saveCacheStatistics', results.cacheStats);
37-
cy.task('saveValidationStrategy', validationStrategy);
38-
39-
// Update subjects to only test files that need validation
40-
if (results.filesToValidate.length > 0) {
41-
// Convert file paths to URLs using shared utility via Cypress task
42-
const urlPromises = results.filesToValidate.map((file) =>
43-
cy.task('filePathToUrl', file.filePath)
44-
);
32+
cy.task('runIncrementalValidation', sourceFilePaths)
33+
.then((results) => {
34+
validationStrategy = results.validationStrategy;
35+
36+
// Save cache statistics and validation strategy for reporting
37+
cy.task('saveCacheStatistics', results.cacheStats);
38+
cy.task('saveValidationStrategy', validationStrategy);
39+
40+
// Update subjects to only test files that need validation
41+
if (results.filesToValidate.length > 0) {
42+
// Convert file paths to URLs using shared utility via Cypress task
43+
const urlPromises = results.filesToValidate.map((file) =>
44+
cy.task('filePathToUrl', file.filePath)
45+
);
4546

46-
cy.wrap(Promise.all(urlPromises)).then((urls) => {
47-
subjects = urls;
47+
cy.wrap(Promise.all(urlPromises)).then((urls) => {
48+
subjects = urls;
4849

49-
cy.log(`📊 Cache Analysis: ${results.cacheStats.hitRate}% hit rate`);
50-
cy.log(
51-
`🔄 Testing ${subjects.length} pages (${results.cacheStats.cacheHits} cached)`
52-
);
53-
});
54-
} else {
55-
// All files are cached, no validation needed
56-
subjects = [];
57-
cy.log('✨ All files cached - skipping validation');
58-
}
59-
});
50+
cy.log(`📊 Cache Analysis: ${results.cacheStats.hitRate}% hit rate`);
51+
cy.log(
52+
`🔄 Testing ${subjects.length} pages (${results.cacheStats.cacheHits} cached)`
53+
);
54+
});
55+
} else {
56+
// All files are cached, no validation needed
57+
subjects = [];
58+
cy.log('✨ All files cached - skipping validation');
59+
}
60+
})
61+
.catch((error) => {
62+
cy.log('❌ Error during incremental validation task: ' + error.message);
63+
Cypress.fail('Incremental validation task failed. See logs for details.');
64+
});
6065
});
6166

6267
// Helper function to identify download links

0 commit comments

Comments
 (0)