Merge branch 'router-upgrade' of github.com:Discours/discoursio-webapp into router-upgrade

This commit is contained in:
Untone 2024-07-08 17:41:29 +03:00
commit 327cd514d6
8 changed files with 26 additions and 2 deletions

View File

@ -26,9 +26,13 @@ jobs:
run: npm run build
e2e_tests:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
needs: ci
runs-on: ubuntu-latest
steps:
- name: Debug event info
run: |
echo "Event Name: ${{ github.event_name }}"
echo "Deployment Status: ${{ github.event.deployment_status.state }}"
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:

View File

@ -46,3 +46,18 @@ If workers is no needed use:
- `npx playwright test --project=webkit --workers 4`
For more information on how to write tests using Playwright - [Playwright documentation](https://playwright.dev/docs/intro).
## 🚀 Tests in CI Mode
Tests are executed within a GitHub workflow. We organize our tests into two main directories:
- `tests`: Contains tests that do not require authentication.
- `tests-with-auth`: Houses tests that interact with authenticated parts of the application.
🔧 **Configuration:**
Playwright is configured to utilize the `BASE_URL` environment variable. Ensure this is properly set in your CI configuration to point to the correct environment.
📝 **Note:**
After pages have been adjusted to work with authentication, all tests should be moved to the `tests` directory to streamline the testing process.

View File

@ -27,7 +27,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'https://localhost:3000',
baseURL: process.env.BASE_URL || 'https://localhost:3000',
/* Headless */
headless: true,
/* Ignode SSL certificates */

View File

@ -45,6 +45,7 @@ test.beforeAll(async ({ browser }) => {
console.log('Waiting for the server to start...')
await new Promise((resolve) => setTimeout(resolve, 5000))
const baseURL = process.env.BASE_URL || 'https://localhost:3000'
console.log('Base URL:', baseURL)
await waitForServer(baseURL)
page = await browser.newPage()
test.setTimeout(150000)

View File

@ -45,6 +45,7 @@ test.beforeAll(async ({ browser }) => {
console.log('Waiting for the server to start...')
await new Promise((resolve) => setTimeout(resolve, 5000))
const baseURL = process.env.BASE_URL || 'https://localhost:3000'
console.log('Base URL:', baseURL)
await waitForServer(baseURL)
page = await browser.newPage()
test.setTimeout(150000)

View File

@ -47,6 +47,7 @@ test.beforeAll(async ({ browser }) => {
console.log('Waiting for the server to start...')
await new Promise((resolve) => setTimeout(resolve, 5000))
const baseURL = process.env.BASE_URL || 'https://localhost:3000'
console.log('Base URL:', baseURL)
await waitForServer(baseURL)
context = await browser.newContext()
page = await context.newPage()

View File

@ -0,0 +1 @@
This is folder with Playwright tests, that are needed to move in /tests dir for wrking on playwright circle

View File

@ -45,6 +45,7 @@ test.beforeAll(async ({ browser }) => {
console.log('Waiting for the server to start...')
await new Promise((resolve) => setTimeout(resolve, 5000))
const baseURL = process.env.BASE_URL || 'https://localhost:3000'
console.log('Base URL:', baseURL)
await waitForServer(baseURL)
page = await browser.newPage()
test.setTimeout(150000)