Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(dotnet): fix generating from parent directory (#6095)

Anže Vodovnikb37116d7b185
diff --git a/utils/doclint/generateDotnetApi.js b/utils/doclint/generateDotnetApi.js
index ca4e4a64d6..8cb5c45a2b 100644
--- a/utils/doclint/generateDotnetApi.js
+++ b/utils/doclint/generateDotnetApi.js
@@ -48,7 +48,7 @@ const customTypeNames = new Map([
]);
{
- const typesDir = process.argv[2] || '../generate_types/csharp/';
+ const typesDir = process.argv[2] || path.join(__dirname, 'generate_types', 'csharp');
let checkAndMakeDir = (path) => {
if (!fs.existsSync(path))
fs.mkdirSync(path, { recursive: true });
@@ -78,7 +78,7 @@ const customTypeNames = new Map([
});
// get the template for a class
- const template = fs.readFileSync("./templates/interface.cs", 'utf-8')
+ const template = fs.readFileSync(path.join(__dirname, 'templates', 'interface.cs'), 'utf-8')
.replace('[PW_TOOL_VERSION]', `${__filename.substring(path.join(__dirname, '..', '..').length).split(path.sep).join(path.posix.sep)}`);
// we have some "predefined" types, like the mixed state enum, that we can map in advance