omni-dashboard-playwright-reporter
Version:
Playwright client for publishing test results to Omni Dashboard - Transform Your Test Automation with AI-Powered Insights
16 lines (15 loc) • 774 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFileNameFromPath = getFileNameFromPath;
const path_1 = __importDefault(require("path"));
function getFileNameFromPath(filePath) {
// Get the base name (file name with extension)
const baseName = path_1.default.basename(filePath);
return baseName;
}
// Example usage:
// const filePath = "/Users/panikumar/work/pani/omni-dashboard-playwright-project/test-results/failing-title-url-Navigate-e730e-hould-navigate-to-home-page-chromium/test-failed-1.png";
// const fileName = getFileNameFromPath(filePath); // Returns "test-failed-1.png"