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: updated limited run file for Tab spec #38426

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To run only limited tests - give the spec names in below format:
cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Test file needs the following improvements

  • Replace cy.wait(3000) with proper assertions or intercepts for tab content loading
  • Remove empty afterEach block if no cleanup is needed
  • Avoid using force: true in click events - fix element visibility instead
  • Consider adding error handling for modal interactions

The test follows most Cypress practices with proper visibility assertions, but these changes will make it more robust and maintainable.

🔗 Analysis chain

Verify the new test specification exists and follows guidelines.

Let's verify the existence and content of the new test file:


Test file needs improvements to follow Cypress best practices

The test file contains practices that should be avoided:

  • Usage of cy.wait(3000) which introduces flaky tests. Replace with cy.intercept() or appropriate assertions
  • Contains afterEach block which may need review for cleanup approach
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new test file exists and analyze its content
if [ -f "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js" ]; then
    echo "File exists. Analyzing content..."
    
    # Check for prohibited practices
    echo "Checking for prohibited practices..."
    rg -i "cy\.wait|cy\.pause|agHelper\.sleep|it\.only|after\(|afterEach\(" "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js"
    
    # Check for selector patterns
    echo "Checking selector patterns..."
    rg -i "\.btn\.submit|button\[type=submit\]|\$\('" "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js"
    
    # Check for xpath usage
    echo "Checking for XPath usage..."
    rg -i "xpath|cy\.xpath" "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js"
else
    echo "ERROR: Test file not found!"
fi

Length of output: 827


Script:

#!/bin/bash
# Let's check the full content of the test file to provide specific guidance
echo "Test file content:"
cat "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js"

# Check for better practices like intercept usage
echo -e "\nChecking for recommended practices:"
rg -i "cy\.intercept|\.should\(|\.contains\(" "app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js"

Length of output: 2236

# For running all specs - uncomment below:
#cypress/e2e/**/**/*

Expand Down
Loading