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

fix: make sure privileged commands can run when there is a space in the spec or support file name #31001

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _Released 2/11/2025 (PENDING)_
**Bugfixes:**

- All commands performed in `after` and `afterEach` hooks will now correctly retry when a test fails. Commands that are actions like `.click()` and `.type()` will now perform the action in this situation also. Fixes [#2831](https://github.com/cypress-io/cypress/issues/2831).
- Privileged commands will now run correctly when a spec file or support file contains characters that require encoding. Fixes [#30933](https://github.com/cypress-io/cypress/issues/30933).
Copy link
Member

Choose a reason for hiding this comment

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

@AtofStryker Can you note that this is fixing a regression in 14.0.0?


**Dependency Updates:**

Expand Down
7 changes: 7 additions & 0 deletions packages/driver/cypress/e2e/issues/issue 30933.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @see https://github.com/cypress-io/cypress/issues/30933
describe('issue #30933', { browser: '!webkit' }, () => {
it('is able to run privileged commands when there is a space in the spec name', () => {
cy.visit('/fixtures/files-form.html')
cy.get('#basic').selectFile('cypress/fixtures/valid.json')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@
script = replace.call(script, queryStringRegex, '')
}

return stringIncludes.call(err.stack, script)
// stack URLs come in URI encoded by default.
// we need to make sure our script names are also URI encoded
// so the comparisons match
const scriptName = encodeURI(script)

return stringIncludes.call(err.stack, scriptName)
})

return filteredLines.length > 0
Expand Down
Loading