fix: update Puppeteer launch options to use environment variables for headless mode and enhance enrollment confirmation messages
Some checks failed
GBCI / build (push) Failing after 8m24s
Some checks failed
GBCI / build (push) Failing after 8m24s
This commit is contained in:
parent
619a0e11b9
commit
f245de43b2
4 changed files with 22 additions and 6 deletions
|
@ -95,7 +95,7 @@ export class DialogKeywords {
|
||||||
// Launch Puppeteer to render the chart
|
// Launch Puppeteer to render the chart
|
||||||
|
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
headless: true,
|
headless: process.env.CHROME_HEADLESS === 'true',
|
||||||
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -118,7 +118,7 @@ export class GBSSR {
|
||||||
return {
|
return {
|
||||||
args: args,
|
args: args,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
headless: false,
|
headless: process.env.CHROME_HEADLESS === 'true',
|
||||||
defaultViewport: null,
|
defaultViewport: null,
|
||||||
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
||||||
ignoreDefaultArgs: ['--enable-automation', '--enable-blink-features=IdleDetection']
|
ignoreDefaultArgs: ['--enable-automation', '--enable-blink-features=IdleDetection']
|
||||||
|
|
|
@ -1033,7 +1033,7 @@ export class KBService implements IGBKBService {
|
||||||
];
|
];
|
||||||
|
|
||||||
browser = await puppeteer.launch({
|
browser = await puppeteer.launch({
|
||||||
headless: true,
|
headless: process.env.CHROME_HEADLESS === 'true',
|
||||||
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
||||||
args
|
args
|
||||||
});
|
});
|
||||||
|
@ -1092,11 +1092,11 @@ export class KBService implements IGBKBService {
|
||||||
];
|
];
|
||||||
|
|
||||||
let browser = await puppeteer.launch({
|
let browser = await puppeteer.launch({
|
||||||
headless: true,
|
headless: process.env.CHROME_HEADLESS === 'true',
|
||||||
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
executablePath: process.env.CHROME_PATH ? process.env.CHROME_PATH : executablePath(),
|
||||||
args
|
args
|
||||||
});
|
});
|
||||||
const page = await this.getFreshPage(browser, website);
|
let page = await this.getFreshPage(browser, website);
|
||||||
|
|
||||||
let logo = await this.getLogoByPage(min, page);
|
let logo = await this.getLogoByPage(min, page);
|
||||||
if (logo) {
|
if (logo) {
|
||||||
|
@ -1183,6 +1183,7 @@ export class KBService implements IGBKBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract dominant colors from the screenshot
|
// Extract dominant colors from the screenshot
|
||||||
|
page = await this.getFreshPage(browser, website);
|
||||||
|
|
||||||
await page.screenshot({ path: 'screenshot.png' });
|
await page.screenshot({ path: 'screenshot.png' });
|
||||||
const colors = await getColors('screenshot.png');
|
const colors = await getColors('screenshot.png');
|
||||||
|
@ -1207,6 +1208,8 @@ export class KBService implements IGBKBService {
|
||||||
page.setCacheEnabled(false);
|
page.setCacheEnabled(false);
|
||||||
|
|
||||||
const visited = new Set<string>();
|
const visited = new Set<string>();
|
||||||
|
page = await this.getFreshPage(browser, website);
|
||||||
|
|
||||||
files = files.concat(await this.crawl(min, website, visited, 0, maxDepth, page, websiteIgnoreUrls, maxDocuments));
|
files = files.concat(await this.crawl(min, website, visited, 0, maxDepth, page, websiteIgnoreUrls, maxDocuments));
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|
|
@ -6,4 +6,17 @@ PARAM address AS string LIKE "Rua das Flores, 123, São Paulo, SP" DESCRIPTION "
|
||||||
|
|
||||||
DESCRIPTION "This is a the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction."
|
DESCRIPTION "This is a the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction."
|
||||||
|
|
||||||
SAVE "enrollments.csv", id, name, birthday, email, personalid, address
|
SAVE "enrollments.csv", id, name, birthday, email, personalid, address
|
||||||
|
|
||||||
|
IF name AND birthday AND email AND personalid AND address THEN
|
||||||
|
TALK "Thank you for providing your details. We have successfully received your enrollment request."
|
||||||
|
TALK "Here are the details you provided:"
|
||||||
|
TALK "Name: ${name}"
|
||||||
|
TALK "Birthday: ${birthday}"
|
||||||
|
TALK "Email: ${email}"
|
||||||
|
TALK "Personal ID: ${personalid}"
|
||||||
|
TALK "Address: ${address}"
|
||||||
|
TALK "Your enrollment request has been submitted successfully. We will contact you shortly with further information."
|
||||||
|
ELSE
|
||||||
|
TALK "It seems that some required information is missing. Please ensure you provide all the necessary details to complete your enrollment."
|
||||||
|
END IF
|
Loading…
Add table
Reference in a new issue