UNPKG

@dhlab/e2e-autogen

Version:

Google 스프레드시트 기반 시나리오를 Playwright 테스트 스텁 코드로 자동 생성하고, 테스트 실행 결과를 다시 시트에 업데이트하는 CLI 도구

32 lines (30 loc) 1.49 kB
'use strict'; var _UpdateCommand_config; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateCommand = void 0; const tslib_1 = require("tslib"); const google_spreadsheets_1 = require("../google-spreadsheets"); const test_coverage_1 = require("../test-coverage"); const test_registry_1 = require("../test-registry"); const base_command_1 = require("./base-command"); /** * 테스트 결과를 Google Sheets에 업데이트하는 명령어를 수행한다. */ class UpdateCommand extends base_command_1.BaseCommand { constructor(config) { super(); _UpdateCommand_config.set(this, void 0); tslib_1.__classPrivateFieldSet(this, _UpdateCommand_config, config, "f"); } async execute() { const { sheetsUrl, jsonReporterFile, credentialsFile, googleSheetColumns } = tslib_1.__classPrivateFieldGet(this, _UpdateCommand_config, "f"); const googleSpreadsheets = await (0, google_spreadsheets_1.authorizedGoogleSpreadsheets)(sheetsUrl, credentialsFile, googleSheetColumns); const testRegistry = new test_registry_1.TestRegistry(jsonReporterFile, googleSpreadsheets); const resultsPerSuite = await testRegistry.resultsPerSuite(); await testRegistry.logResults(resultsPerSuite); const testCoverage = new test_coverage_1.TestCoverage(resultsPerSuite); await testCoverage.update(googleSpreadsheets); } } exports.UpdateCommand = UpdateCommand; _UpdateCommand_config = new WeakMap();