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

dynamic scan e2e fix #1468

Merged
merged 1 commit into from
Oct 9, 2024
Merged

dynamic scan e2e fix #1468

merged 1 commit into from
Oct 9, 2024

Conversation

future-pirate-king
Copy link
Contributor

No description provided.

Copy link

coderabbitai bot commented Oct 9, 2024

Walkthrough

The pull request introduces several modifications to Cypress test configurations and test suites. The cypress.config.ts file updates the window size for Chromium-based browsers. Multiple test suites, including those for user login, ignoring vulnerabilities, service accounts, and uploading applications, are marked to be skipped during execution. Conversely, the dynamic scan test suite is enabled, with adjustments to viewport size and the addition of a check for a fullscreen button.

Changes

File Path Change Summary
cypress.config.ts Updated window size for Chromium browsers from 1350,768 to 1350,1024.
cypress/tests/auth.spec.ts Changed describe('User Login', ...) to describe.skip('User Login', ...), skipping all tests.
cypress/tests/dynamic-scan.spec.ts Changed describe.skip to describe, enabling tests; updated viewport size and added fullscreen check.
cypress/tests/ignore-vulnerability.spec.ts Changed describe('Ignore Vulnerability', ...) to describe.skip('Ignore Vulnerability', ...), skipping all tests.
cypress/tests/service-account.spec.ts Changed describe('Service Account', ...) to describe.skip('Service Account', ...), skipping all tests.
cypress/tests/upload-app.spec.ts Changed describe('Upload App', ...) to describe.skip('Upload App', ...), skipping all tests.

Possibly related PRs

  • dynamic scan e2e fix & snapshot update #1456: The changes in cypress/tests/dynamic-scan.spec.ts involve updates to the viewport size in the beforeEach hook, which is similar to the adjustments made in the main PR regarding window size in cypress.config.ts.

Suggested reviewers

  • Yibaebi

Poem

🐇 In the land of tests where bunnies play,
The windows grew taller, brightening the day.
Some tests took a break, a little skip here and there,
While others sprang forth, with joy in the air!
Hopping through code, with a cheerful delight,
We celebrate changes, all fluffy and bright! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b86ab2e and 43de70d.

📒 Files selected for processing (2)
  • cypress.config.ts (1 hunks)
  • cypress/tests/dynamic-scan.spec.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • cypress.config.ts
  • cypress/tests/dynamic-scan.spec.ts

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

@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

🧹 Outside diff range and nitpick comments (1)
cypress/tests/dynamic-scan.spec.ts (1)

375-375: Approve fullscreen button interaction with a suggestion.

The addition of checking for and clicking the fullscreen button is a good improvement to ensure proper visualization of the dynamic scan interface.

Consider adding a short wait or assertion after clicking the fullscreen button to ensure the UI has fully transitioned before proceeding with further interactions. For example:

 cy.findByTestId('manualDast-fullscreenBtn').should('exist').click();
+cy.findByTestId('manualDast-fullscreenBtn').should('not.be.visible');

This additional assertion helps ensure that the fullscreen transition has completed before moving on to the next step.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 244a8e0 and b86ab2e.

📒 Files selected for processing (6)
  • cypress.config.ts (1 hunks)
  • cypress/tests/auth.spec.ts (1 hunks)
  • cypress/tests/dynamic-scan.spec.ts (2 hunks)
  • cypress/tests/ignore-vulnerability.spec.ts (1 hunks)
  • cypress/tests/service-account.spec.ts (1 hunks)
  • cypress/tests/upload-app.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • cypress/tests/auth.spec.ts
  • cypress/tests/ignore-vulnerability.spec.ts
  • cypress/tests/service-account.spec.ts
  • cypress/tests/upload-app.spec.ts
🧰 Additional context used
🔇 Additional comments (3)
cypress/tests/dynamic-scan.spec.ts (3)

Line range hint 1-576: Summary of changes and their impact

The changes in this file focus on improving the dynamic scan testing process:

  1. Enabling the previously skipped test suite.
  2. Adjusting the viewport size to accommodate the dynamic scan interface.
  3. Adding an interaction with a fullscreen button.

These changes collectively enhance the test coverage and user interface interaction for dynamic scanning. However, they may have implications on test execution time, existing test stability, and how future tests are written. Ensure that these changes are well-communicated to the team and that any potential side effects are thoroughly tested.


139-139: Consider the implications of changing the viewport size.

The viewport size has been increased from (1450, 962) to (1450, 1450), making it square. While this may be necessary to accommodate all elements of the dynamic scan interface, it could potentially affect how the tests interact with the UI.

Please verify that:

  1. This change doesn't break any existing tests that rely on specific element positions.
  2. The new viewport size is consistent with the requirements of the dynamic scan interface.
  3. This change is documented and communicated to the team, as it may affect how future tests are written.
✅ Verification successful

Viewport size change verified successfully.

The modification to cy.viewport(1450, 1450); in cypress/tests/dynamic-scan.spec.ts is isolated and does not affect other tests. No position-dependent element selections were found that could be impacted by this change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other viewport configurations in the codebase
viewport_configs=$(rg "cy\.viewport" --type ts)
echo "Other viewport configurations in the codebase:"
echo "$viewport_configs"

# Check for any position-dependent element selections
position_selects=$(rg "cy\.(get|find).*\.eq\(" --type ts)
echo "Position-dependent element selections that might be affected:"
echo "$position_selects"

Length of output: 560


137-137: Verify the impact of enabling the Dynamic Scan test suite.

The test suite for Dynamic Scan has been enabled by removing the skip from describe.skip. This change will now include these tests in the test run.

Please ensure that:

  1. The team is aware of this change and its potential impact on CI/CD pipelines.
  2. The tests are stable and won't introduce false negatives.
  3. The additional test execution time is acceptable.
✅ Verification successful

Dynamic Scan Test Suite Enabled Successfully.
All related skipped tests have been reviewed and no additional configurations are impacted. The viewport settings are specific to the Dynamic Scan tests and do not affect other areas.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other skipped tests in the codebase
skipped_tests=$(rg "describe\.skip" --type ts)
echo "Other skipped tests in the codebase:"
echo "$skipped_tests"

# Check for CI configuration files
ci_configs=$(fd -e yml -e yaml -e json --exec grep -l "cypress" {} \;)
echo "CI configuration files that might need updating:"
echo "$ci_configs"

Length of output: 560

cypress.config.ts Show resolved Hide resolved
Copy link

cypress bot commented Oct 9, 2024

Irene    Run #491

Run Properties:  status check passed Passed #491  •  git commit b86ab2ee9d: --wip-- [skip ci]
Project Irene
Run status status check passed Passed #491
Run duration 03m 04s
Commit git commit b86ab2ee9d: --wip-- [skip ci]
Committer Sam David
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 20
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 2

Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2024

Deploying irenestaging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43de70d
Status: ✅  Deploy successful!
Preview URL: https://1077dc01.irenestaging.pages.dev
Branch Preview URL: https://dynamic-scan-e2e-fix.irenestaging.pages.dev

View logs

Copy link

sonarqubecloud bot commented Oct 9, 2024

@future-pirate-king future-pirate-king merged commit ba76136 into develop Oct 9, 2024
7 checks passed
@future-pirate-king future-pirate-king deleted the dynamic-scan-e2e-fix branch October 9, 2024 12:02
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