-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub tab next cases #10
base: 5.5
Are you sure you want to change the base?
Conversation
ADD_EMPLOYEE = 'Add Employee' | ||
} | ||
|
||
export enum Labels { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generally recommended to name enums in a singular way. So it would be Label
instead of Labels
. This reflects that each constant within the enum (like USERNAME, PASSWORD, LOGIN, etc.) represents a single, distinct label. This singular naming convention makes the code more intuitive and easier to understand, especially for other developers who might work with it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right when we use it lebel.specific_label then it is one lebel not more
return this.page.getByText(Labels.EDIT_POST); | ||
} | ||
|
||
protected getDletePostButton( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - Delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
public getCommentInput( | ||
randomTitle: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably not name this randomTitle but just title. The place where you call this function does not use randomTitle. Even if it would be random from the callers perspective - still using "title" as name makes more sense. Because if you would just pass not a random title, then the parameters name would be more generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// public getPostWithRandomTitleWithoutPhoto(randomTitle: string): Locator { | ||
// return this.page.locator(`.orangehrm-buzz-post-body:has(:text("${randomTitle}")) .orangehrm-buzz-post-body-text`); | ||
// } | ||
// this also works, let's keep it in codebase for poor times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does poor times mean? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poor times means times when we do not know how to do something then we will have 2 soluation maybe in different code only 1 of them will work so i would keep it in code
): Locator { | ||
return this.page | ||
.getByText(randomNewEmployeeName) | ||
.locator("xpath=../..") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this locator work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this particular case, ../.. is an XPath expression used to select the parent of the parent element. It's essentially asking Playwright to locate an element's grandparent. This could be useful when you want to select an element relative to its grandparent in the HTML structure.
src/test/functional/pages/PimPage.ts
Outdated
firstRandomName: string, | ||
bySubtub?: boolean | null | ||
) { | ||
if (bySubtub === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do: if (bySubtub)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ur right
src/test/functional/pages/PimPage.ts
Outdated
await this.searchEmployeeButton.click() | ||
public async addEmployeeWithLoginDetails( | ||
firstRandomName: string, | ||
bySubtub?: boolean | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You created an union type here which is boolean | null
- do you need null here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ur right, null no needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job! you definitely improved your code!
public async searchEmployeeById(employeeId:string) { | ||
await this.employeeIdInput.type(employeeId) | ||
await this.searchEmployeeButton.click() | ||
public async addEmployeeWithLoginDetails( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"...LoginCredentails" instead of "LoginDetails"? More accurate, but you choice ;)
await expect(page.locator(tableCells[0])).toBeVisible(); | ||
await expect(page.locator(tableCells[1])).toBeVisible() | ||
}) | ||
test("Admin user should edit previousely created employee with random name", async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the title is confusing. Why "random name"? I think you know already which employee you have been created, so it is not random anymore ;) I suggest to remove word "random"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and in general, for all method's name - why you always write get...byRANDOM...? why Random? I know that you generated ranom name, but it is confusing. Of course MINOR comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.