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

Attempts in the name of the screenshot on Cypress SDK #111

Closed
gregberge opened this issue Jan 31, 2024 · 2 comments
Closed

Attempts in the name of the screenshot on Cypress SDK #111

gregberge opened this issue Jan 31, 2024 · 2 comments

Comments

@gregberge
Copy link
Member

gregberge commented Jan 31, 2024

A client have screenshots with "(attempt n)" in their name, so it creates flakiness (remove / added) and does not compare screenshot. We have to:

  • Investigate when does Cypress do that
  • Be sure that the screenshot name is consistent if taken with argosScreenshot method
      on('after:screenshot', (details) => {
        // Get the base filename without extension
        const baseName = path.basename(
          details.path,
          path.extname(details.path),
        );

        // Remove attempt from the filename
        const newBaseName = baseName.replace(/ \(attempt \d+\)/, '');

        // Construct a new path with the original file extension
        const newPath = path.join(
          path.dirname(details.path),
          newBaseName + path.extname(details.path),
        );

        return new Promise((resolve, reject) => {
          fs.rename(details.path, newPath, (err) => {
            if (err) {
              return reject(err);
            }

            resolve({ path: newPath });
          });
        });
      });
@gregberge gregberge converted this from a draft issue Jan 31, 2024
@jsfez
Copy link
Contributor

jsfez commented Jan 31, 2024

For you information, the issue exist with Playwright too. But the wording is not "attempt" but "retry"

@gregberge gregberge moved this from 🔖 Ready to 🏗 In progress in Argos Roadmap Feb 2, 2024
@gregberge
Copy link
Member Author

Done in #115

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Argos Roadmap Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants