Skip to content

locally created screenshots and videos in examples are queued for commit #676

@MikeMcC399

Description

@MikeMcC399

Problem description

  1. If screenshots or videos are created locally in the examples directories then they are added to git differences for a potential commit

  2. Due to the above issue, screenshots have been committed to examples/v10/chrome/cypress/screenshots

Steps to reproduce the issue

In a local clone of the repository, execute:

cd examples/v10/quiet
npm ci
npx cypress run --browser chrome
git status

Note the output

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        cypress/screenshots/
        cypress/videos/

nothing added to commit but untracked files present (use "git add" to track)

Expected behavior

Screenshots and videos resulting from Cypress test runs locally should not be committed to the repository.

Analysis

The entries for videos and screenshots do not match the actual locations where videos and screenshots are stored

examples/*/cypress/videos
examples/*/cypress/screenshots

compare to the actual locations from the steps to reproduce:

examples/v10/quiet/cypress/screenshots
examples/v10/quiet/cypress/videos

* matches anything except a slash, so there is no match. (See reference documentation https://git-scm.com/docs/gitignore.)

The problem would have started to happen as the existing v9 tests were moved and an extra level of directories was introduced in 5d0fb97.

Suggested Fix


For .gitignore ...

  1. Change
examples/*/cypress/videos
examples/*/cypress/screenshots

to

examples/**/cypress/videos
examples/**/cypress/screenshots

in order to match /v10/quiet/ for example.

  1. Add
examples/**/cypress/downloads

in case any future examples cause this temporary directory to be created.

(See Cypress documentation: Folders / Files) for list of temporary file locations.


Remove the incorrectly committed screenshots from the repository:

examples/v10/chrome/cypress/screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions