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

Move E2E tests to a new Trade page #3706

Merged
merged 5 commits into from
Aug 8, 2024
Merged

Move E2E tests to a new Trade page #3706

merged 5 commits into from
Aug 8, 2024

Conversation

yury-dubinin
Copy link
Contributor

@yury-dubinin yury-dubinin commented Aug 8, 2024

What is the purpose of the change:

Swap tool is now part of a Trade tool and tests must be moved to new implementation.

@yury-dubinin yury-dubinin self-assigned this Aug 8, 2024
Copy link

vercel bot commented Aug 8, 2024

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

Name Status Preview Comments Updated (UTC)
osmosis-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 0:29am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
osmosis-frontend-datadog ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 0:29am
osmosis-frontend-dev ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 0:29am
osmosis-frontend-edgenet ⬜️ Ignored (Inspect) Aug 8, 2024 0:29am
osmosis-testnet ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 0:29am

Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Walkthrough

The recent changes enhance the TradePage class by refining element selectors for improved reliability in automated testing. The transition from SwapPage to TradePage in the test suite indicates a significant refactor of the "Select Swap Pair" functionality. This includes updates to test configurations and execution contexts, aimed at strengthening test coverage and accuracy during automated interactions.

Changes

Files Change Summary
packages/web/e2e/pages/trade-page.ts, packages/web/e2e/tests/select.spec.ts, packages/web/e2e/tests/swap.wallet.spec.ts Updated element selectors in TradePage for improved accuracy. Refactored tests to utilize TradePage and adjusted execution flow.
.github/workflows/frontend-e2e-tests.yml, .github/workflows/prod-frontend-e2e-tests.yml Changed the job environment for tests from Ubuntu to macOS and specified checking out the master branch.
.github/workflows/monitoring-e2e-tests.yml, .github/workflows/monitoring-geo-e2e-tests.yml Modified commands to run different sets of tests, ensuring focus on broader functionality across tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant TradePage
    participant TestSuite

    User->>UI: Interacts with trade interface
    UI->>TradePage: Calls showSwapInfo()
    TradePage->>UI: Displays swap info
    User->>UI: Selects swap pair
    UI->>TestSuite: Runs select tests
    TestSuite->>TradePage: Executes tests using updated selectors
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2b137af and 3799767.

Files selected for processing (4)
  • .github/workflows/monitoring-e2e-tests.yml (1 hunks)
  • .github/workflows/monitoring-geo-e2e-tests.yml (4 hunks)
  • .github/workflows/prod-frontend-e2e-tests.yml (1 hunks)
  • packages/web/e2e/tests/swap.wallet.spec.ts (3 hunks)
Additional comments not posted (6)
.github/workflows/prod-frontend-e2e-tests.yml (1)

40-41: Verify the impact of checking out the master branch.

The change to explicitly check out the master branch may improve consistency but could limit testing flexibility for other branches. Ensure this aligns with the intended workflow strategy.

Verification successful

Multiple Workflows Reference the master Branch

The checkout of the master branch is used in multiple workflows, specifically in the prod-frontend-e2e-tests.yml and monitoring-geo-e2e-tests.yml. This indicates a consistent strategy across these workflows to use the master branch for testing. Ensure this aligns with the overall workflow strategy and does not limit testing flexibility for other branches if needed.

  • .github/workflows/prod-frontend-e2e-tests.yml: ref: master
  • .github/workflows/monitoring-geo-e2e-tests.yml: Multiple occurrences of ref: master
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the `master` branch checkout on the workflow.

# Test: Check for other workflows that might be affected by this change.
rg --type yaml 'ref: master'

Length of output: 30


Script:

#!/bin/bash
# Description: Search for all branch references in the `.github/workflows` directory to understand the branching strategy.

# Test: Check for all branch references in YAML workflow files.
rg --type yaml 'ref:' .github/workflows/

Length of output: 384

.github/workflows/monitoring-e2e-tests.yml (1)

123-123: Verify alignment of the new testing focus on "pools."

The shift in testing focus to "pools" may affect test coverage. Ensure this change aligns with the overall testing strategy and objectives.

.github/workflows/monitoring-geo-e2e-tests.yml (1)

31-32: Verify the impact of checking out the master branch in multiple jobs.

The explicit checkout of the master branch in multiple jobs may improve consistency but could limit testing flexibility for other branches. Ensure this aligns with the intended workflow strategy.

Also applies to: 74-75, 150-151, 195-196

Verification successful

Multiple Jobs Checkout master Branch

The .github/workflows/monitoring-geo-e2e-tests.yml file checks out the master branch in multiple jobs. This approach ensures consistency but may limit the ability to test other branches. Please verify if this aligns with your intended workflow strategy.

  • Instances of ref: master found in the workflow file, each followed by a Setup Node.js step.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the `master` branch checkout on the workflow for multiple jobs.

# Test: Check for other workflows that might be affected by this change.
rg --type yaml 'ref: master'

Length of output: 30


Script:

#!/bin/bash
# Description: Check for the usage of the checkout action with ref: master in the specified workflow file.

# Test: Search for all instances of 'ref: master' in the .github/workflows/monitoring-geo-e2e-tests.yml file.
rg 'ref: master' .github/workflows/monitoring-geo-e2e-tests.yml -A 3

Length of output: 479

packages/web/e2e/tests/swap.wallet.spec.ts (3)

5-5: Import TradePage looks good.

The import path for TradePage appears to be correct and consistent with the project's structure.


17-17: Variable type change to TradePage looks good.

The change from SwapPage to TradePage is consistent with the refactor. Ensure TradePage provides the necessary functionality.


48-48: Instantiation of TradePage looks good.

The instantiation of swapPage as TradePage is consistent with the refactor. Ensure TradePage supports all required methods used in the tests.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

packages/web/e2e/tests/select.spec.ts Outdated Show resolved Hide resolved
@yury-dubinin yury-dubinin changed the title Move select tests to Trade page Move E2E tests to a new Trade page Aug 8, 2024
@yury-dubinin yury-dubinin requested review from DavideSegullo and a team August 8, 2024 12:47
@yury-dubinin yury-dubinin merged commit f87b321 into stage Aug 8, 2024
45 checks passed
@yury-dubinin yury-dubinin deleted the FE-962 branch August 8, 2024 13:32
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