Files
vscode/extensions/copilot/test/e2e/newNotebook.stest.ts
kieferrm 333d9a4053 Hello Copilot
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-06-27 11:35:20 +02:00

34 lines
1.5 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import { ssuite, stest } from '../base/stest';
import { fetchConversationScenarios, Scenario } from './scenarioLoader';
import { generateScenarioTestRunner } from './scenarioTest';
(function () {
ssuite.skip({ title: 'newNotebook', subtitle: 'e2e', location: 'panel' }, (inputPath) => { //@Yoyokrazy, refactor for tool - debt
const scenarioFolder = inputPath ?? path.join(__dirname, '..', 'test/scenarios/test-new-notebooks');
const scenarios: Scenario[] = fetchConversationScenarios(scenarioFolder);
for (const scenario of scenarios) {
stest({ description: scenario[0].question.replace('/newNotebook ', ''), language: 'python' },
generateScenarioTestRunner(
scenario,
(accessor, question, userVisibleAnswer, rawResponse, index, turn, commands) => {
// TODO@rebornix: test if response contains the outline for notebook in a code block
for (const command of commands) {
if (command.command === 'github.copilot.newNotebook') {
return Promise.resolve({ success: true, errorMessage: '' });
}
}
return Promise.resolve({ success: false, errorMessage: 'Fail to parse newNotebook response' });
}
));
}
});
})();