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

Playwright test for ReefKnot #203

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Playwright test for ReefKnot #203

wants to merge 28 commits into from

Conversation

jake4take
Copy link

@jake4take jake4take commented Nov 27, 2024

Notes:

  • added tests to /playwright-tests folder
    • matomo events
    • connect/disconnect wallet
    • check stats with the connected wallet
    • stake transaction
  • supported wallets (select before run workflow):
    • Metamask
    • OKX
  • added workflow for the run tests on the deployed ReefKnot stand
  • added qase.reporter for save report
image

@jake4take jake4take requested a review from a team as a code owner November 27, 2024 09:59
Copy link

changeset-bot bot commented Nov 27, 2024

⚠️ No Changeset found

Latest commit: 3e8876d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@jake4take jake4take requested a review from a team November 27, 2024 10:16
DiRaiks
DiRaiks previously approved these changes Dec 2, 2024
@jake4take jake4take changed the title Playwright test for ReefKnot [DRAFT] Playwright test for ReefKnot Dec 4, 2024
Copy link
Contributor

@alx-khramov alx-khramov left a comment

Choose a reason for hiding this comment

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

Good work, but there are some issues with texts that make it difficult to read and understand the meaning. It is totally okay to use Google Translate or ChatGPT to translate and improve texts.

# <img src="logo.svg" alt='Reef Knot logo' height='45' align='top'/> Reef-Knot. Playwright test

## ❖ Installation
1. Install dependencies from `/plyawright-tests` folder
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. Install dependencies from `/plyawright-tests` folder
1. Install dependencies from the `/playwright-tests` directory:

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, fixed

```
yarn && yarn playwright install chromium
```
1. Fill the `.env` with `.env.example` in the `/playwright-tests` folder
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. Fill the `.env` with `.env.example` in the `/playwright-tests` folder
1. Fill the `.env` file in the `/playwright-tests` folder using the `.env.example` file as a template.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, fixed

Comment on lines 10 to 18
## ❖ How to run tests from deployed stand?
1. Set up the `.env` variable: `STAND_TYPE=stand`
2. Run command from `/plyawright-tests` folder: `yarn test:reef-knot`

## ❖ How to run tests from localhost?
1. Run `reef-knot` stand on the localhost
2. Check the localhost link in the `/playwright-tests/config/env.config.ts` => `STAND_LINK.localhost` (_default value is http://localhost:3000_)
3. Set up the `.env` variable: `STAND_TYPE=localhost`
4. Run command from `/plyawright-tests` folder: `yarn test:reef-knot`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## ❖ How to run tests from deployed stand?
1. Set up the `.env` variable: `STAND_TYPE=stand`
2. Run command from `/plyawright-tests` folder: `yarn test:reef-knot`
## ❖ How to run tests from localhost?
1. Run `reef-knot` stand on the localhost
2. Check the localhost link in the `/playwright-tests/config/env.config.ts` => `STAND_LINK.localhost` (_default value is http://localhost:3000_)
3. Set up the `.env` variable: `STAND_TYPE=localhost`
4. Run command from `/plyawright-tests` folder: `yarn test:reef-knot`
## ❖ How to run tests on a Deployed Stand
1. Set up the `.env` variable: `STAND_TYPE=stand`
2. Navigate to the `/playwright-tests` folder and run: `yarn test:reef-knot`
## ❖ How to run tests on Localhost
1. Start the `reef-knot` demo app on your local machine: `yarn run dev`
2. Verify the localhost link in `/playwright-tests/config/env.config.ts`, see the `STAND_LINK.localhost` property (_default value is http://localhost:3000_)
3. Set the `.env` variable: `STAND_TYPE=localhost`
4. Navigate to the `/playwright-tests` directory and run: `yarn test:reef-knot`

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, fixed

Comment on lines 9 to 10
// If contextDataDir is undefined - will be created temp dir for context data.
// Else contextDataDir is not undefined - will be created user dir for context data in current folder.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// If contextDataDir is undefined - will be created temp dir for context data.
// Else contextDataDir is not undefined - will be created user dir for context data in current folder.
// If contextDataDir is undefined, a temporary directory will be created for storing context data.
// If contextDataDir is defined, a user-specific directory will be created in the current folder for context data.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, fixed

Comment on lines 60 to 61
// If fork was started we send to browserContextService set up separately context
// but, if fork wasn't started we send custom directory for create share context.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, rewright the comment using some kind of translator or remove it. The comment is not really helpful in its current state.

Copy link
Author

Choose a reason for hiding this comment

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

removed 👌

async disconnectWalletForce() {
await test.step('Forcefully disconnect wallet', async () => {
await this.page.evaluate(() => {
// Get all localStorage keys
Copy link
Contributor

Choose a reason for hiding this comment

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

This is obvious.

Copy link
Author

Choose a reason for hiding this comment

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

removed

await test.step('Check the stand appearance before wallet connection', async () => {
await expect(
reefKnotPage.statsBlock.mainComponent,
'Expected the statistic block is not displayed before wallet connection',
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence is not grammatically correct and hard to understand. Please, fix it using Google translate, ChatGPT or something similar. This also applies to other sentences in this file.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you. I fixed all assert descriptions in all test files

forbidOnly: !!process.env.CI,
retries: 1,
workers: 1,
reporter: REPORT_CONFIG(),

Choose a reason for hiding this comment

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

REPORT_CONFIG function must be a lowercase

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Vorobeyko
Vorobeyko previously approved these changes Dec 26, 2024
@jake4take jake4take changed the title [DRAFT] Playwright test for ReefKnot Playwright test for ReefKnot Dec 28, 2024
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.

5 participants