https://cypress.io logo
Import custom command files into e2e.js at the fol...
# i-need-help
m
Hi, every time we add new custom command file(s) in the support folder we need to import the file in the e2e.js. What would be the best way to import those files at their folder level instead of writing the whole path and the file name one by one? This will be beneficial if I automatically add new custom command file under existing folder. Example, given I have this custom command files: branchCommands.js depositoryAccountCommands.js transactionCategoriesCommands.js
Copy code
import "./api-commands/administration/organization/branchCommands";
import "./api-commands/administration/organization/depositoryAccountCommands";
import "./api-commands/administration/generalledger/transactionCategoriesCommands";
How can I import these at their folder level like:
Copy code
import "./api-commands/administration/organization
import "./api-commands/administration/generalledger
So that whatever custom command files will be added in the existing folder, I'll no longer specify the whole path including its file name? Thanks!