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(playwright): Convert Cypress tests to Playwright - 2 #1246

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

xrutayisire
Copy link
Collaborator

@xrutayisire xrutayisire commented Dec 15, 2023

Context

The Solution

Sorry for the big PR 😬

This PR include:

  • Allow parallel tests
  • Remove any reference to login since we don't need it anymore (yet)
  • Run tests on prod version not dev to speed up execution
  • Improve mock procedures function to allow mocking multiple times the same procedure
  • Comment Cypress CI since it's crashing without alpha now
  • Remove converted Cypress tests
  • Rename "Got It" to "Got it" where it's not done
  • Improve README best practices
  • Handle mock with functions to generate more than one
  • Create tests for Review dialog
  • Creates tests for more push use cases
  • Creates tests for update available in side menu bar
  • Create tests for tutorial video tooltip

Impact / Dependencies

  • None

Checklist before requesting a review

  • I hereby declare my code ready for review.
  • If it is a critical feature, I have added tests.
  • The CI is successful.
  • If there could backward compatibility issues, it has been discussed and planned.

Copy link

linear bot commented Dec 15, 2023

Copy link

vercel bot commented Dec 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Dec 27, 2023 11:45am

@xrutayisire xrutayisire changed the base branch from master to dev-next-release December 15, 2023 12:19
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from c17848d to a98fb39 Compare December 15, 2023 14:40
@xrutayisire xrutayisire changed the title test(playwright): Convert Cypress tests to Playwright 2 test(playwright): Convert Cypress tests to Playwright - 2 Dec 15, 2023
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from a98fb39 to 7b913de Compare December 15, 2023 15:00
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 7b913de to 1d4b620 Compare December 15, 2023 15:28
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 1d4b620 to a2a4a6c Compare December 15, 2023 16:01
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from a2a4a6c to e852adf Compare December 15, 2023 17:39
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from e852adf to 099feb3 Compare December 15, 2023 18:05
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 099feb3 to dc9a343 Compare December 16, 2023 16:43
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from dc9a343 to 10ca9af Compare December 17, 2023 00:20
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 10ca9af to 20bfcfd Compare December 17, 2023 00:43
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 20bfcfd to c0e623c Compare December 17, 2023 05:05
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from c0e623c to dfced22 Compare December 17, 2023 05:32
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from dfced22 to 8e69332 Compare December 17, 2023 13:34
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 8e69332 to 1daa3bd Compare December 17, 2023 13:53
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 65dd763 to 9db8cb4 Compare December 23, 2023 00:01
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 9db8cb4 to c19c699 Compare December 23, 2023 00:18
@xrutayisire xrutayisire marked this pull request as draft December 23, 2023 00:18
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from c19c699 to 0ecd40d Compare December 23, 2023 00:28
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 0ecd40d to f2cc98b Compare December 23, 2023 00:39
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from f2cc98b to 1d2f9f5 Compare December 23, 2023 00:49
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 1d2f9f5 to 0eb97bd Compare December 23, 2023 00:58
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 0eb97bd to 6397b02 Compare December 26, 2023 22:12
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 6397b02 to 94e6306 Compare December 26, 2023 22:24
@xrutayisire xrutayisire marked this pull request as ready for review December 26, 2023 22:55
Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

Looks good to me! I just had a few questions I left as comments throughout the code.

Could you explain how we are able to remove the loggedIn test config? Should we be mocking manager responses for anything that requires authentication?

/**
* Static locators
*/
this.messageTextarea = this.dialog.getByPlaceholder("Tell us more...", {
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a label to use instead of placeholder? If we do, could we use getByLabel() instead of getByPlaceholder()?

If not, it's something we may want to raise as an accessibility issue.

Copy link
Collaborator Author

@xrutayisire xrutayisire Dec 27, 2023

Choose a reason for hiding this comment

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

Sadly there is no label and that's not great. It's an old component and when we will redo it we need to change it.


import { generateRandomId } from "../utils";

type GenerateTypesArgs = { nbSlices: number };
Copy link
Member

Choose a reason for hiding this comment

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

What does nbSlices mean? "nb" is unclear - is there a clearer name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes sorry my bad here, slicesCount is better!

import { generateRandomId } from "../utils";

type GenerateTypesArgs = {
nbTypes: number;
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above: is there a clearer name than "nb"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typesCount, thanks, you're right

import { test } from "../../fixtures";
import { generateLibraries, generateTypes } from "../../mocks";

test.describe("Side nav", () => {
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a comment specific to this PR: Do you think the describe groups are necessary?

We seem to have one describe per .spec.ts file. The Playwright UI list could be shallower if we removed the describe groups.

Copy link
Collaborator Author

@xrutayisire xrutayisire Dec 27, 2023

Choose a reason for hiding this comment

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

YESSSS! I had the same thought and I want to remove them ALL!

Because we prefer to have a small file, and so create another file instead of another describe, we can and should remove them.
I will do it right after the two PRs, or just before merging the second one so I don't have conflict with myself 😅

@xrutayisire
Copy link
Collaborator Author

@angeloashmore

Could you explain how we are able to remove the loggedIn test config? Should we be mocking manager responses for anything that requires authentication?

Yes, for standalone test at the moment. It finally set a common ground for all standalone tests that we are writing now.

We mock everything that query the outside world that we want to test for a specific test. So if you test something related to an authentication in wroom, yes mock.

DX is much nicer like that since you don't care about anything external, email, password, etc... Let me know what you think and we could come back to something different.

@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch 2 times, most recently from 198cf40 to dabecf2 Compare December 27, 2023 11:18
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from dabecf2 to 3126c5d Compare December 27, 2023 11:33
@xrutayisire xrutayisire force-pushed the xru/convert-cypress-tests-2 branch from 3126c5d to 56cf806 Compare December 27, 2023 11:39
@xrutayisire xrutayisire merged commit 53fe5b3 into main Dec 27, 2023
33 checks passed
@xrutayisire xrutayisire deleted the xru/convert-cypress-tests-2 branch December 27, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants