Skip to content

Commit 1b251a7

Browse files
authored
Fix visitor authentication end-to-end tests (#2746)
1 parent 24f5249 commit 1b251a7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

packages/gitbook/e2e/pages.spec.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ const testCases: TestsCase[] = [
275275
{
276276
name: 'Search',
277277
url: '?q=',
278+
screenshot: false,
279+
run: async (page) => {
280+
await expect(page.getByTestId('search-results')).toBeVisible();
281+
const allItems = await page.getByTestId('search-result-item').all();
282+
// Expect at least 3 questions
283+
await expect(allItems.length).toBeGreaterThan(2);
284+
},
278285
},
279286
{
280287
name: 'Search Results',
@@ -728,7 +735,12 @@ const testCases: TestsCase[] = [
728735
);
729736
return `first?jwt_token=${token}`;
730737
})(),
731-
run: waitForCookiesDialog,
738+
run: async (page) => {
739+
await expect(
740+
page.getByRole('heading', { level: 1, name: 'first' }),
741+
).toBeVisible();
742+
},
743+
screenshot: false,
732744
},
733745
{
734746
name: 'Second',
@@ -745,7 +757,12 @@ const testCases: TestsCase[] = [
745757
);
746758
return `second?jwt_token=${token}`;
747759
})(),
748-
run: waitForCookiesDialog,
760+
run: async (page) => {
761+
await expect(
762+
page.getByRole('heading', { level: 1, name: 'second' }),
763+
).toBeVisible();
764+
},
765+
screenshot: false,
749766
},
750767
],
751768
},

0 commit comments

Comments
 (0)