-
Notifications
You must be signed in to change notification settings - Fork 204
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
Mark Order As Received Test Automation #2320
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce a series of new page object model classes for managing various functionalities in a web application, primarily focused on user accounts, orders, vendor interactions, and admin settings. Each class is designed to streamline automated testing using Playwright, encapsulating methods for element interaction and enhancing the maintainability of test scripts. New end-to-end tests validate critical workflows, ensuring that features operate as intended. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Vendor
participant Admin
participant System
User->>System: Log in
User->>System: View Orders
User->>System: Mark Order as Received
System->>User: Confirm Status Updated
Vendor->>System: Create Shipment
Vendor->>System: Update Shipping Status
Admin->>System: Access Shipping Status Settings
Admin->>System: Save Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 13
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts (1 hunks)
- tests/pw/pages/frontend/my-orders/all-my-orders.page.ts (1 hunks)
- tests/pw/pages/frontend/my-orders/customer-order-details.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts (1 hunks)
- tests/pw/pages/wp-admin/common/sidebar.page.ts (1 hunks)
- tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts (1 hunks)
- tests/pw/pages/wp-admin/products/all-products.page.ts (1 hunks)
- tests/pw/pages/wp-admin/products/edit-product.page.ts (1 hunks)
- tests/pw/tests/e2e/shipping-status/mark-order-as-received-01.spec.ts (1 hunks)
- tests/pw/tests/e2e/shipping-status/mark-order-as-received-02.spec.ts (1 hunks)
Additional context used
Biome
tests/pw/pages/wp-admin/products/edit-product.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/common/sidebar.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/products/all-products.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-orders/all-my-orders.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-orders/customer-order-details.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/tests/e2e/shipping-status/mark-order-as-received-02.spec.ts
[error] 15-15: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
Additional comments not posted (45)
tests/pw/pages/wp-admin/products/edit-product.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the publish button.
13-15
: LGTM!The method correctly clicks on the publish button.
tests/pw/pages/wp-admin/common/sidebar.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the side menu item based on the title.
13-15
: LGTM!The method correctly clicks on the products link in the side menu.
tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the sidebar menu item based on the title.
13-15
: LGTM!The method correctly clicks on the orders tab in the sidebar menu.
tests/pw/pages/wp-admin/products/all-products.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for a product title based on the product ID.
13-15
: LGTM!The method correctly clicks on the product title element based on the product ID.
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for an order title based on the order ID.
13-15
: LGTM!The method correctly clicks on the order title element based on the order ID.
tests/pw/pages/frontend/my-orders/all-my-orders.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for a view button based on the order ID.
13-15
: LGTM!The method correctly clicks on the view button element based on the order ID.
tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts (6)
9-11
: LGTM!The method correctly returns the locator for the username input field.
13-15
: LGTM!The method correctly returns the locator for the password input field.
17-19
: LGTM!The method correctly returns the locator for the login button.
21-23
: LGTM!The method correctly fills the username input field with the provided username.
25-27
: LGTM!The method correctly fills the password input field with the provided password.
29-31
: LGTM!The method correctly clicks on the login button.
tests/pw/pages/frontend/my-orders/customer-order-details.page.ts (5)
9-11
: LGTM!The method correctly returns the locator for the order received button by shipment number.
13-15
: LGTM!The method correctly returns the locator for the tracking status by shipment number.
17-19
: LGTM!The method correctly returns the locator for the OK button in the dialogue box.
21-23
: LGTM!The method correctly clicks the order received button by shipment number.
25-27
: LGTM!The method correctly clicks the OK button in the dialogue box.
tests/pw/tests/e2e/shipping-status/mark-order-as-received-01.spec.ts (1)
19-29
: LGTM!The test case correctly verifies the functionality of marking an order as received by enabling the relevant settings and checking the status.
tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts (6)
9-11
: LGTM!The method correctly returns the locator for the shipping status tab.
13-15
: LGTM!The method correctly returns the locator for the shipment tracking checkbox.
17-19
: LGTM!The method correctly returns the locator for the mark as received checkbox.
35-37
: LGTM!The method correctly returns the locator for the save changes button.
39-41
: LGTM!The method correctly clicks on the shipping status tab.
43-45
: LGTM!The methods correctly click on their respective elements.
Also applies to: 47-49, 51-53
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts (8)
9-11
: LGTM!The method correctly returns the locator for the create new shipment button.
13-15
: LGTM!The method correctly returns the locator for a shipment item checkbox based on the item number.
17-19
: LGTM!The method correctly returns the locator for the shipping status dropdown.
21-23
: LGTM!The method correctly returns the locator for the shipping provider dropdown.
25-27
: LGTM!The method correctly returns the locator for the shipping date field.
29-31
: LGTM!The method correctly returns the locator for the shipping tracking number field.
33-35
: LGTM!The method correctly returns the locator for the create shipment button.
37-39
: LGTM!The methods correctly perform actions on their respective elements.
Also applies to: 41-43, 45-47, 49-51, 53-55, 57-59, 61-63
tests/pw/tests/e2e/shipping-status/mark-order-as-received-02.spec.ts (7)
1-13
: LGTM!The necessary imports are correctly included.
20-23
: LGTM!The setup for the test case is correct and necessary.
24-28
: LGTM!The customer creation logic is correct and necessary.
29-33
: LGTM!The vendor creation logic is correct and necessary.
34-52
: LGTM!The product creation logic is correct and necessary.
54-71
: LGTM!The product publishing logic is correct and necessary.
73-113
: LGTM!The order creation logic is correct and necessary.
test.describe.only('Mark Order As Received - 02', () => { | ||
test.beforeEach(async ({ page }, testInfo) => { | ||
await page.goto(testInfo.project.use.baseURL as 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.
Remove the only
method from the test suite.
The only
method is often used for debugging or during implementation. It should be removed to ensure all tests are executed.
- test.describe.only('Mark Order As Received - 02', () => {
+ test.describe('Mark Order As Received - 02', () => {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
test.describe.only('Mark Order As Received - 02', () => { | |
test.beforeEach(async ({ page }, testInfo) => { | |
await page.goto(testInfo.project.use.baseURL as string); | |
}); | |
test.describe('Mark Order As Received - 02', () => { | |
test.beforeEach(async ({ page }, testInfo) => { | |
await page.goto(testInfo.project.use.baseURL as string); | |
}); |
Tools
Biome
[error] 15-15: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
const vendorBrowser = await chromium.launch(browserOptions); | ||
const vendorPage = await vendorBrowser.newPage(); | ||
|
||
const vendorDashboardSidebarPage = new VendorDashboardSidebarPage(vendorPage); | ||
const vendorAllOrdersPage = new VendorAllOrdersPage(vendorPage); | ||
const vendorEditOrderPage = new VendorEditOrderPage(vendorPage); | ||
const vendorMyAccountAuthPage = new MyAccountAuthPage(vendorPage); | ||
|
||
// vendor login | ||
await vendorPage.goto('/dashboard/'); | ||
await vendorMyAccountAuthPage.enterUsername(vendorEmail); | ||
await vendorMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | ||
await vendorMyAccountAuthPage.clickOnLoginButton(); | ||
|
||
// create shipment | ||
await vendorDashboardSidebarPage.clickOnOrdersTab(); | ||
await vendorAllOrdersPage.clickOnOrderById(`${orderId}`); | ||
await vendorEditOrderPage.clickOnCreateNewShipmentButton(); | ||
await vendorEditOrderPage.clickOnShipmentItemCheckboxByIndex('1'); | ||
|
||
await vendorEditOrderPage.selectShippingStatus('Delivered'); | ||
await vendorEditOrderPage.selectShippingProvider('Fedex'); | ||
await vendorEditOrderPage.enterShippingDate('July 27, 2024'); | ||
await vendorEditOrderPage.enterShippingTrackingNumber('#KDJNS93'); | ||
await vendorEditOrderPage.clickOnCreateShipmentButton(); | ||
|
||
// close vendor browser | ||
await vendorBrowser.close(); | ||
|
||
const customerBrowser = await chromium.launch(browserOptions); | ||
const customerPage = await customerBrowser.newPage(); | ||
|
||
const customerMyAccountAuthPage = new MyAccountAuthPage(customerPage); | ||
const allMyOrdersPage = new AllMyOrdersPage(customerPage); | ||
const customerOrderDetailsPage = new CustomerOrderDetailsPage(customerPage); | ||
|
||
// customer login | ||
await customerPage.goto('/my-account/'); | ||
await customerMyAccountAuthPage.enterUsername(customerEmail); | ||
await customerMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | ||
await customerMyAccountAuthPage.clickOnLoginButton(); | ||
|
||
// customer marks order as received | ||
await customerPage.goto('/my-orders/'); | ||
await allMyOrdersPage.clickOnViewButtonByOrderId(`${orderId}`); | ||
await customerOrderDetailsPage.markOrderAsReceived('#1'); | ||
await customerOrderDetailsPage.clickOnDialogBoxOkButton(); | ||
|
||
// temporary solution, will be replaced | ||
await page.waitForTimeout(3000); | ||
|
||
const status = await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').textContent(); | ||
expect(status?.trim()).toEqual('Received'); | ||
}); |
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.
Replace the temporary solution using waitForTimeout
.
The waitForTimeout
is a temporary solution and should be replaced with a more reliable method, such as waiting for a specific element to be visible or a network request to complete.
- // temporary solution, will be replaced
- await page.waitForTimeout(3000);
+ // replace with a more reliable method
+ await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').waitFor({ state: 'visible' });
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const vendorBrowser = await chromium.launch(browserOptions); | |
const vendorPage = await vendorBrowser.newPage(); | |
const vendorDashboardSidebarPage = new VendorDashboardSidebarPage(vendorPage); | |
const vendorAllOrdersPage = new VendorAllOrdersPage(vendorPage); | |
const vendorEditOrderPage = new VendorEditOrderPage(vendorPage); | |
const vendorMyAccountAuthPage = new MyAccountAuthPage(vendorPage); | |
// vendor login | |
await vendorPage.goto('/dashboard/'); | |
await vendorMyAccountAuthPage.enterUsername(vendorEmail); | |
await vendorMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | |
await vendorMyAccountAuthPage.clickOnLoginButton(); | |
// create shipment | |
await vendorDashboardSidebarPage.clickOnOrdersTab(); | |
await vendorAllOrdersPage.clickOnOrderById(`${orderId}`); | |
await vendorEditOrderPage.clickOnCreateNewShipmentButton(); | |
await vendorEditOrderPage.clickOnShipmentItemCheckboxByIndex('1'); | |
await vendorEditOrderPage.selectShippingStatus('Delivered'); | |
await vendorEditOrderPage.selectShippingProvider('Fedex'); | |
await vendorEditOrderPage.enterShippingDate('July 27, 2024'); | |
await vendorEditOrderPage.enterShippingTrackingNumber('#KDJNS93'); | |
await vendorEditOrderPage.clickOnCreateShipmentButton(); | |
// close vendor browser | |
await vendorBrowser.close(); | |
const customerBrowser = await chromium.launch(browserOptions); | |
const customerPage = await customerBrowser.newPage(); | |
const customerMyAccountAuthPage = new MyAccountAuthPage(customerPage); | |
const allMyOrdersPage = new AllMyOrdersPage(customerPage); | |
const customerOrderDetailsPage = new CustomerOrderDetailsPage(customerPage); | |
// customer login | |
await customerPage.goto('/my-account/'); | |
await customerMyAccountAuthPage.enterUsername(customerEmail); | |
await customerMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | |
await customerMyAccountAuthPage.clickOnLoginButton(); | |
// customer marks order as received | |
await customerPage.goto('/my-orders/'); | |
await allMyOrdersPage.clickOnViewButtonByOrderId(`${orderId}`); | |
await customerOrderDetailsPage.markOrderAsReceived('#1'); | |
await customerOrderDetailsPage.clickOnDialogBoxOkButton(); | |
// temporary solution, will be replaced | |
await page.waitForTimeout(3000); | |
const status = await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').textContent(); | |
expect(status?.trim()).toEqual('Received'); | |
}); | |
const vendorBrowser = await chromium.launch(browserOptions); | |
const vendorPage = await vendorBrowser.newPage(); | |
const vendorDashboardSidebarPage = new VendorDashboardSidebarPage(vendorPage); | |
const vendorAllOrdersPage = new VendorAllOrdersPage(vendorPage); | |
const vendorEditOrderPage = new VendorEditOrderPage(vendorPage); | |
const vendorMyAccountAuthPage = new MyAccountAuthPage(vendorPage); | |
// vendor login | |
await vendorPage.goto('/dashboard/'); | |
await vendorMyAccountAuthPage.enterUsername(vendorEmail); | |
await vendorMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | |
await vendorMyAccountAuthPage.clickOnLoginButton(); | |
// create shipment | |
await vendorDashboardSidebarPage.clickOnOrdersTab(); | |
await vendorAllOrdersPage.clickOnOrderById(`${orderId}`); | |
await vendorEditOrderPage.clickOnCreateNewShipmentButton(); | |
await vendorEditOrderPage.clickOnShipmentItemCheckboxByIndex('1'); | |
await vendorEditOrderPage.selectShippingStatus('Delivered'); | |
await vendorEditOrderPage.selectShippingProvider('Fedex'); | |
await vendorEditOrderPage.enterShippingDate('July 27, 2024'); | |
await vendorEditOrderPage.enterShippingTrackingNumber('#KDJNS93'); | |
await vendorEditOrderPage.clickOnCreateShipmentButton(); | |
// close vendor browser | |
await vendorBrowser.close(); | |
const customerBrowser = await chromium.launch(browserOptions); | |
const customerPage = await customerBrowser.newPage(); | |
const customerMyAccountAuthPage = new MyAccountAuthPage(customerPage); | |
const allMyOrdersPage = new AllMyOrdersPage(customerPage); | |
const customerOrderDetailsPage = new CustomerOrderDetailsPage(customerPage); | |
// customer login | |
await customerPage.goto('/my-account/'); | |
await customerMyAccountAuthPage.enterUsername(customerEmail); | |
await customerMyAccountAuthPage.enterPassword(process.env.USER_PASSWORD); | |
await customerMyAccountAuthPage.clickOnLoginButton(); | |
// customer marks order as received | |
await customerPage.goto('/my-orders/'); | |
await allMyOrdersPage.clickOnViewButtonByOrderId(`${orderId}`); | |
await customerOrderDetailsPage.markOrderAsReceived('#1'); | |
await customerOrderDetailsPage.clickOnDialogBoxOkButton(); | |
// replace with a more reliable method | |
await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').waitFor({ state: 'visible' }); | |
const status = await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').textContent(); | |
expect(status?.trim()).toEqual('Received'); | |
}); |
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.
Actionable comments posted: 13
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts (1 hunks)
- tests/pw/pages/frontend/my-orders/all-my-orders.page.ts (1 hunks)
- tests/pw/pages/frontend/my-orders/customer-order-details.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts (1 hunks)
- tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts (1 hunks)
- tests/pw/pages/wp-admin/common/sidebar.page.ts (1 hunks)
- tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts (1 hunks)
- tests/pw/pages/wp-admin/products/all-products.page.ts (1 hunks)
- tests/pw/pages/wp-admin/products/edit-product.page.ts (1 hunks)
- tests/pw/tests/e2e/shipping-status/mark-order-as-received-01.spec.ts (1 hunks)
- tests/pw/tests/e2e/shipping-status/mark-order-as-received-02.spec.ts (1 hunks)
Additional context used
Biome
tests/pw/pages/wp-admin/products/edit-product.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/common/sidebar.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/products/all-products.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-orders/all-my-orders.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/my-orders/customer-order-details.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
tests/pw/tests/e2e/shipping-status/mark-order-as-received-02.spec.ts
[error] 15-15: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
Additional comments not posted (45)
tests/pw/pages/wp-admin/products/edit-product.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the publish button.
13-15
: LGTM!The method correctly clicks on the publish button.
tests/pw/pages/wp-admin/common/sidebar.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the sidebar menu item based on the provided title.
13-15
: LGTM!The method correctly clicks on the products link in the sidebar menu.
tests/pw/pages/frontend/vendor-dashboard/common/vendor-sidebar.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the sidebar menu item based on the provided title.
13-15
: LGTM!The method correctly clicks on the orders tab in the sidebar menu.
tests/pw/pages/wp-admin/products/all-products.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the product title based on the product ID.
13-15
: LGTM!The method correctly clicks on the product title element based on the product ID.
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-all-orders.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the order title based on the order ID.
13-15
: LGTM!The method correctly clicks on the order title element based on the order ID.
tests/pw/pages/frontend/my-orders/all-my-orders.page.ts (2)
9-11
: LGTM!The method correctly returns a locator for the view button based on the order ID.
13-15
: LGTM!The method correctly clicks on the view button element based on the order ID.
tests/pw/pages/frontend/my-account/auth/my-account-auth.page.ts (5)
9-11
: LGTM!The method is correctly implemented.
13-15
: LGTM!The method is correctly implemented.
17-19
: LGTM!The method is correctly implemented.
21-23
: LGTM!The method is correctly implemented.
25-31
: LGTM!The methods are correctly implemented.
tests/pw/pages/frontend/my-orders/customer-order-details.page.ts (5)
9-11
: LGTM!The method is correctly implemented.
13-15
: LGTM!The method is correctly implemented.
17-19
: LGTM!The method is correctly implemented.
21-23
: LGTM!The method is correctly implemented.
25-27
: LGTM!The method is correctly implemented.
tests/pw/tests/e2e/shipping-status/mark-order-as-received-01.spec.ts (1)
9-29
: LGTM!The test suite is correctly implemented.
tests/pw/pages/wp-admin/dokan/settings/shipping-status.page.ts (8)
9-11
: LGTM!The method correctly returns the locator for the shipping status tab.
13-15
: LGTM!The method correctly returns the locator for the shipment tracking checkbox.
17-19
: LGTM!The method correctly returns the locator for the mark as received checkbox.
35-37
: LGTM!The method correctly returns the locator for the save changes button.
39-41
: LGTM!The method correctly performs the click action on the shipping status tab.
43-45
: LGTM!The method correctly performs the click action on the shipment tracking checkbox.
47-49
: LGTM!The method correctly performs the click action on the mark as received checkbox.
51-53
: LGTM!The method correctly performs the click action on the save changes button.
tests/pw/pages/frontend/vendor-dashboard/orders/vendor-edit-order.page.ts (14)
9-11
: LGTM!The method correctly returns the locator for the create new shipment button.
13-15
: LGTM!The method correctly returns the locator for the shipment item checkbox based on the provided index.
17-19
: LGTM!The method correctly returns the locator for the shipping status dropdown.
21-23
: LGTM!The method correctly returns the locator for the shipping provider dropdown.
25-27
: LGTM!The method correctly returns the locator for the shipping date field.
29-31
: LGTM!The method correctly returns the locator for the shipping tracking number field.
33-35
: LGTM!The method correctly returns the locator for the create shipment button.
37-39
: LGTM!The method correctly performs the click action on the create new shipment button.
41-43
: LGTM!The method correctly performs the click action on the shipment item checkbox based on the provided index.
45-47
: LGTM!The method correctly performs the selection action in the shipping status dropdown.
49-51
: LGTM!The method correctly performs the selection action in the shipping provider dropdown.
53-55
: LGTM!The method correctly performs the fill action in the shipping date field.
57-59
: LGTM!The method correctly performs the fill action in the shipping tracking number field.
61-63
: LGTM!The method correctly performs the click action on the create shipment button.
constructor(page: Page) { | ||
super(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.
Remove the unnecessary constructor.
The constructor is redundant as it only calls the parent constructor without adding any additional logic.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
constructor(page: Page) { | ||
super(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.
Remove the unnecessary constructor.
The constructor is unnecessary as it only calls the parent constructor. Simplify the code by removing it.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
constructor(page: Page) { | ||
super(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.
Remove the unnecessary constructor.
The constructor is redundant as it only calls the parent constructor without adding any additional logic.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
constructor(page: Page) { | ||
super(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.
Remove the unnecessary constructor.
The constructor is unnecessary as it only calls the parent constructor. Simplify the code by removing it.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
constructor(page: Page) { | ||
super(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.
Remove the unnecessary constructor.
The constructor does not add any new functionality and can be safely removed.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
constructor(page: Page) { | ||
super(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.
Remove unnecessary constructor.
The constructor is unnecessary as it only calls the parent constructor.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
async shippingStatusItem(status: string) { | ||
const list = this.page.locator('//ul[@class="dokan-settings-repeatable-list"]/li').all(); | ||
|
||
let locator; | ||
for (const item of await list) { | ||
const text = await item.textContent(); | ||
if (text?.includes(status)) { | ||
locator = item; | ||
} | ||
} | ||
|
||
return locator; | ||
} |
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.
Optimize the method to find the shipping status item.
The method can be optimized by using array methods to find the item with the matching status.
- async shippingStatusItem(status: string) {
- const list = this.page.locator('//ul[@class="dokan-settings-repeatable-list"]/li').all();
-
- let locator;
- for (const item of await list) {
- const text = await item.textContent();
- if (text?.includes(status)) {
- locator = item;
- }
- }
-
- return locator;
- }
+ async shippingStatusItem(status: string) {
+ const list = await this.page.locator('//ul[@class="dokan-settings-repeatable-list"]/li').all();
+ return list.find(async (item) => (await item.textContent())?.includes(status));
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async shippingStatusItem(status: string) { | |
const list = this.page.locator('//ul[@class="dokan-settings-repeatable-list"]/li').all(); | |
let locator; | |
for (const item of await list) { | |
const text = await item.textContent(); | |
if (text?.includes(status)) { | |
locator = item; | |
} | |
} | |
return locator; | |
} | |
async shippingStatusItem(status: string) { | |
const list = await this.page.locator('//ul[@class="dokan-settings-repeatable-list"]/li').all(); | |
return list.find(async (item) => (await item.textContent())?.includes(status)); | |
} |
constructor(page: Page) { | ||
super(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.
Remove unnecessary constructor.
The constructor is unnecessary as it only calls the parent constructor.
- constructor(page: Page) {
- super(page);
- }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
constructor(page: Page) { | |
super(page); | |
} |
Tools
Biome
[error] 5-7: This constructor is unnecessary.
Unsafe fix: Remove the unnecessary constructor.
(lint/complexity/noUselessConstructor)
import { ApiUtils } from '@utils/apiUtils'; | ||
import { payloads } from '@utils/payloads'; | ||
|
||
test.describe.only('Mark Order As Received - 02', () => { |
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.
Remove focus from the test.
The test.describe.only
method is used for debugging and should be removed to ensure all tests are executed.
- test.describe.only('Mark Order As Received - 02', () => {
+ test.describe('Mark Order As Received - 02', () => {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
test.describe.only('Mark Order As Received - 02', () => { | |
test.describe('Mark Order As Received - 02', () => { |
Tools
Biome
[error] 15-15: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
// temporary solution, will be replaced | ||
await page.waitForTimeout(3000); | ||
|
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.
Replace the temporary solution with a more robust approach.
The use of page.waitForTimeout
is a temporary solution and should be replaced with a more robust approach, such as waiting for a specific element or condition.
- // temporary solution, will be replaced
- await page.waitForTimeout(3000);
+ // wait for the tracking status to be updated
+ await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').waitFor({ state: 'visible' });
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// temporary solution, will be replaced | |
await page.waitForTimeout(3000); | |
// wait for the tracking status to be updated | |
await customerOrderDetailsPage.trackingStatusByShipmentNumber('#1').waitFor({ state: 'visible' }); |
All Submissions:
Changes proposed in this Pull Request:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
Title
Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit
New Features
Bug Fixes
Tests