Skip to content

Commit ff7725d

Browse files
committed
Merge origin/master
2 parents b29a215 + 172aed1 commit ff7725d

10 files changed

Lines changed: 874 additions & 311 deletions

File tree

insert_header.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
3+
filepath = "/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/js/transversalobject/crbDropdown.js"
4+
header = """/*
5+
* Cerberus Copyright (C) 2013 - 2025 cerberustesting
6+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7+
*
8+
* This file is part of Cerberus.
9+
*
10+
* Cerberus is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 3 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* Cerberus is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with Cerberus. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
"""
24+
25+
with open(filepath, 'r') as f:
26+
content = f.read()
27+
28+
with open(filepath, 'w') as f:
29+
f.write(header + content)
30+

replace_zindex.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import glob
3+
4+
# Files to process
5+
files = [
6+
"/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/include/transversal/TestDataLib.html",
7+
"/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/include/transversal/ApplicationObject.html",
8+
"/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/include/transversal/TestCaseListMassActionUpdate.html",
9+
"/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/include/transversal/AppService.html",
10+
"/Users/alexisjavaux/Documents/Ceberus/cerberus-core/source/src/main/webapp/include/transversal/TestCase.html"
11+
]
12+
13+
for filepath in files:
14+
if os.path.exists(filepath):
15+
with open(filepath, 'r', encoding='utf-8') as f:
16+
content = f.read()
17+
18+
# We replace the inline z-index with the new class
19+
# Look for the crbDropdown panel container template
20+
# Usually it's: class="... max-h-64 overflow-hidden" style="z-index:9999;"
21+
content = content.replace('style="z-index:9999;"', '')
22+
content = content.replace('style="z-index: 9999;"', '')
23+
24+
# Then make sure we add the class crb-dropdown-panel to the <div> that is teleported.
25+
# It usually has 'fixed rounded-md border shadow-lg bg-white...'
26+
content = content.replace('class="fixed rounded-md', 'class="crb-dropdown-panel fixed rounded-md')
27+
28+
# Write back
29+
with open(filepath, 'w', encoding='utf-8') as f:
30+
f.write(content)
31+
print(f"Processed {filepath}")
32+

source/src/main/java/org/cerberus/core/engine/execution/impl/RobotServerService.java

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -692,27 +692,36 @@ public void startServerV2(TestCaseExecution execution) throws CerberusException
692692
appiumDriver = new IOSDriver(url, finalCapabilities);
693693
}
694694

695-
//if preloadScript set, add webSocketUrl capability to enable bidi
696-
if(!StringUtil.isEmptyOrNull(execution.getRobotObj().getPreloadScript())) {
697-
finalCapabilities.setCapability("webSocketUrl", true);
698-
}
699-
700695
driver = appiumDriver == null ? new RemoteWebDriver(executor, finalCapabilities) : appiumDriver;
701696
execution.setRobotProviderSessionID(getSession(driver, execution.getRobotProvider()));
702697
execution.setRobotSessionID(getSession(driver));
703698

704-
//if webSocketUrl = true, and capability to enable bidi
699+
// Init BiDi only if preload script is defined
705700
BiDi biDiSession = null;
706-
Object ws = finalCapabilities.getCapability("webSocketUrl");
707-
if(ws != null && ParameterParserUtil.parseBooleanParam(ws.toString(), false)) {
708-
biDiSession = BiDiUtils.enableBiDi(driver);
709-
}
710701

711-
//if preloadScript set and bidi not null, add preload script
712-
if(biDiSession != null && !StringUtil.isEmptyOrNull(execution.getRobotObj().getPreloadScript())) {
713-
String preloadJs = "function() {" + execution.getRobotObj().getPreloadScript() + "}";
714-
BiDiUtils.addPreloadScript(biDiSession, preloadJs);
715-
execution.addExecutionLog(ExecutionLog.STATUS_INFO, "Set browser preload Script : " + execution.getRobotObj().getPreloadScript());
702+
if (!StringUtil.isEmptyOrNull(execution.getRobotObj().getPreloadScript())) {
703+
704+
// Get returned capabilities
705+
Object ws = ((RemoteWebDriver) driver).getCapabilities().getCapability("webSocketUrl");
706+
707+
if (ws != null) {
708+
try {
709+
biDiSession = BiDiUtils.enableBiDi(driver);
710+
711+
String preloadJs = "() => {" + execution.getRobotObj().getPreloadScript() + "}";
712+
713+
BiDiUtils.addPreloadScript(biDiSession, preloadJs);
714+
715+
execution.addExecutionLog(ExecutionLog.STATUS_INFO,"Set browser preload Script : " + execution.getRobotObj().getPreloadScript());
716+
717+
} catch (Exception e) {
718+
execution.addExecutionLog(ExecutionLog.STATUS_WARN,"Failed to enable BiDi or set preload script : " + e.getMessage()
719+
);
720+
}
721+
} else {
722+
execution.addExecutionLog(ExecutionLog.STATUS_WARN,"BiDi not available (no webSocketUrl capability)"
723+
);
724+
}
716725
}
717726

718727
break;

source/src/main/webapp/css/dist/app.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/src/main/webapp/css/global/crb_style2.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,3 +1845,83 @@ span.editable-empty,.editable-empty:hover,.editable-empty:focus {
18451845
opacity: 0
18461846
}
18471847
}
1848+
1849+
/* ── Pure CSS Tooltips (no Bootstrap / no JS) ── */
1850+
.crb-tooltip-wrap {
1851+
position: relative;
1852+
display: inline-flex;
1853+
align-items: center;
1854+
margin-left: 4px;
1855+
vertical-align: middle;
1856+
}
1857+
.crb-tooltip-icon {
1858+
display: inline-flex;
1859+
align-items: center;
1860+
justify-content: center;
1861+
width: 15px;
1862+
height: 15px;
1863+
border-radius: 50%;
1864+
background: #94a3b8;
1865+
color: #fff;
1866+
font-size: 10px;
1867+
font-weight: 700;
1868+
cursor: help;
1869+
line-height: 1;
1870+
transition: background .15s;
1871+
}
1872+
.crb-tooltip-icon:hover {
1873+
background: #3b82f6;
1874+
}
1875+
.crb-tooltip-bubble {
1876+
visibility: hidden;
1877+
opacity: 0;
1878+
position: absolute;
1879+
top: calc(100% + 8px);
1880+
left: 50%;
1881+
transform: translateX(-50%);
1882+
min-width: 200px;
1883+
max-width: 300px;
1884+
padding: 8px 12px;
1885+
border-radius: 6px;
1886+
background: #1e293b;
1887+
color: #f1f5f9;
1888+
font-size: 12px;
1889+
font-weight: 400;
1890+
text-transform: none;
1891+
letter-spacing: normal;
1892+
line-height: 1.45;
1893+
white-space: normal;
1894+
box-shadow: 0 4px 14px rgba(0,0,0,.25);
1895+
z-index: 9999;
1896+
pointer-events: none;
1897+
transition: opacity .15s, visibility .15s;
1898+
}
1899+
.crb-tooltip-bubble::after {
1900+
content: '';
1901+
position: absolute;
1902+
bottom: 100%;
1903+
left: 50%;
1904+
transform: translateX(-50%);
1905+
border: 5px solid transparent;
1906+
border-bottom-color: #1e293b;
1907+
}
1908+
.crb-tooltip-wrap:hover .crb-tooltip-bubble {
1909+
visibility: visible;
1910+
opacity: 1;
1911+
}
1912+
/* Dark mode */
1913+
:root.dark .crb-tooltip-icon {
1914+
background: #64748b;
1915+
color: #e2e8f0;
1916+
}
1917+
:root.dark .crb-tooltip-icon:hover {
1918+
background: #3b82f6;
1919+
}
1920+
:root.dark .crb-tooltip-bubble {
1921+
background: #0f172a;
1922+
color: #e2e8f0;
1923+
box-shadow: 0 4px 14px rgba(0,0,0,.5);
1924+
}
1925+
:root.dark .crb-tooltip-bubble::after {
1926+
border-bottom-color: #0f172a;
1927+
}

0 commit comments

Comments
 (0)