mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-02 08:58:32 +00:00
fix: disable run collection icon once triggered to avoid multiple collection runs
This commit is contained in:
@@ -310,7 +310,7 @@ export default function RunnerResults({ collection }) {
|
||||
<div className="flex flex-row gap-2">
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={shouldDisableCollectionRun || (configureMode && selectedRequestItems.length === 0) || isCollectionLoading}
|
||||
disabled={shouldDisableCollectionRun || (configureMode && selectedRequestItems.length === 0) || isCollectionLoading || runnerInfo.status === 'started'}
|
||||
onClick={runCollection}
|
||||
>
|
||||
{configureMode && selectedRequestItems.length > 0
|
||||
|
||||
@@ -1412,6 +1412,14 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
folder = collection;
|
||||
}
|
||||
|
||||
mainWindow.webContents.send('main:run-folder-event', {
|
||||
type: 'testrun-started',
|
||||
isRecursive: recursive,
|
||||
collectionUid,
|
||||
folderUid,
|
||||
cancelTokenUid
|
||||
});
|
||||
|
||||
// Create a map to store HookManagers for this collection/folder run
|
||||
// Key format: 'collection:<collectionUid>', 'folder:<folderUid>', 'request:<requestUid>'
|
||||
const hookManagersMap = new Map();
|
||||
@@ -1463,14 +1471,6 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
await collectionHookManager.call(HOOK_EVENTS.RUNNER_BEFORE_COLLECTION_RUN, { collection, collectionUid });
|
||||
}
|
||||
|
||||
mainWindow.webContents.send('main:run-folder-event', {
|
||||
type: 'testrun-started',
|
||||
isRecursive: recursive,
|
||||
collectionUid,
|
||||
folderUid,
|
||||
cancelTokenUid
|
||||
});
|
||||
|
||||
try {
|
||||
let folderRequests = [];
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ tests {
|
||||
expect(apiToken).to.equal('mock-token-12345');
|
||||
});
|
||||
|
||||
test("setup should have initialized counters", function() {
|
||||
const requestCounter = bru.getVar('request-counter');
|
||||
expect(requestCounter).to.equal('0');
|
||||
});
|
||||
|
||||
test("request should have access to setup vars", function() {
|
||||
const setupComplete = bru.getVar('setup-complete');
|
||||
expect(setupComplete).to.equal('true');
|
||||
|
||||
@@ -65,10 +65,6 @@ script:hooks {
|
||||
bru.setEnvVar('api-token', 'mock-token-12345');
|
||||
bru.setEnvVar('setup-timestamp', Date.now().toString());
|
||||
|
||||
// Test: Setup - Initialize counters
|
||||
bru.setVar('request-counter', '0');
|
||||
bru.setVar('success-counter', '0');
|
||||
|
||||
console.log('[onBeforeCollectionRun] Setup complete - token and counters initialized');
|
||||
});
|
||||
|
||||
@@ -136,8 +132,6 @@ script:hooks {
|
||||
bru.deleteVar('async-start-time');
|
||||
bru.deleteVar('setup-token');
|
||||
bru.deleteVar('setup-complete');
|
||||
bru.deleteVar('request-counter');
|
||||
bru.deleteVar('success-counter');
|
||||
bru.deleteVar('request-count');
|
||||
bru.deleteVar('success-count');
|
||||
bru.deleteVar('final-stats');
|
||||
|
||||
Reference in New Issue
Block a user