Skip to content

Commit

Permalink
fix: make sure privileged commands can run when there is a space in t…
Browse files Browse the repository at this point in the history
…he spec or support file name (#31001)

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

* update changelog
  • Loading branch information
AtofStryker authored Feb 3, 2025
1 parent fdb58d4 commit 2a57c8b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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).
- Fixed an issue in Cypress [`14.0.0`](https://docs.cypress.io/guides/references/changelog#14-0-0) where privileged commands did not run correctly when a spec file or support file contained characters that required encoding. Fixes [#30933](https://github.com/cypress-io/cypress/issues/30933).

**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

5 comments on commit 2a57c8b

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2a57c8b Feb 3, 2025

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.2/linux-arm64/develop-2a57c8ba156502c88349448e0a30b047a3e282a9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2a57c8b Feb 3, 2025

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.2/linux-x64/develop-2a57c8ba156502c88349448e0a30b047a3e282a9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2a57c8b Feb 3, 2025

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.2/win32-x64/develop-2a57c8ba156502c88349448e0a30b047a3e282a9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2a57c8b Feb 3, 2025

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.2/darwin-arm64/develop-2a57c8ba156502c88349448e0a30b047a3e282a9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2a57c8b Feb 3, 2025

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.2/darwin-x64/develop-2a57c8ba156502c88349448e0a30b047a3e282a9/cypress.tgz

Please # to comment.