Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e test fix #1122

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0640c82
e2e test fix
victazzz Mar 3, 2025
1e65d9e
e2e test fix
victazzz Mar 3, 2025
b6befad
e2e test fix
victazzz Mar 3, 2025
8d60de6
e2e test fix
victazzz Mar 3, 2025
43dec7f
WIP
mako321 Mar 3, 2025
57a1c89
WIP
mako321 Mar 3, 2025
f487b72
WIP
mako321 Mar 3, 2025
6278b5c
WIP
mako321 Mar 3, 2025
ff88e91
WIP
mako321 Mar 3, 2025
29e393b
WIP
mako321 Mar 3, 2025
633e07c
WIP
mako321 Mar 3, 2025
4d9b2f3
WIP
mako321 Mar 3, 2025
e4d445b
WIP
mako321 Mar 3, 2025
fbf6437
WIP
mako321 Mar 3, 2025
49a9f1c
WIP
mako321 Mar 3, 2025
ebd0bc5
WIP
mako321 Mar 3, 2025
a9658ac
wip
mako321 Mar 3, 2025
1c415f9
WIP
mako321 Mar 3, 2025
6540575
WIP
mako321 Mar 3, 2025
af2b429
WIP
mako321 Mar 3, 2025
c2c0579
WIP
mako321 Mar 3, 2025
eb70ad6
WIP
mako321 Mar 3, 2025
9b6d84d
WIP
mako321 Mar 3, 2025
f457ced
WIP
mako321 Mar 3, 2025
bc13d31
WIP
mako321 Mar 3, 2025
2a53f14
WIP
mako321 Mar 3, 2025
e8bca44
WIP
mako321 Mar 3, 2025
cf5df2e
wip
mako321 Mar 3, 2025
3dd9068
WIP
mako321 Mar 3, 2025
313e450
WIP
mako321 Mar 3, 2025
335ccb8
WIP
mako321 Mar 3, 2025
cae777d
wip
mako321 Mar 3, 2025
7531388
WIP
mako321 Mar 3, 2025
8d07114
WIP
mako321 Mar 3, 2025
1ae501b
WIP
mako321 Mar 3, 2025
c8556b4
WIP
mako321 Mar 3, 2025
1c02975
WIP
mako321 Mar 3, 2025
7bc4230
WIP
mako321 Mar 3, 2025
3236db4
WIP
mako321 Mar 3, 2025
f421c9a
WIP
mako321 Mar 3, 2025
00cb6e6
WIP
mako321 Mar 3, 2025
d2831eb
WIP
mako321 Mar 3, 2025
5ff8ab6
WIP
mako321 Mar 3, 2025
61da753
WIP
mako321 Mar 3, 2025
19a55e0
WIP
mako321 Mar 3, 2025
65da4cb
WIP
mako321 Mar 3, 2025
20227b0
WIP
mako321 Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 38 additions & 44 deletions .github/workflows/e2e-playwright.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,45 @@ jobs:
image: escolalms/api:latest
ports:
- 80:80

options: >-
--name api --env LARAVEL_REDIS_PASSWORD= --env VAR2=value2

- 9000:9000
env:
LARAVEL_APP_NAME: Wellms Playwright Demo
LARAVEL_APP_ENV: local
LARAVEL_APP_KEY: base64:pveos6JL8iCwO3MbzoyQpNx6TETMYuUpfZ18CDKl6Cw=
LARAVEL_APP_DEBUG: true
LARAVEL_APP_LOG_LEVEL: debug
LARAVEL_APP_URL: http://localhost:1000

LARAVEL_DB_CONNECTION: pgsql
LARAVEL_DB_HOST: postgres
LARAVEL_DB_PORT: 5432
LARAVEL_DB_DATABASE: default
LARAVEL_DB_USERNAME: default
LARAVEL_DB_PASSWORD: secret

LARAVEL_BROADCAST_DRIVER: log
LARAVEL_CACHE_DRIVER: redis
LARAVEL_SESSION_DRIVER: cookie
LARAVEL_QUEUE_DRIVER: redis
LARAVEL_QUEUE_CONNECTION: redis

LARAVEL_REDIS_HOST: redis
LARAVEL_REDIS_PASSWORD:
LARAVEL_REDIS_PORT: 6379

LARAVEL_MAIL_DRIVER: smtp
LARAVEL_MAIL_HOST: mailhog
LARAVEL_MAIL_PORT: 1025
LARAVEL_MAIL_USERNAME: null
LARAVEL_MAIL_PASSWORD: null
LARAVEL_MAIL_ENCRYPTION:

LARAVEL_MJML_BINARY_PATH: /usr/bin/mjml
LARAVEL_TRACKER_ENABLED: false
DISABLE_HORIZON: true
DISABLE_SCHEDULER: true

steps:
- run: |
docker exec -u 1000 api echo "APP_NAME=Wellms Playwright Demo \
APP_ENV=local \
APP_KEY=base64:pveos6JL8iCwO3MbzoyQpNx6TETMYuUpfZ18CDKl6Cw= \
APP_DEBUG=true \
APP_LOG_LEVEL=debug \
APP_URL=http://localhost:1000 \
DB_CONNECTION=pgsql \
DB_HOST=postgres \
DB_PORT=5432 \
DB_DATABASE=default \
DB_USERNAME=default \
DB_PASSWORD=secret \
BROADCAST_DRIVER=log \
CACHE_DRIVER=redis \
SESSION_DRIVER=cookie \
QUEUE_DRIVER=redis \
QUEUE_CONNECTION=redis \
REDIS_HOST=redis \
REDIS_PASSWORD= \
REDIS_PORT=6379 \
MAIL_DRIVER=smtp \
MAIL_HOST=mailhog \
MAIL_PORT=1025 \
MAIL_USERNAME=null \
MAIL_PASSWORD=null \
MAIL_ENCRYPTION= \
MJML_BINARY_PATH=/usr/bin/mjml \
TRACKER_ENABLED=false" >> .env

- run: docker exec -u 1000 api cat .env
- run: docker exec -u 1000 api php artisan config:cache
- run: docker exec -u 1000 api composer dumpautoload
- run: docker exec -u 1000 api php artisan key:generate --force --no-interaction
- run: docker exec -u 1000 api php artisan passport:keys --force --no-interaction
- run: docker exec -u 1000 api php artisan migrate --force --no-interaction
- run: docker exec -u 1000 api php artisan passport:client --personal --no-interaction
- run: docker exec -u 1000 api php artisan db:seed --force --no-interaction

- uses: actions/checkout@v2
with:
fetch-depth: 1
Expand Down Expand Up @@ -122,7 +116,7 @@ jobs:
run: npm run test:e2e
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results
1 change: 1 addition & 0 deletions src/e2e/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export const ADMIN_CREDENTIALS = {
email: '[email protected]',
password: 'secret',
};
export const routerType = '/';
8 changes: 4 additions & 4 deletions src/e2e/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
import { ADMIN_CREDENTIALS, BASE_URL } from './consts';
import { ADMIN_CREDENTIALS, BASE_URL, routerType } from './consts';

export const loginAsAdmin = async (page: Page) => {
await page.goto(`${BASE_URL}/#/user/login`);
await page.goto(`${BASE_URL}${routerType}user/login`);
await page.waitForSelector('#email');

Check failure on line 7 in src/e2e/helpers.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout

2) [chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout ─────────────────────── Error: page.waitForSelector: Test timeout of 60000ms exceeded. Call log: - waiting for locator('#email') to be visible at src/e2e/helpers.ts:7 5 | export const loginAsAdmin = async (page: Page) => { 6 | await page.goto(`${BASE_URL}${routerType}user/login`); > 7 | await page.waitForSelector('#email'); | ^ 8 | 9 | await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email); 10 | await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password); at loginAsAdmin (/home/runner/work/Admin/Admin/src/e2e/helpers.ts:7:14) at /home/runner/work/Admin/Admin/src/e2e/logout.e2e.spec.ts:7:5

Check failure on line 7 in src/e2e/helpers.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout

2) [chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout ─────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.waitForSelector: Test timeout of 60000ms exceeded. Call log: - waiting for locator('#email') to be visible at src/e2e/helpers.ts:7 5 | export const loginAsAdmin = async (page: Page) => { 6 | await page.goto(`${BASE_URL}${routerType}user/login`); > 7 | await page.waitForSelector('#email'); | ^ 8 | 9 | await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email); 10 | await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password); at loginAsAdmin (/home/runner/work/Admin/Admin/src/e2e/helpers.ts:7:14) at /home/runner/work/Admin/Admin/src/e2e/logout.e2e.spec.ts:7:5

await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email);
await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password);
await page.locator('form button').click();
await page.locator('button:has-text("Login")').click();

await expect(page).toHaveURL(`${BASE_URL}/#/welcome`, { timeout: 10000 });
await expect(page).toHaveURL(`${BASE_URL}${routerType}welcome`, { timeout: 10000 });
};

// Helper function to confirm deletion of a record in a table
Expand Down
6 changes: 3 additions & 3 deletions src/e2e/login.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { test } from '@playwright/test';

Check failure on line 1 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.
import { ADMIN_CREDENTIALS, BASE_URL } from './consts';
import { ADMIN_CREDENTIALS, BASE_URL, routerType } from './consts';

test(`test route page login`, async ({ page }) => {
await page.goto(`${BASE_URL}/#/user/login`);
await page.goto(`${BASE_URL}${routerType}user/login`);
await page.waitForSelector('#email');

Check failure on line 6 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Error: page.waitForSelector: Test timeout of 60000ms exceeded. Call log: - waiting for locator('#email') to be visible 4 | test(`test route page login`, async ({ page }) => { 5 | await page.goto(`${BASE_URL}${routerType}user/login`); > 6 | await page.waitForSelector('#email'); | ^ 7 | 8 | await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email); 9 | await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password); at /home/runner/work/Admin/Admin/src/e2e/login.e2e.spec.ts:6:14

Check failure on line 6 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.waitForSelector: Test timeout of 60000ms exceeded. Call log: - waiting for locator('#email') to be visible 4 | test(`test route page login`, async ({ page }) => { 5 | await page.goto(`${BASE_URL}${routerType}user/login`); > 6 | await page.waitForSelector('#email'); | ^ 7 | 8 | await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email); 9 | await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password); at /home/runner/work/Admin/Admin/src/e2e/login.e2e.spec.ts:6:14

Check failure on line 6 in src/e2e/login.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login

1) [chromium] › src/e2e/login.e2e.spec.ts:4:5 › test route page login ──────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.waitForSelector: Test timeout of 60000ms exceeded. Call log: - waiting for locator('#email') to be visible 4 | test(`test route page login`, async ({ page }) => { 5 | await page.goto(`${BASE_URL}${routerType}user/login`); > 6 | await page.waitForSelector('#email'); | ^ 7 | 8 | await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email); 9 | await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password); at /home/runner/work/Admin/Admin/src/e2e/login.e2e.spec.ts:6:14

await page.locator('input[id="email"]').fill(ADMIN_CREDENTIALS.email);
await page.locator('input[id="password"]').fill(ADMIN_CREDENTIALS.password);
await page.locator('form button').click();
await page.locator('button:has-text("Login")').click();
// await expect(page).toHaveURL(/.*welcome/);
await page.waitForLoadState();
});
4 changes: 2 additions & 2 deletions src/e2e/logout.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { loginAsAdmin } from './helpers';

test.describe('Logout test', () => {
test.beforeEach(async ({ page }) => {

Check failure on line 6 in src/e2e/logout.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout

2) [chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout ─────────────────────── Test timeout of 60000ms exceeded while running "beforeEach" hook. 4 | 5 | test.describe('Logout test', () => { > 6 | test.beforeEach(async ({ page }) => { | ^ 7 | await loginAsAdmin(page); 8 | }); 9 | test(`test logout`, async ({ page }) => { at /home/runner/work/Admin/Admin/src/e2e/logout.e2e.spec.ts:6:8

Check failure on line 6 in src/e2e/logout.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-e2e

[chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout

2) [chromium] › src/e2e/logout.e2e.spec.ts:9:7 › Logout test › test logout ─────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded while running "beforeEach" hook. 4 | 5 | test.describe('Logout test', () => { > 6 | test.beforeEach(async ({ page }) => { | ^ 7 | await loginAsAdmin(page); 8 | }); 9 | test(`test logout`, async ({ page }) => { at /home/runner/work/Admin/Admin/src/e2e/logout.e2e.spec.ts:6:8
await loginAsAdmin(page);
});
test(`test logout`, async ({ page }) => {
Expand All @@ -14,7 +14,7 @@
// Click text=Logout
await page.waitForSelector('text=Logout');
await page.locator('text=Logout').click();
await page.waitForURL(`${BASE_URL}/#/user/login?redirect=/welcome`);
await page.waitForURL(`${BASE_URL}${routerType}user/login?redirect=/welcome`);

await expect(page).toHaveURL(/.*login/);

Expand Down
4 changes: 2 additions & 2 deletions src/e2e/newCategory.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New category', () => {
Expand All @@ -10,7 +10,7 @@ test.describe('New category', () => {
test('create and delete new category', async ({ page }) => {
const CATEGORY_NAME = generateRandomName('new pwCategory');

await page.goto(`${BASE_URL}/#/courses/categories`);
await page.goto(`${BASE_URL}${routerType}courses/categories`);
await page.waitForLoadState();
await page.locator('text=New').click();
await page.waitForSelector('.ant-modal');
Expand Down
10 changes: 5 additions & 5 deletions src/e2e/newConsultation.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New consultation', () => {
Expand All @@ -10,10 +10,10 @@ test.describe('New consultation', () => {
test('create and delete consultation', async ({ page }) => {
const CONSULTATION_NAME = generateRandomName('new consultation');

await page.goto(`${BASE_URL}/#/other/consultations`);
await page.goto(`${BASE_URL}${routerType}other/consultations`);

await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/other/consultations/new/attributes`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}other/consultations/new/attributes`);

// Fill in the consultation form
await page.locator('#name').fill(CONSULTATION_NAME);
Expand All @@ -37,9 +37,9 @@ test.describe('New consultation', () => {
await page.waitForSelector('text=Consultation saved successfully', { state: 'visible' });
await page.waitForTimeout(3000);

await page.goto(`${BASE_URL}/#/courses/list`);
await page.goto(`${BASE_URL}${routerType}courses/list`);
await page.waitForTimeout(3000);
await page.goto(`${BASE_URL}/#/other/consultations`);
await page.goto(`${BASE_URL}${routerType}other/consultations`);

// Search for the newly created consultation
await searchRecord(page, CONSULTATION_NAME);
Expand Down
8 changes: 4 additions & 4 deletions src/e2e/newCourse.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New course', () => {
Expand All @@ -10,9 +10,9 @@ test.describe('New course', () => {
test('create and delete new course', async ({ page }) => {
const COURSE_NAME = generateRandomName('new course abc');

await page.goto(`${BASE_URL}/#/courses/list`);
await page.goto(`${BASE_URL}${routerType}courses/list`);
await page.locator('text=Create new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/courses/list/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}courses/list/new`);

await page.locator('#title').fill(COURSE_NAME);
await page.locator('#active_from').fill('2022-08-01');
Expand All @@ -30,7 +30,7 @@ test.describe('New course', () => {
const courseSavedAlert = await page.locator('.ant-message-notice');
await expect(courseSavedAlert).toContainText('Course saved successfully');

await page.goto(`${BASE_URL}/#/courses/list`);
await page.goto(`${BASE_URL}${routerType}courses/list`);
await page.waitForSelector('.ant-table-tbody .ant-table-row-level-0', { state: 'visible' }); // w8 for initial list before querying

await searchRecord(page, COURSE_NAME, '#title');
Expand Down
8 changes: 4 additions & 4 deletions src/e2e/newProduct.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New product', () => {
Expand All @@ -10,9 +10,9 @@ test.describe('New product', () => {
test('create and delete new product', async ({ page }) => {
const PRODUCT_NAME = generateRandomName('playwright test product');

await page.goto(`${BASE_URL}/#/sales/products`);
await page.goto(`${BASE_URL}${routerType}sales/products`);
await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/sales/products/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}sales/products/new`);

await page.locator('#name').fill(PRODUCT_NAME);
await page.locator('#purchasable').click();
Expand All @@ -23,7 +23,7 @@ test.describe('New product', () => {
await page.locator('button:has-text("Submit")').click();
await page.waitForSelector('text=Product created', { state: 'visible' });

await page.goto(`${BASE_URL}/#/sales/products`);
await page.goto(`${BASE_URL}${routerType}sales/products`);

await searchRecord(page, PRODUCT_NAME);
await confirmDeletion(page, PRODUCT_NAME);
Expand Down
8 changes: 4 additions & 4 deletions src/e2e/newStationaryEvents.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';
import { format } from 'date-fns';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New stationary events', () => {
Expand All @@ -12,9 +12,9 @@ test.describe('New stationary events', () => {
const EVENT_NAME = generateRandomName('new event');
const today = format(new Date(), 'yyyy-MM-dd');

await page.goto(`${BASE_URL}/#/other/stationary-events`);
await page.goto(`${BASE_URL}${routerType}other/stationary-events`);
await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/other/stationary-events/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}other/stationary-events/new`);

await page.locator('#name').fill(EVENT_NAME);
await page.locator('#place').fill('Warsaw');
Expand All @@ -38,7 +38,7 @@ test.describe('New stationary events', () => {

await page.waitForSelector('text=Stationary event saved successfully', { state: 'visible' });

await page.goto(`${BASE_URL}/#/other/stationary-events`);
await page.goto(`${BASE_URL}${routerType}other/stationary-events`);
await searchRecord(page, EVENT_NAME);
await confirmDeletion(page, EVENT_NAME);
await page.waitForSelector('text=Stationary event deleted successfully', { state: 'visible' });
Expand Down
10 changes: 5 additions & 5 deletions src/e2e/newUser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New user', () => {
Expand All @@ -10,7 +10,7 @@ test.describe('New user', () => {
test('create new user', async ({ page }) => {
const email = generateRandomName('newuser') + '@pwtest.pl';

await page.goto(`${BASE_URL}/#/configuration/settings/escola_auth`);
await page.goto(`${BASE_URL}${routerType}configuration/settings/escola_auth`);
await page.waitForLoadState();
await page.waitForSelector('text=Settings', { state: 'visible' });
await page.click('[data-row-key="return_url"] button');
Expand All @@ -20,9 +20,9 @@ test.describe('New user', () => {
await page.waitForTimeout(2000);
await page.waitForLoadState();

await page.goto(`${BASE_URL}/#/users/list`);
await page.goto(`${BASE_URL}${routerType}users/list`);
await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/users/list/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}users/list/new`);
await page.locator('#first_name').fill('new');
await page.locator('#last_name').fill('user');
await page.locator('#email').fill(email);
Expand All @@ -36,7 +36,7 @@ test.describe('New user', () => {
// await page.waitForSelector('text=Created user', { state: 'visible' });
await page.waitForTimeout(5000);

await page.goto(`${BASE_URL}/#/users/list`);
await page.goto(`${BASE_URL}${routerType}users/list`);
await page.waitForTimeout(4000);

await searchRecord(page, email, '#search');
Expand Down
8 changes: 4 additions & 4 deletions src/e2e/newUserGroup.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New user group', () => {
Expand All @@ -10,15 +10,15 @@ test.describe('New user group', () => {
test('create and delete new user group', async ({ page }) => {
const USER_GROUP_NAME = generateRandomName('new user group');

await page.goto(`${BASE_URL}/#/users/groups`);
await page.goto(`${BASE_URL}${routerType}users/groups`);
await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/users/groups/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}users/groups/new`);
await page.locator('#name').fill(USER_GROUP_NAME);
await page.locator('#registerable').click();
await page.locator('button:has-text("Submit")').click();
await page.waitForSelector('text=Group created', { state: 'visible' });

await page.goto(`${BASE_URL}/#/users/groups`);
await page.goto(`${BASE_URL}${routerType}users/groups`);

await searchRecord(page, USER_GROUP_NAME, '#search');

Expand Down
8 changes: 4 additions & 4 deletions src/e2e/newVoucher.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { BASE_URL } from './consts';
import { BASE_URL, routerType } from './consts';
import { confirmDeletion, generateRandomName, loginAsAdmin, searchRecord } from './helpers';

test.describe('New voucher', () => {
Expand All @@ -10,9 +10,9 @@ test.describe('New voucher', () => {
test('create and delete new voucher', async ({ page }) => {
const CODE_NAME = generateRandomName('test_code');

await page.goto(`${BASE_URL}/#/sales/vouchers`);
await page.goto(`${BASE_URL}${routerType}sales/vouchers`);
await page.locator('text=new').click();
await expect(page).toHaveURL(`${BASE_URL}/#/sales/vouchers/new`);
await expect(page).toHaveURL(`${BASE_URL}${routerType}sales/vouchers/new`);
await page.locator('#name').fill('NEW_TEST_CODE');
await page.locator('#code').fill(CODE_NAME);
await page.locator('input[type="radio"]').first().check();
Expand All @@ -28,7 +28,7 @@ test.describe('New voucher', () => {
await page.locator('button:has-text("Submit")').click();
await page.waitForSelector('text=success', { state: 'visible' });
await page.waitForTimeout(3000);
await page.goto(`${BASE_URL}/#/sales/vouchers`);
await page.goto(`${BASE_URL}${routerType}sales/vouchers`);

await searchRecord(page, CODE_NAME, '#code');

Expand Down
Loading