@@ -2,7 +2,7 @@ import { W3C_ELEMENT_KEY, errors } from '@appium/base-driver';
22import { Element , Rect } from '@appium/types' ;
33import { tmpdir } from 'node:os' ;
44import { extname , join } from 'node:path' ;
5- import { POWER_SHELL_FEATURE } from '../constants' ;
5+ import { MODIFY_FS_FEATURE , POWER_SHELL_FEATURE } from '../constants' ;
66import { NovaWindowsDriver } from '../driver' ;
77import { ClickType , Enum , Key } from '../enums' ;
88import {
@@ -737,6 +737,7 @@ export async function stopRecordingScreen(this: NovaWindowsDriver, args?: Upload
737737}
738738
739739export async function deleteFile ( this : NovaWindowsDriver , args : { path : string } ) : Promise < void > {
740+ this . assertFeatureEnabled ( MODIFY_FS_FEATURE ) ;
740741 if ( ! args || typeof args !== 'object' || ! args . path ) {
741742 throw new errors . InvalidArgumentError ( "'path' must be provided." ) ;
742743 }
@@ -747,6 +748,7 @@ export async function deleteFile(this: NovaWindowsDriver, args: { path: string }
747748}
748749
749750export async function deleteFolder ( this : NovaWindowsDriver , args : { path : string , recursive ?: boolean } ) : Promise < void > {
751+ this . assertFeatureEnabled ( MODIFY_FS_FEATURE ) ;
750752 if ( ! args || typeof args !== 'object' || ! args . path ) {
751753 throw new errors . InvalidArgumentError ( "'path' must be provided." ) ;
752754 }
0 commit comments