diff --git a/src/app/zap-templates/common/simulated-clusters/SimulatedClusters.js b/src/app/zap-templates/common/simulated-clusters/SimulatedClusters.js index f43d4841343b8d..19ace7b76d17f4 100644 --- a/src/app/zap-templates/common/simulated-clusters/SimulatedClusters.js +++ b/src/app/zap-templates/common/simulated-clusters/SimulatedClusters.js @@ -16,13 +16,17 @@ */ const { ensureClusters } = require('../ClustersHelper.js'); -const { DelayCommands } = require('./TestDelayCommands.js'); -const { LogCommands } = require('./TestLogCommands.js'); -const SimulatedClusters = [ - DelayCommands, - LogCommands, -]; +const fs = require('fs'); +const path = require('path'); + +let SimulatedClusters = []; +(async () => { + const simulatedClustersPath = path.join(__dirname, 'clusters'); + const simulatedClustersFiles = await fs.promises.readdir(simulatedClustersPath); + SimulatedClusters = simulatedClustersFiles.map(filename => (require(path.join(simulatedClustersPath, filename))).cluster); + return SimulatedClusters; +})(); function getSimulatedCluster(clusterName) { diff --git a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js b/src/app/zap-templates/common/simulated-clusters/clusters/DelayCommands.js similarity index 97% rename from src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js rename to src/app/zap-templates/common/simulated-clusters/clusters/DelayCommands.js index e02d1796353b87..a2026851141905 100644 --- a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js +++ b/src/app/zap-templates/common/simulated-clusters/clusters/DelayCommands.js @@ -53,4 +53,4 @@ const DelayCommands = { // // Module exports // -exports.DelayCommands = DelayCommands; +exports.cluster = DelayCommands; diff --git a/src/app/zap-templates/common/simulated-clusters/TestLogCommands.js b/src/app/zap-templates/common/simulated-clusters/clusters/LogCommands.js similarity index 97% rename from src/app/zap-templates/common/simulated-clusters/TestLogCommands.js rename to src/app/zap-templates/common/simulated-clusters/clusters/LogCommands.js index a35de84b1e17ac..aba2675c345582 100644 --- a/src/app/zap-templates/common/simulated-clusters/TestLogCommands.js +++ b/src/app/zap-templates/common/simulated-clusters/clusters/LogCommands.js @@ -44,4 +44,4 @@ const LogCommands = { // // Module exports // -exports.LogCommands = LogCommands; +exports.cluster = LogCommands;