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 suite initialization #41

Merged
merged 11 commits into from
May 20, 2024
Merged

Test suite initialization #41

merged 11 commits into from
May 20, 2024

Conversation

Eren-Yeaager
Copy link
Collaborator

Resolves #40

Copy link

vercel bot commented May 17, 2024

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

Name Status Preview Comments Updated (UTC)
canvas ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 5:41pm

@Eren-Yeaager Eren-Yeaager requested a review from elliotBraem May 17, 2024 21:04
Copy link
Member

@elliotBraem elliotBraem left a comment

Choose a reason for hiding this comment

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

See that the github workflow is failing for tests and prettier (I'm not sure if you installed prettier in this repo, if you haven't grab it from devs.near too, remember to get the fmt commands)

Then run fmt and push the result with this

@@ -54,6 +54,7 @@
"prod:analyze": "npm run prod -- --env presets=analyze",
"build": "npm run prod",
"start": "npm run dev",
"test": "npx playwright test",
Copy link
Member

Choose a reason for hiding this comment

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

Can you add these scripts too please

    "test": "npx playwright test",
    "test:ui": "npx playwright test --ui",
    "test:ui:codespaces": "npx playwright test --ui-host=0.0.0.0",

Copy link
Member

Choose a reason for hiding this comment

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

Add add the following to the README:

Running Playwright tests

To be able to run the playwright tests, you first need to install the dependencies. You can see how this is done in .devcontainer/post-create.sh which is automatically executed when opening this repository in a github codespace.

When the dependencies are set up, you can run the test suite in your terminal:

yarn test

To run tests visually in the playwright UI, you can use the following command:

yarn test:ui

This will open the playwright UI in a browser, where you can run single tests, and also inspect visually.

If you want to use the playwright UI from a github codespace, you can use this command:

yarn test:ui:codespaces

In general it is a good practice, and very helpful for reviewers and users of this project, that all use cases are covered in Playwright tests. Also, when contributing, try to make your tests as simple and clear as possible, so that they serve as examples on how to use the functionality.

Copy link
Member

Choose a reason for hiding this comment

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

/* Run your local dev server before starting the tests */
webServer: {
command: "npm run dev",
port: 4040,
Copy link
Member

Choose a reason for hiding this comment

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

I think this port needs to match the dev server, which is 8000. Change all 4040 to 8000

Copy link
Collaborator Author

@Eren-Yeaager Eren-Yeaager May 18, 2024

Choose a reason for hiding this comment

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

Hey! when i changed the server to 3000 it worked . Is it correct ?
I went through the documentation of canvas and found this

image

@elliotBraem elliotBraem merged commit f7982b4 into main May 20, 2024
1 of 4 checks passed
@elliotBraem elliotBraem deleted the Test-suite branch May 20, 2024 17:41
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.

Initialize Test Suite
2 participants