mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-28 06:07:53 +03:00
fix(devops): fix firefox protocol.ts location (#3630)
This commit is contained in:
parent
adc2a44113
commit
a2a96198e6
@ -15,7 +15,7 @@ async function generateProtocol(name, executablePath) {
|
||||
}
|
||||
|
||||
async function generateChromiumProtocol(executablePath) {
|
||||
const outputPath = path.join(__dirname, '..', '..', 'src', 'server', 'chromium', 'protocol.ts');
|
||||
const outputPath = path.join(__dirname, '../../src/server/chromium/protocol.ts');
|
||||
process.env.PLAYWRIGHT_CHROMIUM_DEBUG_PORT = '9339';
|
||||
const playwright = require('../../index').chromium;
|
||||
const browser = await playwright.launch({ executablePath });
|
||||
@ -29,8 +29,8 @@ async function generateChromiumProtocol(executablePath) {
|
||||
}
|
||||
|
||||
async function generateWebKitProtocol(folderPath) {
|
||||
const outputPath = path.join(__dirname, '..', '..', 'src', 'server', 'webkit', 'protocol.ts');
|
||||
const json = JSON.parse(await fs.promises.readFile(path.join(folderPath, '..', 'protocol.json'), 'utf8'));
|
||||
const outputPath = path.join(__dirname, '../../src/server/webkit/protocol.ts');
|
||||
const json = JSON.parse(await fs.promises.readFile(path.join(folderPath, '../protocol.json'), 'utf8'));
|
||||
await fs.promises.writeFile(outputPath, jsonToTS({domains: json}));
|
||||
console.log(`Wrote protocol.ts for WebKit to ${path.relative(process.cwd(), outputPath)}`);
|
||||
}
|
||||
@ -126,10 +126,10 @@ function typeOfProperty(property, domain) {
|
||||
}
|
||||
|
||||
async function generateFirefoxProtocol(executablePath) {
|
||||
const outputPath = path.join(__dirname, '..', '..', 'src', 'firefox', 'protocol.ts');
|
||||
const outputPath = path.join(__dirname, '../../src/server/firefox/protocol.ts');
|
||||
const omnija = os.platform() === 'darwin' ?
|
||||
path.join(executablePath, '..', '..', 'Resources', 'omni.ja') :
|
||||
path.join(executablePath, '..', 'omni.ja');
|
||||
path.join(executablePath, '../../Resources/omni.ja') :
|
||||
path.join(executablePath, '../omni.ja');
|
||||
const zip = new StreamZip({file: omnija, storeEntries: true});
|
||||
// @ts-ignore
|
||||
await new Promise(x => zip.on('ready', x));
|
||||
|
Loading…
Reference in New Issue
Block a user