Skip to content

Conversation

@mglaman
Copy link
Collaborator

@mglaman mglaman commented Dec 23, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses test flakiness in the launch form tests by implementing a fixture-based mocking system and adding a script to regenerate these fixtures. The changes replace dynamic API calls with static fixtures to ensure consistent test behavior while maintaining the ability to update fixture data when needed.

Key changes:

  • Added fixture generation script for automated updates from live API
  • Implemented comprehensive API mocking in Cypress tests using fixtures
  • Modified test assertions to use fixture data for consistency

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

File Description
scripts/update-cypress-fixtures.js Script to fetch and save API response fixtures with test-specific data injection
cypress/fixtures/launch_form/*.json JSON fixtures containing mock API responses for various endpoints
cypress/e2e/launch_form.cy.js Updated test to use intercepts with fixtures and fixture-based assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cy.getByLabel('Drupal Core')
.should('have.value', '11.2.4')
cy.fixture('launch_form/core_compat_pathauto_8.x-1.14.json').then((data) => {
cy.getByLabel('Drupal Core')
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The test references data.list[1] with a magic index. Consider adding a comment explaining why index 1 is selected, or use a more descriptive approach like finding the first non-dev version to make the test intent clearer.

Suggested change
cy.getByLabel('Drupal Core')
cy.getByLabel('Drupal Core')
// The first entry (index 0) in this fixture is a dev/core-incompatible version;
// index 1 is the first stable, core-compatible version we expect to be selected.

Copilot uses AI. Check for mistakes.
@mglaman mglaman merged commit 8be7448 into main Dec 23, 2025
18 of 21 checks passed
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