1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-04 13:05:24 +02:00

add test for dashboard

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
This commit is contained in:
nabim777 2024-10-07 09:58:56 +05:45
parent 95c8175e8c
commit db81ebcc7f
No known key found for this signature in database
GPG key ID: 6EBA146273BEC371
6 changed files with 114 additions and 1 deletions

View file

@ -0,0 +1,29 @@
const util = require('util');
class dashboardPage {
constructor() {
this.createProjectIconSelector = `.Projects_addTitle__tXhB4`;
this.projectTitleInputSelector = `input[name="name"]`;
this.createProjectButtonSelector = `//button[text()="Create project"]`;
this.projectTitleSelector = `//div[@class="item Header_item__OOEY7 Header_title__l+wMf"][text()="%s"]`;
this.dashBoardHeaderSelector = `//div[@class="Projects_openTitle__PlaU6"][text()="%s"]`;
}
async createProject(project) {
await page.click(this.createProjectIconSelector);
await page.fill(this.projectTitleInputSelector, project);
await page.click(this.createProjectButtonSelector);
}
async getProjectTilte() {
return page.innerText(this.projectTitleSelector);
}
async checkForProjectOpenedOrNot() {
expect(
await page.locator(util.format(this.dashboardPage.projectTitleInputSelector, project)),
).toBeVisible();
}
}
module.exports = dashboardPage;