-
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
Main task is done #8
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.
Thank you for your hard work on this pull request! 😊 While you've done a great job overall, there are a few critical issues that need to be addressed before we can approve it:
-
Syntax Errors: There are several missing semicolons across different files (
BankHomePage
,AddCustomerPage
,BankManagerMainPage
, and some test scripts). These could lead to syntax errors, which are critical as they can break the functionality of your code. -
Awaiting Method Calls: The method
clickCustomersTab()
should be awaited to ensure the correct sequence of actions. This is crucial to maintain the functionality of the test script. -
Test Descriptions and Comments: Some test descriptions and comments are misleading or incorrect. It's important to update these to accurately reflect the actions being tested to avoid confusion.
-
Import Statements: The import statement for
Faker
is unnecessary if onlyfaker
is being used. Removing unused imports helps keep the code clean and maintainable.
Please address these issues to ensure the functionality and clarity of your code. Once these are resolved, we can proceed with the approval. Keep up the great work, and don't hesitate to reach out if you need any help! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
@@ -4,6 +4,7 @@ export class BankHomePage { | |||
constructor(page) { | |||
this.page = page; | |||
this.customerLoginButton = page.getByRole('button', { name: 'Customer Login' }); | |||
this.managerLoginButton = page.getByRole('button', { name: 'Bank Manager Login' }) |
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.
There is a missing semicolon at the end of this line. It's important to include semicolons to avoid potential syntax errors.
this.postCodeField = page.getByPlaceholder('Post Code'); | ||
this.addCustomerButton = page.getByRole('form').getByRole('button', { name: 'Add Customer' }); | ||
|
||
this.accountTab = page.getByRole('button', { name: 'Open Account' }) |
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.
There is a missing semicolon at the end of this line. It's important to include semicolons to avoid potential syntax errors.
} | ||
|
||
async getButtonByName (buttonName) { | ||
return this.page.getByRole('button', { name: `${buttonName}` }) |
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.
There is a missing semicolon at the end of this line. It's important to include semicolons to avoid potential syntax errors.
@@ -1,5 +1,7 @@ | |||
import { test } from '@playwright/test'; | |||
import { faker } from '@faker-js/faker'; | |||
import { Faker, faker } from '@faker-js/faker'; |
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 import statement for Faker
is unnecessary if you are only using faker
. You can remove Faker
from the import.
10. As customer in the table in the last row. | ||
sert the Postal Code of the customer is present in the table in the last row. | ||
11. Assert there is no account number for the new |
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.
There seems to be a formatting issue in the test description comments. Ensure that the steps are clearly numbered and described. It looks like step 10 is split across two lines, and step 11 is incomplete.
await openAccountPage.assertCurrency('Dollar') | ||
|
||
await openAccountPage.selectCurrency('Pound'); | ||
await openAccountPage.assertCurrency('Pound') |
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.
There is a missing semicolon at the end of this line. It's important to include semicolons to avoid potential syntax errors.
await openAccountPage.assertCurrency('Pound') | ||
|
||
await openAccountPage.selectCurrency('Rupee'); | ||
await openAccountPage.assertCurrency('Rupee') |
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.
There is a missing semicolon at the end of this line. It's important to include semicolons to avoid potential syntax errors.
await addCustomerPage.fillFirstNameField(customer.firstName); | ||
await addCustomerPage.fillLastNameField(customer.lastName); | ||
await addCustomerPage.fillPostCode(customer.postCode); | ||
await addCustomerPage.clickAddCustomerButton(); | ||
}); | ||
|
||
test('Assert manager can add new customer', async ({ page }) => { |
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 test name 'Assert manager can add new customer' is misleading. It should reflect the action being tested, such as 'Assert manager can open a new account'.
|
||
await customersListPage.searchForCustomer(customer.firstName); | ||
await customersListPage.assertCustomerRowVisibility(customer.firstName, customer.lastName, customer.postCode, true); | ||
await customersListPage.assertCustomerRowCount(2); // 1-header row with text |
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 comment suggests that the expected row count is 2, including the header row. Ensure that this matches the actual structure of your table. If the table includes a header row, the expected count should be 2; otherwise, it should be 1.
|
||
}); | ||
|
||
test('Assert manager can search customer by Last Name', async ({ page }) => { | ||
/* | ||
Test: | ||
1. Open Customers page | ||
2. Fill the lastName to the search field | ||
2. Fill the firstName to the search field |
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 comment mentions filling the 'firstName' in the search field, but the test is for searching by 'lastName'. Update the comment to accurately reflect the action: 'Fill the lastName to the search field'.
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 your submission! 🎉 While your code is mostly well-implemented, there are a few areas that need attention to ensure clarity and functionality:
-
Syntax Errors: Ensure all lines, such as those in
BankHomePage.js
andAddCustomerPage.js
, have the necessary semicolons to prevent potential syntax errors. -
Awaiting Method Calls: It's crucial to await method calls like
clickCustomersTab()
in your test scripts to maintain the correct sequence of actions. -
Test Descriptions and Comments: Some test descriptions and comments are misleading or incomplete. For instance, in
managerCanAddNewCustomer.spec.js
, ensure the description accurately reflects the test case, and complete any unfinished comments. -
Unused Imports: Remove any unused imports, such as
Faker
, to keep your code clean and efficient. -
Assertion Clarity: Make sure assertions, like those for customer row counts, clearly explain the expected outcomes, especially if they include header rows.
By addressing these issues, you'll enhance the clarity and functionality of your code. Keep up the great work, and continue learning from these experiences! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
|
||
export class BankHomePage { | ||
constructor(page) { | ||
this.page = page; | ||
this.customerLoginButton = page.getByRole('button', { name: 'Customer Login' }); | ||
this.managerLoginButton = page.getByRole('button', { name: 'Bank Manager Login' }) |
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.
There is a missing semicolon at the end of this line. Adding it will prevent potential syntax errors.
this.postCodeField = page.getByPlaceholder('Post Code'); | ||
this.addCustomerButton = page.getByRole('form').getByRole('button', { name: 'Add Customer' }); | ||
|
||
this.accountTab = page.getByRole('button', { name: 'Open Account' }) |
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.
There is a missing semicolon at the end of this line. Adding it will prevent potential syntax errors.
|
||
test('Assert manager can add new customer', async ({ page }) => { | ||
test('Assert manager can open new account', async ({ page }) => { |
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 test description is misleading. It should reflect the actual test case, which is about adding a new customer, not opening a new account.
10. As customer in the table in the last row. | ||
sert the Postal Code of the customer is present in the table in the last row. | ||
11. Assert there is no account number for the new |
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.
There are typos in the comments. Line 18 should start with 'Assert the Postal Code of the customer is present in the table in the last row.' and line 20 should complete the sentence about asserting there is no account number for the new customer.
await addCustomerPage.fillFirstNameField(customer.firstName); | ||
await addCustomerPage.fillLastNameField(customer.lastName); | ||
await addCustomerPage.fillPostCode(customer.postCode); | ||
await addCustomerPage.clickAddCustomerButton(); | ||
}); | ||
|
||
test('Assert manager can add new customer', async ({ page }) => { |
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 test description is misleading. It should reflect the actual test case, which is about opening a new account, not adding a new customer.
|
||
await customersListPage.searchForCustomer(customer.firstName); | ||
await customersListPage.assertCustomerRowVisibility(customer.firstName, customer.lastName, customer.postCode, true); | ||
await customersListPage.assertCustomerRowCount(2); // 1-header row with text |
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 assertion for the customer row count should clearly indicate why the expected count is 2. If the count includes a header row, ensure this is clearly documented in the test steps or comments.
|
||
await customersListPage.searchForCustomer(customer.lastName); | ||
await customersListPage.assertCustomerRowVisibility(customer.firstName, customer.lastName, customer.postCode, true); | ||
await customersListPage.assertCustomerRowCount(2); // 1-header row with text |
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 assertion for the customer row count should clearly indicate why the expected count is 2. If the count includes a header row, ensure this is clearly documented in the test steps or comments.
|
||
await customersListPage.searchForCustomer(customer.postCode); | ||
await customersListPage.assertCustomerRowVisibility(customer.firstName, customer.lastName, customer.postCode, true); | ||
await customersListPage.assertCustomerRowCount(2); // 1-header row with text |
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 assertion for the customer row count should clearly indicate why the expected count is 2. If the count includes a header row, ensure this is clearly documented in the test steps or comments.
No description provided.