{"size": 3544, "ext": "js", "max_stars_repo_path": "test/utils/rail_channel_func.js", "max_stars_repo_name": "Amr-afaqy/testcafe_unified_reporter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/utils/rail_channel_func.js", "max_issues_repo_name": "Amr-afaqy/testcafe_unified_reporter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/utils/rail_channel_func.js", "max_forks_repo_name": "Amr-afaqy/testcafe_unified_reporter", "max_forks_repo_forks_event_min_datetime": "2021-11-05T03:51:19.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-05T03:51:19.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 44.3, "max_line_length": 97, "alphanum_fraction": 0.5558690745}
const globalConfigs = require("../../src/config.json");
const TestrailCore = require("../../src/core/TestrailCore.js");
const TestRailInstance = require("../../src/channels/TestRailInstance.js");
const path = require('path')
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') })
module.exports = {
        returnObject: {
                "auth": {
                        "testRailBaseURL": process.env.testRailBaseURL,
                        "railUsername": process.env.railUsername,
                        "railPassword": process.env.railPassword
                },
                "metaConfig": {
                        "projectMeta": "Project_Name",
                        "suiteMeta": "Suite_Name",
                        "milestoneMeta": "MileStone_Name",
                        "testcaseID": "testcase_ID",
                        "componentMeta": "targetComponent",
                        "projectKeyMeta": "jiraProjectKey",
                        "priorityMeta": "testPriority",
                        "severityMeta": "testSeverity",
                        "labelsMeta": "testLabels",
                        "fixtureIDMeta": "fixtureID"
                }

        },

        async createAuthenticationToken() {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                const railObject = new TestRailInstance(railCore, globalConfigs);
                const authToken = await railObject.createTokenDetails();
                return authToken
        },

        async getProjectID(cookies, projectName) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return railCore.getProjectIDS(cookies, projectName)
        },

        async getMilestoneID(cookies, projectID, milestoneNam) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return railCore.getMileStoneID(cookies, projectID, milestoneNam)
        },

        async getSuiteID(cookies, projectID, suiteID) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return railCore.getSuiteID(cookies, projectID, suiteID)
        },

        async getUserID(cookies) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return railCore.getUserID(cookies)
        },

        async createNewTestRun(sessionID, projectID, testRunObject) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return await railCore.pushNewTestRun(
                        await sessionID,
                        await projectID,
                        testRunObject
                );
        },

        async updateTestRunResult(sessionID, testRunID, testCasesArray) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return await railCore.updateTestRunResults(
                        await sessionID,
                        await testRunID,
                        testCasesArray
                );
        },

        async getTestCaseData(sessionID, testRunID) {
                const railCore = new TestrailCore(globalConfigs.testrail, this.returnObject.auth)
                return await railCore.getTestCaseByID(
                        await sessionID,
                        await testRunID
                );
        }
}