Framework updates
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,8 @@ function parse_args() {
|
||||
console.log(' --console-debug-benchmark Include benchmark timing in console_debug');
|
||||
console.log(' --console-debug-all Show all console_debug channels');
|
||||
console.log(' --dump-dimensions=<sel> Add layout dimensions to matching elements');
|
||||
console.log(' --portal Test portal routes (uses /_portal/ prefix)');
|
||||
console.log(' --portal-user=<id> Test as specific portal user ID');
|
||||
console.log(' --help Show this help message');
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -99,7 +101,9 @@ function parse_args() {
|
||||
screenshot_width: null,
|
||||
screenshot_path: null,
|
||||
dump_dimensions: null,
|
||||
dev_auth_token: null
|
||||
dev_auth_token: null,
|
||||
portal: false,
|
||||
portal_user_id: null
|
||||
};
|
||||
|
||||
for (const arg of args) {
|
||||
@@ -176,6 +180,10 @@ function parse_args() {
|
||||
options.screenshot_path = arg.substring(18);
|
||||
} else if (arg.startsWith('--dump-dimensions=')) {
|
||||
options.dump_dimensions = arg.substring(18);
|
||||
} else if (arg === '--portal') {
|
||||
options.portal = true;
|
||||
} else if (arg.startsWith('--portal-user=')) {
|
||||
options.portal_user_id = arg.substring(14);
|
||||
} else if (!arg.startsWith('--')) {
|
||||
options.route = arg;
|
||||
}
|
||||
@@ -208,9 +216,14 @@ function parse_args() {
|
||||
// Main execution
|
||||
(async () => {
|
||||
const options = parse_args();
|
||||
|
||||
|
||||
const baseUrl = 'http://localhost';
|
||||
const fullUrl = baseUrl + options.route;
|
||||
// In portal mode, ensure route has /_portal prefix
|
||||
let route = options.route;
|
||||
if (options.portal && !route.startsWith('/_portal')) {
|
||||
route = '/_portal' + route;
|
||||
}
|
||||
const fullUrl = baseUrl + route;
|
||||
const laravel_log_path = process.env.LARAVEL_LOG_PATH || '/var/www/html/storage/logs/laravel.log';
|
||||
|
||||
// Launch browser (always headless)
|
||||
@@ -380,6 +393,9 @@ function parse_args() {
|
||||
if (options.user_id) {
|
||||
extraHeaders['X-Dev-Auth-User-Id'] = options.user_id;
|
||||
}
|
||||
if (options.portal_user_id) {
|
||||
extraHeaders['X-Dev-Auth-Portal-User-Id'] = options.portal_user_id;
|
||||
}
|
||||
if (options.dev_auth_token) {
|
||||
extraHeaders['X-Dev-Auth-Token'] = options.dev_auth_token;
|
||||
}
|
||||
@@ -699,6 +715,14 @@ function parse_args() {
|
||||
if (options.user_id) {
|
||||
output += ` user:${options.user_id}`;
|
||||
}
|
||||
|
||||
if (options.portal) {
|
||||
output += ` portal:true`;
|
||||
}
|
||||
|
||||
if (options.portal_user_id) {
|
||||
output += ` portal-user:${options.portal_user_id}`;
|
||||
}
|
||||
|
||||
// Add key headers
|
||||
if (headers_response['content-type']) {
|
||||
|
||||
Reference in New Issue
Block a user