checkly/headless-recorder

Generated code readability and reusability improvement

vanetreg opened this issue · 3 comments

I have an improvement suggestion regarding generated codes:
instead of using repeatedly codes like:

await page.waitForSelector('veryLongStringRepeated');
await page.click('veryLongStringRepeated');

something like:

let activeSelector = 'veryLongStringRepeated';
waitForAndClickActiveSelector(activeSelector);

would improve code reusability and readability.

I have an improvement suggestion regarding generated codes:

instead of using repeatedly codes like:


await page.waitForSelector(veryLongStringRepeated);

await page.click(veryLongStringRepeated);

something like:


activeSelector = 'veryLongStringRepeated;

waitForAndClickActiveSelector(activeSelector);

would improve code reusability and readability.

I have an improvement suggestion regarding generated codes: instead of using repeatedly codes like:

await page.waitForSelector(veryLongStringRepeated);
await page.click(veryLongStringRepeated);

something like:

activeSelector = 'veryLongStringRepeated;
waitForAndClickActiveSelector(activeSelector);

would improve code reusability and readability.