mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Remove unneeded draftsFile and newFile locators in dashboard POM
This commit is contained in:
@@ -64,15 +64,11 @@ export class DashboardPage extends BaseWebSocketPage {
|
|||||||
this.projectName = page.getByText("Project 1");
|
this.projectName = page.getByText("Project 1");
|
||||||
|
|
||||||
this.draftsLink = this.sidebar.getByText("Drafts");
|
this.draftsLink = this.sidebar.getByText("Drafts");
|
||||||
this.draftsFile = page.getByText(/New File 1/);
|
|
||||||
|
|
||||||
this.fontsLink = this.sidebar.getByText("Fonts");
|
this.fontsLink = this.sidebar.getByText("Fonts");
|
||||||
|
|
||||||
this.libsLink = this.sidebar.getByText("Libraries");
|
this.libsLink = this.sidebar.getByText("Libraries");
|
||||||
|
|
||||||
this.searchButton = page.getByRole("button", { name: "dashboard-search" });
|
this.searchButton = page.getByRole("button", { name: "dashboard-search" });
|
||||||
this.searchInput = page.getByPlaceholder("Search…");
|
this.searchInput = page.getByPlaceholder("Search…");
|
||||||
this.newFileName = page.getByText("New File 3");
|
|
||||||
|
|
||||||
this.teamDropdown = this.sidebar.getByRole("button", { name: "Your Penpot" });
|
this.teamDropdown = this.sidebar.getByRole("button", { name: "Your Penpot" });
|
||||||
this.userAccount = this.sidebar.getByRole("button", { name: /Princesa Leia/ });
|
this.userAccount = this.sidebar.getByRole("button", { name: /Princesa Leia/ });
|
||||||
@@ -183,6 +179,7 @@ export class DashboardPage extends BaseWebSocketPage {
|
|||||||
await this.page.goto(
|
await this.page.goto(
|
||||||
`#/dashboard/team/${DashboardPage.anyTeamId}/projects/${DashboardPage.draftProjectId}`,
|
`#/dashboard/team/${DashboardPage.anyTeamId}/projects/${DashboardPage.draftProjectId}`,
|
||||||
);
|
);
|
||||||
|
await expect(this.mainHeading).toHaveText("Drafts");
|
||||||
}
|
}
|
||||||
|
|
||||||
async goToAccount() {
|
async goToAccount() {
|
||||||
|
|||||||
@@ -35,11 +35,12 @@ test("User goes to draft page", async ({ page }) => {
|
|||||||
await expect(dashboardPage.mainHeading).toHaveText("Drafts");
|
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);
|
const dashboardPage = new DashboardPage(page);
|
||||||
await dashboardPage.setupDrafts();
|
await dashboardPage.setupDrafts();
|
||||||
|
|
||||||
await dashboardPage.goToDrafts();
|
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();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ test("User goes to a full dashboard", async ({ page }) => {
|
|||||||
|
|
||||||
await dashboardPage.goToDashboard();
|
await dashboardPage.goToDashboard();
|
||||||
|
|
||||||
await expect(dashboardPage.draftsFile).toBeVisible();
|
|
||||||
await expect(dashboardPage.page).toHaveScreenshot();
|
await expect(dashboardPage.page).toHaveScreenshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -121,10 +120,10 @@ test("User goes to a full search page", async ({ page }) => {
|
|||||||
await dashboardPage.goToSearch();
|
await dashboardPage.goToSearch();
|
||||||
await expect(dashboardPage.searchInput).toBeVisible();
|
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.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();
|
await expect(dashboardPage.page).toHaveScreenshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user