-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
87 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,20 @@ | ||
import ListLayoutPage from '@/page-objects/layout/listLayoutPage'; | ||
|
||
export class ProjectListPage extends ListLayoutPage { | ||
export class ProjectListPage extends ListLayoutPage<Project> { | ||
protected path = '/#/projects'; | ||
|
||
// Locators | ||
private createProjectButton = '#add-btn'; | ||
private projectNameColumn = 'td.name'; | ||
private projectSpidersColumn = 'td.spiders'; | ||
private projectDescriptionColumn = 'td:nth-child(3)'; | ||
private deleteButton = '.delete-btn'; | ||
private projectNameColumn = 'td:nth-child(2)'; | ||
private projectSpidersColumn = 'td:nth-child(3)'; | ||
private projectDescriptionColumn = 'td:nth-child(4)'; | ||
|
||
async navigate() { | ||
await super.navigate(); | ||
await this.page.goto(this.path); | ||
await this.waitForPageLoad(); | ||
} | ||
|
||
async waitForPageLoad() { | ||
await this.page.waitForSelector(this.listContainer); | ||
} | ||
|
||
async clickCreateProject() { | ||
await this.page.click(this.createProjectButton); | ||
} | ||
|
||
async searchProject(searchTerm: string) { | ||
await this.page.fill(this.searchInput, searchTerm); | ||
} | ||
|
||
async getProjectCount(): Promise<number> { | ||
return await this.page.locator(this.tableRows).count(); | ||
} | ||
|
||
async getProjectData(rowIndex: number): Promise<{ name: string; spiders: string; description: string }> { | ||
async getTableRow(rowIndex: number) { | ||
const row = this.page.locator(this.tableRows).nth(rowIndex); | ||
return { | ||
name: await row.locator(this.projectNameColumn).innerText(), | ||
spiders: await row.locator(this.projectSpidersColumn).innerText(), | ||
description: await row.locator(this.projectDescriptionColumn).innerText(), | ||
}; | ||
} | ||
|
||
async viewProject(rowIndex: number) { | ||
const row = this.page.locator(this.tableRows).nth(rowIndex); | ||
await row.locator(this.viewButton).click(); | ||
} | ||
|
||
async deleteProject(rowIndex: number) { | ||
const row = this.page.locator(this.tableRows).nth(rowIndex); | ||
await row.locator(this.deleteButton).click(); | ||
} as Project; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './node'; | ||
export * from './project'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export declare global { | ||
interface Node { | ||
name: string; | ||
type: string; | ||
status: string; | ||
enabled: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export declare global { | ||
interface Project { | ||
name: string; | ||
description: string; | ||
spiders: string; | ||
} | ||
} |