Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
taranvohra committed Apr 4, 2024
1 parent af33889 commit 0c45071
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions e2e/pages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,41 @@ async function waitForCookiesDialog(page: Page) {
}

const testCases: TestsCase[] = [
{
name: 'GitBook Site',
baseUrl: 'https://gitbook.gitbook.io/gitbook-site/',
tests: [
{
name: 'Home',
url: '',
run: waitForCookiesDialog,
},
{
name: 'Search',
url: '?q=',
},
{
name: 'Search Results',
url: '?q=gitbook',
run: async (page) => {
await page.waitForSelector('[data-test="search-results"]');
},
},
{
name: 'AI Search',
url: '?q=What+is+GitBook%3F&ask=true',
run: async (page) => {
await page.waitForSelector('[data-test="search-ask-answer"]');
},
screenshot: false,
},
{
name: 'Not found',
url: 'content-not-found',
run: waitForCookiesDialog,
},
],
},
{
name: 'GitBook',
baseUrl: 'https://docs.gitbook.com',
Expand Down

0 comments on commit 0c45071

Please sign in to comment.