webapp/tests/basic-routes.test.js
Untone 1a393c75c5
All checks were successful
deploy / test (push) Has been skipped
deploy / Update templates on Mailgun (push) Successful in 21s
linter-wider
2024-02-16 22:53:42 +03:00

38 lines
982 B
JavaScript

import { chromium } from 'playwright'
;(async () => {
const browser = await chromium.launch()
const context = await browser.newContext()
// Define the URLs to visit
const pagesToVisit = [
'http://localhost:3000/',
'http://localhost:3000/feed',
'http://localhost:3000/create',
'http://localhost:3000/about/donate',
'http://localhost:3000/authors',
'http://localhost:3000/topics',
'http://localhost:3000/inbox'
]
// 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()
})()