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

#30163 - Upgrade project improvements #31137

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
73 changes: 73 additions & 0 deletions upgrade_project/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
networks:
http_net:
db_net:
es_net:

volumes:
cms-shared:
dbdata:
esdata:

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
environment:
- cluster.name=elastic-cluster
- discovery.type=single-node
- data
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xmx1G "
#ports:
#- 9200:9200
#- 9600:9600
volumes:
- esdata:/usr/share/elasticsearch/data
networks:
- es_net

dotcms:
image: ${docker_tag}
pull_policy: always
environment:
"CATALINA_OPTS": ' -Xms1g -Xmx1g '
"DB_BASE_URL": "jdbc:postgresql://db/dotcms"
"DB_USERNAME": 'dotcmsdbuser'
"DB_PASSWORD": 'password'
"DOT_ES_AUTH_BASIC_PASSWORD": 'admin'
"DOT_INITIAL_ADMIN_PASSWORD": "admin"
"DOT_ES_ENDPOINTS": 'http://elasticsearch:9200'
"CUSTOM_STARTER_URL": ${custom_starter}

"DOT_CIRCUIT_BREAKER_MAX_CONN_TOTAL": "3"

#EDIT CONTENT
"DOT_CONTENT_EDITOR2_ENABLED": "true"
"DOT_CONTENT_EDITOR2_CONTENT_TYPE" : "true"
"DOT_FEATURE_FLAG_NEW_EDIT_PAGE": "true"

depends_on:
- elasticsearch
- db
volumes:
- cms-shared:/data/shared
#- [serverpath]/license.zip:/data/shared/assets/license.zip
networks:
- db_net
- es_net
ports:
- "8080:8080"
- "8443:8443"

db:
image: postgres:15
command: postgres -c 'max_connections=400' -c 'shared_buffers=128MB'
environment:
"POSTGRES_USER": 'dotcmsdbuser'
"POSTGRES_PASSWORD": 'password'
"POSTGRES_DB": 'dotcms'
volumes:
- dbdata:/var/lib/postgresql/data
networks:
- db_net
ports:
- "15432:5432"
9 changes: 9 additions & 0 deletions upgrade_project/playwrightTests/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
testDir: './',
timeout: 60000,
use: {
headless: true,
browserName: 'chromium' // Browser to use (chromium, firefox, webkit)
},
testMatch: '**/*.spec.js' // Pattern to match test files
};
76 changes: 76 additions & 0 deletions upgrade_project/playwrightTests/pw_e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { test, expect } from '@playwright/test';
import * as dotenv from 'dotenv';
import {
f
} from "../venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/assets/workbench-D5oSwIMK.js";

dotenv.config({ path: 'properties/config.properties' });

const serverURL = process.env.BASE_URL;
async function login(page, username, password) {
test.setTimeout(40000);

await page.goto(`${serverURL}/c`);

let title = await page.title();
expect(title).toBe('dotCMS Content Management Platform');
await page.getByTestId('header').isVisible();
await page.fill('input[id="inputtext"]', username);
await page.getByTestId('password').fill('admin');
await page.getByTestId('submitButton').click();
await page.waitForURL(`${serverURL}/dotAdmin/#/starter`);

title = await page.title();
console.log('Page title after login:', title);
expect(title).toBe('Welcome - dotCMS Content Management Platform');
}

test('Login: Verify dotCMS UI is running and ready', {tag: '@afterUpgrade @beforeUpgrade'}, async ({ page }) => {
test.setTimeout(60000);
const username = process.env.username;
const password = process.env.password;
await login(page, username, password );
});


// Second test that makes a reindex after logging in
test('Make a reindex', { tag: '@afterUpgrade' }, async ({ page }) => {
test.setTimeout(60000);
const username = process.env.username;
const password = process.env.password;

// Login
await login(page,username, password);
await page.waitForLoadState();

// Open the settings menu
await page.getByText('settingsSettingsarrow_drop_up').hover();
await page.getByRole('link', { name: 'Maintenance' }).click();

// Switch to the relevant frame and click the 'Index' tab
const detailFrame = page.frameLocator('iframe[name="detailFrame"]');
await detailFrame.getByRole('tab', { name: 'Index' }).click();
await detailFrame.locator('#live_20241017194349Row').getByRole('cell', { name: 'Active' }).isVisible();

// Wait for the dialog to appear and accept it
page.once('dialog', async dialog => {
await dialog.accept('2'); // Accept the dialog
});

// Click the Reindex button in the iframe
await detailFrame.getByLabel('Reindex', { exact: true }).click();
await page.waitForTimeout(3000); // Wait for 3 seconds

// Verify that the reindexing message is visible
const reindexMessage = detailFrame.getByText('A full reindex is in progress.');
await expect(reindexMessage).toBeVisible();
await expect(reindexMessage).toBeHidden({ timeout: 60000 });
});








25 changes: 25 additions & 0 deletions upgrade_project/properties/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[23_01]
docker_tag_from=dotcms/dotcms:23.01.24_lts_93544717
docker_tag_to=dotcms/dotcms:latest
expected_db_version=250113
custom_starter=https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20220713/starter-20220713.zip


[23_10]
docker_tag_from=dotcms/dotcms:23.10.24_lts_v19_148f2c4
docker_tag_to=dotcms/dotcms:latest
expected_db_version=250113
custom_starter=https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20240807/starter-20240807.zip


[24_04]
docker_tag_from=dotcms/dotcms:24.04.24_lts_v11_4999f58
docker_tag_to=dotcms/dotcms:latest
expected_db_version=250113
custom_starter=https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20240807/starter-20240807.zip

[PLAYWRIGHT]
# PLAYRIGHT Properties
BASE_URL=http://localhost:8080
[email protected]
password=admin
Loading
Loading