e2e-fix
This commit is contained in:
parent
7e5df429d7
commit
ce4f8b7147
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
})();
|
Loading…
Reference in New Issue
Block a user