
* feat: introduce playwright * test: migrate apps folder to playwright (#1201) * test: rewrite connections tests with playwright (#1203) * test: rewrite executions tests with playwright (#1207) * test: rewrite flow editor tests with playwright (#1212) * test(flow-editor): rewrite tests using serial mode (#1218) * test: update custom connection creation paths * test: move login logic to page fixture * test: remove cypress tests and deps --------- Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
23 lines
520 B
JavaScript
23 lines
520 B
JavaScript
const path = require('node:path');
|
|
|
|
export class BasePage {
|
|
/**
|
|
* @param {import('@playwright/test').Page} page
|
|
*/
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
async clickAway() {
|
|
await this.page.locator('body').click({ position: { x: 0, y: 0 } });
|
|
}
|
|
|
|
async screenshot(options = {}) {
|
|
const { path: plainPath, ...restOptions } = options;
|
|
|
|
const computedPath = path.join('output/screenshots', plainPath);
|
|
|
|
return await this.page.screenshot({ path: computedPath, ...restOptions });
|
|
}
|
|
}
|