test(user-interface-configuration): write initial tests (#1242)

* test(user-interface): add tests with playwright

* test: refactor UI configuration tests

---------

Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
This commit is contained in:
Rıdvan Akca
2023-08-25 22:31:02 +03:00
committed by GitHub
parent ddeb18f626
commit a3b3038709
20 changed files with 389 additions and 69 deletions

View File

@@ -1,11 +1,14 @@
const path = require('node:path');
export class BasePage {
screenshotPath = '/';
/**
* @param {import('@playwright/test').Page} page
*/
constructor(page) {
this.page = page;
this.snackbar = this.page.locator('#notistack-snackbar');
}
async clickAway() {
@@ -15,7 +18,11 @@ export class BasePage {
async screenshot(options = {}) {
const { path: plainPath, ...restOptions } = options;
const computedPath = path.join('output/screenshots', plainPath);
const computedPath = path.join(
'output/screenshots',
this.screenshotPath,
plainPath
);
return await this.page.screenshot({ path: computedPath, ...restOptions });
}