webapp/test/basic-routes.test.сjs
Untone ce4f8b7147
Some checks failed
deploy / Linting (push) Failing after 36s
deploy / Run end-to-end tests (push) Failing after 1m34s
deploy / Update templates on Mailgun (push) Has been skipped
deploy / Github (push) Failing after 2s
e2e-fix
2024-02-04 14:49:55 +03:00

39 lines
1000 B
Plaintext

const { chromium } = require('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();
})();