-
Notifications
You must be signed in to change notification settings - Fork 12
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
add manager tests #4
base: main
Are you sure you want to change the base?
Conversation
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.
Great job on implementing the Playwright test project for Wizard Bank! 🎉 Your code effectively meets the task requirements and constraints, covering various test scenarios for bank manager functionalities. While there are some minor issues related to assumptions about table row order, these do not critically impact the functionality. Keep up the good work, and consider refining these areas for even more robust tests in the future. Happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
async assertCustomersTableContainsFirstName(value) { | ||
await expect(this.lastRow).toContainText(value); |
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.
The method assertCustomersTableContainsFirstName
assumes that the last row in the table is the newly added customer. This might not be reliable if the table is sorted or updated dynamically. Consider searching for the specific row containing the expected first name.
async assertCustomersTableContainsLastName(value) { | ||
await expect(this.lastRow).toContainText(value); |
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.
Similar to the previous comment, assertCustomersTableContainsLastName
assumes the last row is the newly added customer. Ensure that the method accurately identifies the correct row.
async assertCustomersTableContainsPostalCode(value) { | ||
await expect(this.lastRow).toContainText(value); |
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.
The method assertCustomersTableContainsPostalCode
also relies on the last row assumption. Consider implementing a more robust way to verify the postal code in the table.
this.lastRow = page.getByRole('row').last(); | ||
this.accountNumberCell = this.lastRow.getByRole('cell').nth(3); |
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.
The use of lastRow
to access the account number cell assumes that the last row is always relevant for the operation. This might not be reliable if the table is sorted or updated dynamically. Consider searching for the specific row containing the expected account number.
this.firstRow = page.getByRole('row').nth(1); | ||
this.firstNameCell = this.firstRow.getByRole('cell').nth(0); | ||
|
||
this.lastNameCell = this.firstRow.getByRole('cell').nth(1); | ||
|
||
this.postCodeCell = this.firstRow.getByRole('cell').nth(2); |
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.
The use of firstRow
to access the first name, last name, and post code cells assumes that the first row is always the correct one to check. This might not be reliable if the table is sorted or filtered. Consider implementing a more robust way to verify the customer details.
this.lastRow = page.getByRole('row').last(); | ||
this.accountNumberCell = this.lastRow.getByRole('cell').nth(3); |
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.
The use of lastRow
to access the account number cell assumes that the last row is always relevant for the operation. This might not be reliable if the table is sorted or updated dynamically. Consider searching for the specific row containing the expected account number.
await addCustomerPage.assertCustomersTableContainsFirstName(firstName); | ||
await addCustomerPage.assertCustomersTableContainsLastName(lastName); | ||
await addCustomerPage.assertCustomersTableContainsPostalCode(postCode); |
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.
The assertions for checking the first name, last name, and postal code rely on the last row being the newly added customer. This might not be reliable if the table is sorted or updated dynamically. Consider implementing a more robust way to verify the customer details.
@@ -22,6 +35,12 @@ Test: | |||
4. Reload the page. | |||
5. Assert customer row is not present in the table. | |||
*/ | |||
const customersListPage = new CustomersListPage(page); | |||
const fullName = firstName + ' ' + lastName + ' ' + postCode; |
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.
The fullName
variable includes the postal code, which might not match the row's name attribute if it only contains the first and last name. Verify that the format of fullName
matches the format used in the customer table for the row's name attribute.
const fullName = firstName + ' ' + lastName + ' ' + postCode; | ||
|
||
await customersListPage.assertCustomerRowHasAccountNumber(fullName); |
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.
The fullName
variable includes the postal code, which might not match the row's name attribute if it only contains the first and last name. Verify that the format of fullName
matches the format used in the customer table for the row's name attribute.
firstName = faker.person.firstName(); | ||
lastName = faker.person.lastName(); | ||
postalCode = faker.location.zipCode(); |
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.
The variables firstName
, lastName
, and postalCode
are initialized twice. The second initialization is redundant and should be removed to clean up the code.
No description provided.