2024-02-05 08:59:21 +00:00
|
|
|
import { chromium } from 'playwright'
|
|
|
|
;(async () => {
|
|
|
|
const browser = await chromium.launch()
|
|
|
|
const context = await browser.newContext()
|
|
|
|
|
|
|
|
// Define the URLs to visit
|
|
|
|
const pagesToVisit = [
|
2024-06-06 06:05:23 +00:00
|
|
|
'https://localhost:3000/',
|
|
|
|
'https://localhost:3000/feed',
|
2024-07-03 21:25:03 +00:00
|
|
|
'https://localhost:3000/edit/new',
|
|
|
|
'https://localhost:3000/guide/support',
|
|
|
|
'https://localhost:3000/author',
|
|
|
|
'https://localhost:3000/topic',
|
2024-06-26 08:22:05 +00:00
|
|
|
'https://localhost:3000/inbox'
|
2024-02-05 08:59:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
// Loop through the pages and visit each one
|
|
|
|
for (const pageUrl of pagesToVisit) {
|
|
|
|
const page = await context.newPage()
|
|
|
|
|
|
|
|
// Log a message before visiting the page
|
|
|
|
console.log(`Visiting page: ${pageUrl}`)
|
|
|
|
|
|
|
|
await page.goto(pageUrl)
|
|
|
|
|
|
|
|
// Add your test assertions here if needed
|
|
|
|
|
|
|
|
// Log a message after visiting the page
|
|
|
|
console.log(`Finished visiting page: ${pageUrl}`)
|
|
|
|
|
|
|
|
// Close the page before moving to the next one
|
|
|
|
await page.close()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close the browser
|
|
|
|
await browser.close()
|
|
|
|
})()
|