work in progress with deno
This commit is contained in:
@@ -61,7 +61,23 @@ async function setupLoginPage(
|
||||
]),
|
||||
1,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
async function setGlobalCSS(
|
||||
{ page, dolibarrAddress, imgFolderPath }: {
|
||||
page: Page;
|
||||
dolibarrAddress: string;
|
||||
imgFolderPath: string;
|
||||
}, cssStyleSheet: string) {
|
||||
await page.goto(`${dolibarrAddress}/admin/ihm.php?mode=css`);
|
||||
await forms.fillForm(
|
||||
{page, imgFolderPath},
|
||||
{cssStyleSheet},
|
||||
new Map([
|
||||
["cssStyleSheet","MAIN_IHM_CUSTOM_CSSaceeditorid:ace"]
|
||||
]),
|
||||
1,
|
||||
)
|
||||
}
|
||||
|
||||
async function setupDisplay(
|
||||
@@ -73,17 +89,22 @@ async function setupDisplay(
|
||||
},
|
||||
): Promise<void> {
|
||||
await login.doAdminLogin(globalCtx);
|
||||
await removeLoginForgottenPasswordLink(globalCtx);
|
||||
await setupLoginPage(globalCtx, {
|
||||
removeHelpLink: true,
|
||||
HTMLMessage: `
|
||||
<div style="text-align:center"><span style="color:#000000">Bienvenue chez </span><span style="color:#2c3e50"><em>Gabriel Radureau</em></span><br />
|
||||
<span style="color:#000000"><em>l'</em></span><span style="color:#e74c3c"><em>ar</em></span><span style="color:#c0392b"><em>change</em></span><span style="color:#000000"><em> du </em></span><span style="color:#2ecc71"><em>code</em></span><br />
|
||||
<span style="color:#000000">🏹💻🪽<br />
|
||||
<em><span style="font-size:8px">Pariez sur le bon sagitaire</span></em></span></div>
|
||||
`.trim(),
|
||||
backgroundImage: "$IMG/loginBackground.jpeg",
|
||||
});
|
||||
// await removeLoginForgottenPasswordLink(globalCtx);
|
||||
// await setupLoginPage(globalCtx, {
|
||||
// removeHelpLink: true,
|
||||
// HTMLMessage: `
|
||||
// <div style="text-align:center"><span style="color:#000000">Bienvenue chez </span><span style="color:#2c3e50"><em>Gabriel Radureau</em></span><br />
|
||||
// <span style="color:#000000"><em>l'</em></span><span style="color:#e74c3c"><em>ar</em></span><span style="color:#c0392b"><em>change</em></span><span style="color:#000000"><em> du </em></span><span style="color:#2ecc71"><em>code</em></span><br />
|
||||
// <span style="color:#000000">🏹💻🪽<br />
|
||||
// <em><span style="font-size:8px">Pariez sur le bon sagitaire</span></em></span></div>
|
||||
// `.trim(),
|
||||
// backgroundImage: "$IMG/loginBackground.jpeg",
|
||||
// });
|
||||
await setGlobalCSS(globalCtx, `
|
||||
body {
|
||||
color: black;
|
||||
}
|
||||
`.trim());
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
47
test/scripts/admin/moduleSetup.ts
Normal file
47
test/scripts/admin/moduleSetup.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
// info-box
|
||||
|
||||
import { Page } from "playwright";
|
||||
import forms from "../forms.ts";
|
||||
import login from "../login.ts";
|
||||
|
||||
// span.info-box-title has-text /moduleName/
|
||||
// span.fa-cog[title="Configuration"]
|
||||
|
||||
async function configureModule(
|
||||
globalCtx: {
|
||||
page: Page;
|
||||
dolibarrAddress: string;
|
||||
adminCredentials: { username: string; password: string };
|
||||
},
|
||||
{
|
||||
moduleName,
|
||||
enabled,
|
||||
onConfiguration,
|
||||
}: {
|
||||
moduleName: string;
|
||||
enabled: boolean;
|
||||
onConfiguration?: CallableFunction;
|
||||
}
|
||||
): Promise<void> {
|
||||
const {page, dolibarrAddress}= globalCtx;
|
||||
await login.doAdminLogin(globalCtx);
|
||||
|
||||
await page.goto(`${dolibarrAddress}/admin/modules.php?mode=commonkanban`);
|
||||
|
||||
const moduleDiv = page.locator('.info-box', {
|
||||
has: page.locator('.info-box-title',{
|
||||
hasText: new RegExp('^'+moduleName+'\n?$','i')
|
||||
})
|
||||
});
|
||||
|
||||
await forms.toggleOnOff(moduleDiv, enabled);
|
||||
if(enabled && onConfiguration!==undefined) {
|
||||
await moduleDiv.locator(`span.fa-cog[title="Configuration"]`).click();
|
||||
await onConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
configureModule,
|
||||
}
|
||||
4
test/scripts/admin/modules/tiers
Normal file
4
test/scripts/admin/modules/tiers
Normal file
@@ -0,0 +1,4 @@
|
||||
# Divers
|
||||
|
||||
## Modèle de génération et contrôle des codes tiers (client ou fournisseur)
|
||||
|
||||
2971
test/scripts/admin/modules/tiers.html
Normal file
2971
test/scripts/admin/modules/tiers.html
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user