Skip to content

Commit

Permalink
checking search results
Browse files Browse the repository at this point in the history
  • Loading branch information
stevector committed Dec 20, 2023
1 parent 40d37d1 commit 8adfbd3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/playwright-tests/example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,32 @@ test('has title', async ({ page }) => {

/* @todo, add a test of Searching */
});

test('Use Search Form', async ({ page }) => {
await page.goto('/');
// Enter the word "Terminus" into the search box.
await page.fill('#searchform input', 'Terminus');
// Submit the form
await page.press('#searchform input', 'Enter');



// Check that the page contains "Introduction | Terminus Guide | Pantheon Docs"

//
//const searchResults = page.getByTestId('h3 a').nth(0);

// const searchResults = page.getByClassName('search-results').nth(0);
// await expect(searchResults).toHaveText('Terminus Platform Support');

const firstResult = await page.locator('h3 a')
.filter({ hasText: "Terminus Platform Support" }) //orderID in variable
//.getByRole('span', { hasText: 'Queued' })


await firstResult.click();

// check that the current path is guides/platform-considerations/terminus-platform
// ignore the base URL.
await expect(page).toHaveURL('https://docs.pantheon.io/guides/platform-considerations/terminus-platform');
});

0 comments on commit 8adfbd3

Please sign in to comment.