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

Migrate navigation tests to playwright #4294

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

wojteknowacki
Copy link
Member

@wojteknowacki wojteknowacki commented Oct 5, 2023

closes #4274

Screenshots

Pull Request Checklist

  1. This code contains UI changes
  2. All visible strings are translated with proper context including data-formatting
  3. Attributes data-test-id are added for new elements
  4. The changes are tested in Chrome/Firefox/Safari browsers and in light/dark mode
  5. Your code works with the latest stable version of the core
  6. I added changesets file (instructions in contribution guide

Test environment config

API_URI=https://master.staging.saleor.cloud/graphql/
APPS_MARKETPLACE_API_URI=https://apps.staging.saleor.io/api/v2/saleor-apps

Do you want to run more stable tests?

To run all tests, just select the stable checkbox. To speed up tests, increase the number of containers. Tests will be re-run only when the "run e2e" label is added.

  1. stable
  2. app
  3. attribute
  4. category
  5. collection
  6. customer
  7. giftCard
  8. homePage
  9. login
  10. menuNavigation
  11. navigation
  12. orders
  13. pages
  14. payments
  15. permissions
  16. plugins
  17. productType
  18. products
  19. sales
  20. shipping
  21. translations
  22. variants
  23. vouchers

CONTAINERS=6

@wojteknowacki wojteknowacki requested review from a team, andrzejewsky and Droniu October 5, 2023 07:25
@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2023

🦋 Changeset detected

Latest commit: ae97dab

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

@github-actions github-actions bot temporarily deployed to migrate-navigation-test-to-playwright October 5, 2023 07:25 Destroyed
@github-actions github-actions bot temporarily deployed to storybook migrate-navigation-test-to-playwright October 5, 2023 07:25 Destroyed
@wojteknowacki wojteknowacki marked this pull request as draft October 6, 2023 06:57
@github-actions github-actions bot temporarily deployed to migrate-navigation-test-to-playwright October 6, 2023 13:36 Destroyed
@github-actions github-actions bot temporarily deployed to storybook migrate-navigation-test-to-playwright October 6, 2023 13:36 Destroyed
@wojteknowacki wojteknowacki marked this pull request as ready for review October 6, 2023 13:36
poulch
poulch previously approved these changes Oct 6, 2023
Droniu
Droniu previously approved these changes Oct 9, 2023
this.permissionGroupsButton = page.locator(
"[data-test-id*='permission-groups']",
);
this.staffMembersButton = page.locator("[data-test-id*='staff members']");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.staffMembersButton = page.locator("[data-test-id*='staff members']");
this.staffMembersButton = page.locator("[data-test-id*='staff-members']");

szczecha
szczecha previously approved these changes Oct 9, 2023
@wojteknowacki wojteknowacki dismissed stale reviews from szczecha, Droniu, and poulch via ddeb5c9 October 11, 2023 08:40
@github-actions github-actions bot temporarily deployed to migrate-navigation-test-to-playwright October 11, 2023 08:40 Destroyed
@github-actions github-actions bot temporarily deployed to storybook migrate-navigation-test-to-playwright October 11, 2023 08:40 Destroyed
Comment on lines 34 to 56
setup("authenticate as user with discount permissions", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.setupLogin(
USER_PERMISSION.discount,
process.env.CYPRESS_PERMISSIONS_USERS_PASSWORD!,
);
const homePage = new HomePage(page);
await expect(homePage.welcomeMessage).toContainText("Hello there,");
// End of authentication steps.
await page.context().storageState({ path: discountPermissionsFile });
});

setup("authenticate as user with orders permissions", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.setupLogin(
USER_PERMISSION.order,
process.env.CYPRESS_PERMISSIONS_USERS_PASSWORD!,
);
const homePage = new HomePage(page);
await expect(homePage.welcomeMessage).toContainText("Hello there,");
// End of authentication steps.
await page.context().storageState({ path: ordersPermissionsFile });
});
Copy link
Member

Choose a reason for hiding this comment

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

This code is almost same for all setups, cant we create the function loginAndSetStorageState(esername, pastowrd, pathtostorageStateFile)

@wojteknowacki wojteknowacki marked this pull request as draft October 11, 2023 09:20
@github-actions github-actions bot temporarily deployed to migrate-navigation-test-to-playwright October 11, 2023 11:18 Destroyed
@wojteknowacki wojteknowacki marked this pull request as ready for review October 11, 2023 11:49
@wojteknowacki wojteknowacki merged commit 7329f2c into main Oct 12, 2023
18 of 19 checks passed
@wojteknowacki wojteknowacki deleted the migrate-navigation-test-to-playwright branch October 12, 2023 11:47
@andrzejewsky andrzejewsky modified the milestone: Saleor 3.18 Oct 30, 2023
@wojteknowacki wojteknowacki added this to the Saleor 3.18 milestone Oct 31, 2023
@andrzejewsky andrzejewsky removed this from the Saleor 3.18 milestone Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

Migrate navigation ( permissions ) tests to playwright
6 participants