e2e-fix
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

This commit is contained in:
Untone 2024-02-04 14:49:55 +03:00
parent 7e5df429d7
commit ce4f8b7147
2 changed files with 22 additions and 17 deletions

View File

@ -12,18 +12,18 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Lint styles
run: npm run lint:styles
- name: Check types
run: npm run typecheck
- name: Install Biome
run: npm install --global --save-exact @biomejs/biome
- name: Lint with Biome
run: npx biome ci .
- name: Lint styles
run: npm run lint:styles
- name: Check types
run: npm run typecheck
Playwright:
name: Run end-to-end tests
runs-on: ubuntu-latest

View File

@ -1,10 +1,8 @@
// test/discoursio-webapp.check.js
const { chromium } = require('playwright')
const { chromium } = require('playwright');
;(async () => {
const browser = await chromium.launch()
const context = await browser.newContext()
const browser = await chromium.launch();
const context = await browser.newContext();
// Define the URLs to visit
const pagesToVisit = [
@ -15,19 +13,26 @@ const { chromium } = require('playwright')
'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()
await page.goto(pageUrl)
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()
await page.close();
}
// Close the browser
await browser.close()
})()
await browser.close();
})();