Skip to content

Commit 932ceeb

Browse files
committed
update to assert instead of throwing error
1 parent 7be6267 commit 932ceeb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/support/steps/broken-links.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @requires {@link ../../../utils/helpers}
99
*/
1010
import { Then } from '@cucumber/cucumber';
11+
import { expect } from '@playwright/test';
1112
import { ICustomWorld } from '../../common/custom-world';
1213
import { linkValidationSelectors } from '../../common/selectors';
1314
import { collectHrefsFromSelector, normalizeUrls, validateLinks } from '../../../utils/helpers';
@@ -69,7 +70,5 @@ Then('WP Rocket settings links are not broken', async function (this: ICustomWor
6970
const brokenLinks = await validateLinks(this.page, normalizedUrls, currentHost);
7071

7172
// Report all broken links at once
72-
if (brokenLinks.length > 0) {
73-
throw new Error(`Broken links detected:\n${brokenLinks.map((l) => `- ${l}`).join('\n')}`);
74-
}
73+
expect(brokenLinks, 'Broken links detected').toHaveLength(0);
7574
});

0 commit comments

Comments
 (0)