Skip to content

Commit

Permalink
Support both webkit and chromium runs
Browse files Browse the repository at this point in the history
  • Loading branch information
younglim authored Aug 23, 2023
1 parent 4200150 commit c5b4c39
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions playwrightAxeGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ const clickFunc = async (elem,page) => {
if (os.platform() === 'darwin') {
browser = 'webkit';
channel = '';
} else {
// Windows
if (!getDefaultChromeDataDir()) {
channel = 'msedge';
}
}

if (deviceChosen === 'Mobile') {
Expand Down Expand Up @@ -529,16 +534,17 @@ const clickFunc = async (elem,page) => {
continue;
}
}
//for Mac/Win website/sitemap custom flow scan
if ( !(viewportWidth || customDevice) && line.trim() === `const browser = await webkit.launch({` || line.trim() === `const browser = await chromium.launch({`) {
//for Mac/Win custom flow scan
if ( !(viewportWidth || customDevice) && (line.trim() === `const browser = await webkit.launch({` || line.trim() === `const browser = await chromium.launch({`)) {
appendToGeneratedScript(`
const browser = await webkit.launch({
const browser = await ${browser}.launch({
args:['--window-size=1920,1040'],`);
continue;
}
//for MAC custom flow scan with custom viewport width
if ( line.trim() === `const browser = await webkit.launch({`) {
appendToGeneratedScript(` const browser = await webkit.launch({`);
//for Mac/Win custom flow scan
if ( line.trim() === `const browser = await ${browser}.launch({`) {
appendToGeneratedScript(` const browser = await ${browser}.launch({`);

continue;
}

Expand Down Expand Up @@ -737,4 +743,4 @@ const clickFunc = async (elem,page) => {
}
};

export default playwrightAxeGenerator;
export default playwrightAxeGenerator;

0 comments on commit c5b4c39

Please sign in to comment.