Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/Pilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class Pilot {
this.snapshotComparator,
config.options?.cacheOptions,
);

this.stepPerformerPromptCreator = new StepPerformerPromptCreator(
config.frameworkDriver.apiCatalog,
);
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/common/cacheHandler/CacheHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ export class CacheHandler {
cacheOptions: CacheOptions = {},
cacheFilePath?: string,
) {
if (cacheOptions.cacheDirectoryPath) {
CacheHandler.CACHE_DIRECTORY = cacheOptions.cacheDirectoryPath;
}

this.overrideCacheFilePath = cacheFilePath;
this.cacheOptions = this.createCacheOptionsWithDefaults(cacheOptions);
this.snapshotComparator = snapshotComparator;
this.cacheFilePath = this.determineCurrentCacheFilePath();
this.codeEvaluator = new CodeEvaluator();
}

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/types/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface CacheOptions {
shouldUseCache?: boolean;
/** If true, cache will be updated with new data (default: false) */
shouldOverrideCache?: boolean;
/** Optional path to cache*/
cacheDirectoryPath?: string;
}

/**
Expand All @@ -28,6 +30,8 @@ export interface Config {
loggerDelegate?: import("@/types/logger").LoggerDelegate;
/** Optional behavior settings */
options?: PilotOptions;
/**Optional path to cache */
cachePath?: string;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions packages/drivers/playwright/examples/example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ describe("Example Test Suite", () => {
pilot = new Pilot({
frameworkDriver,
promptHandler,
options: {
cacheOptions: { cacheDirectoryPath: "../CheckCacheLocation" },
},
});
});

Expand Down
Loading