-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboardPage.ts
36 lines (27 loc) · 1.12 KB
/
dashboardPage.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Page } from "@playwright/test";
export default class dashboardPage{
constructor(public page: Page, public baseURL: string){}
async goto(){
await this.page.goto(`${this.baseURL}/dashboard`);
};
async clickProfile(){
const profileAvatar = this.page.locator("//button[@aria-label='Open user navigation menu']");
await profileAvatar.waitFor({ state: "visible" });
await profileAvatar.click({ force: true });
}
async clickSingout(){
await this.page.locator("//span[normalize-space(text())='Sign out']").click();
}
async clickMenu(menu: string){
await this.page.locator(`//span[normalize-space(text())='${menu}']`).click();
}
async clickNewbutton(){
await this.page.locator("(//a[contains(@class,'Button--primary Button--small')]//span)[1]").click();
}
async searchRepo(repoName: string){
await this.page.locator("#dashboard-repos-filter-left").fill(repoName);
}
async clickRepoName(repoName: string){
await this.page.locator(`(//a[@data-hovercard-url='/${repoName}/hovercard'])[2]`).click();
}
}