Skip to content

Commit d266ac6

Browse files
tuxpiperclaude
andauthored
Fix: Stop asserting an exact total post count in delete_post e2e test (#1621)
delete_post used a hardcoded absolute count ("Current results: 20 / 518") purely as a sanity check that filters were cleared and the right page loaded. The total is not a fixed fixture value - it's the live total on a shared test backend, which grows over time as other automated tests create posts - so the exact match was guaranteed to drift and fail independent of anything this test actually cares about (the page size stays 20; only the total changes). Assert the page-size portion and accept any total instead. Claude-Session: https://claude.ai/code/session_0142M19Se37Y1pxoNy8HvTKV Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 56058c9 commit d266ac6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,12 @@ class PostFunctions {
107107
cy.get(DataViewLocators.revealFiltersBtn).click();
108108
cy.get(DataViewLocators.clearFiltersBtn).click();
109109

110-
//verify post count to verify we are in correct post page
111-
cy.get('[data-qa="feed-page-results"]').contains('Current results: 20 / 518');
110+
//verify post count to verify we are in correct post page. Only the page size (20) is
111+
//asserted here, not the total, since the total record count on the shared test backend
112+
//grows over time as other automated tests create posts.
113+
cy.get('[data-qa="feed-page-results"]').should(($el) => {
114+
expect($el.text()).to.match(/Current results: 20 \/ \d+/);
115+
});
112116
cy.contains(this.postTitle).scrollIntoView();
113117

114118
//change post to be deleted to "New Post Title for Location"

0 commit comments

Comments
 (0)