0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-19 11:11:21 -05:00

Remove unneeded draftsFile and newFile locators in dashboard POM

This commit is contained in:
Belén Albeza 2024-06-25 15:23:44 +02:00
parent c14f783d94
commit 30edca024a
3 changed files with 6 additions and 9 deletions

View file

@ -64,15 +64,11 @@ export class DashboardPage extends BaseWebSocketPage {
this.projectName = page.getByText("Project 1");
this.draftsLink = this.sidebar.getByText("Drafts");
this.draftsFile = page.getByText(/New File 1/);
this.fontsLink = this.sidebar.getByText("Fonts");
this.libsLink = this.sidebar.getByText("Libraries");
this.searchButton = page.getByRole("button", { name: "dashboard-search" });
this.searchInput = page.getByPlaceholder("Search…");
this.newFileName = page.getByText("New File 3");
this.teamDropdown = this.sidebar.getByRole("button", { name: "Your Penpot" });
this.userAccount = this.sidebar.getByRole("button", { name: /Princesa Leia/ });
@ -183,6 +179,7 @@ export class DashboardPage extends BaseWebSocketPage {
await this.page.goto(
`#/dashboard/team/${DashboardPage.anyTeamId}/projects/${DashboardPage.draftProjectId}`,
);
await expect(this.mainHeading).toHaveText("Drafts");
}
async goToAccount() {

View file

@ -35,11 +35,12 @@ test("User goes to draft page", async ({ page }) => {
await expect(dashboardPage.mainHeading).toHaveText("Drafts");
});
test("User loads the draft page", async ({ page }) => {
test("Lists files in the drafts page", async ({ page }) => {
const dashboardPage = new DashboardPage(page);
await dashboardPage.setupDrafts();
await dashboardPage.goToDrafts();
await expect(dashboardPage.draftsFile).toBeVisible();
await expect(dashboardPage.page.getByRole("button", { name: /New File 1/ })).toBeVisible();
await expect(dashboardPage.page.getByRole("button", { name: /New File 2/ })).toBeVisible();
});

View file

@ -77,7 +77,6 @@ test("User goes to a full dashboard", async ({ page }) => {
await dashboardPage.goToDashboard();
await expect(dashboardPage.draftsFile).toBeVisible();
await expect(dashboardPage.page).toHaveScreenshot();
});
@ -121,10 +120,10 @@ test("User goes to a full search page", async ({ page }) => {
await dashboardPage.goToSearch();
await expect(dashboardPage.searchInput).toBeVisible();
await dashboardPage.searchInput.fill("New");
await dashboardPage.searchInput.fill("3");
await expect(dashboardPage.mainHeading).toHaveText("Search results");
await expect(dashboardPage.newFileName).toBeVisible();
await expect(dashboardPage.page.getByRole("button", { name: "New File 3" })).toBeVisible();
await expect(dashboardPage.page).toHaveScreenshot();
});