Skip to content
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

[TEST] [E2E] Delete shipping rate from its details page #4625

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

yellowee
Copy link
Contributor

@yellowee yellowee commented Jan 12, 2024

It covers TC SALEOR_35

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

@yellowee yellowee self-assigned this Jan 12, 2024
Copy link

changeset-bot bot commented Jan 12, 2024

🦋 Changeset detected

Latest commit: 3f2bca7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yellowee yellowee force-pushed the test_delete_shipping_method branch 2 times, most recently from d9e3db9 to e2ff683 Compare January 12, 2024 11:27
@github-actions github-actions bot temporarily deployed to storybook pr-4625 January 12, 2024 11:29 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4625 January 12, 2024 11:29 Destroyed
@yellowee yellowee force-pushed the test_delete_shipping_method branch from e2ff683 to 7a2a545 Compare January 12, 2024 11:32
@github-actions github-actions bot temporarily deployed to storybook pr-4625 January 12, 2024 11:34 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4625 January 12, 2024 11:34 Destroyed
@yellowee yellowee force-pushed the test_delete_shipping_method branch from 7a2a545 to 2e6e33c Compare January 12, 2024 12:39
@github-actions github-actions bot temporarily deployed to pr-4625 January 12, 2024 12:42 Destroyed
@github-actions github-actions bot temporarily deployed to storybook pr-4625 January 12, 2024 12:42 Destroyed
@yellowee yellowee marked this pull request as ready for review January 16, 2024 07:31
@yellowee yellowee requested review from a team, andrzejewsky and poulch and removed request for andrzejewsky and poulch January 16, 2024 07:31
@yellowee yellowee force-pushed the test_delete_shipping_method branch from 2e6e33c to 5aa0cb7 Compare January 16, 2024 09:00
@github-actions github-actions bot temporarily deployed to pr-4625 January 16, 2024 09:03 Destroyed
@github-actions github-actions bot temporarily deployed to storybook pr-4625 January 16, 2024 09:03 Destroyed
async clickDeleteShippingMethod() {
await this.priceBasedRatesSection.locator(this.deleteShippingMethodButton).click();
async clickDeleteShippingRateFromTheList() {
await this.priceBasedRatesSection.locator(this.deleteShippingRateButtonOnList).click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not gonna be confusing when deleting weight base shipping?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would clickDeletePriceBasedShippingMethod be more obvious and descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const weightBasedRate = SHIPPING_METHODS.shippingMethodWithRatesToBeDeleted.rates.weightBasedRateToBeDeleted.name;

await shippingMethodsPage.gotoExistingShippingRate(shippingMethodId, shippingRateId);
await expect(shippingMethodsPage.basePage.pageHeader).toBeVisible();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you await input to be visible inside gotoExistingShippingRate then this expect has no use, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 119 to 123
await shippingMethodsPage.gotoExistingShippingMethod(
SHIPPING_METHODS.shippingMethodWithRatesToBeDeleted.id,
);
await expect(shippingMethodsPage.weightBasedRatesSection).toContainText("No shipping rates found");
await expect(shippingMethodsPage.weightBasedRatesSection).not.toContainText(weightBasedRate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not check integration between views so I would skip navigating to other views to confirm the action result. Check all you need on the screen that was loaded after deletion, do not go to other views to double-check results. Otherwise, this test would not have an end, there are so many views to be checked

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

page,
}) => {
const shippingMethodsPage = new ShippingMethodsPage(page);
const shippingMethodId = SHIPPING_METHODS.shippingMethodWithRatesToBeDeleted.id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, this ID is actually the Shipping Zone ID and not the Shipping Method ID.

@yellowee yellowee merged commit 7c7c73c into main Jan 17, 2024
24 checks passed
@yellowee yellowee deleted the test_delete_shipping_method branch January 17, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

4 participants