test: fix studio windows tests (#31258)

This commit is contained in:
Matt Schile
2025-03-11 11:32:41 -06:00
committed by GitHub
parent 8a35c019b6
commit c66b44913c
2 changed files with 17 additions and 10 deletions

View File

@@ -84,7 +84,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'feat/implement_bidi', << pipeline.git.branch >> ]
- equal: [ 'mschile/studio/windows_url_fix', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>

View File

@@ -695,10 +695,11 @@ describe('studio functionality', () => {
cy.get('button.studio-copy').click()
cy.get('@writeText').should('have.been.calledOnceWith',
`/* ==== Generated with Cypress Studio ==== */
cy.get('#increment').click();
/* ==== End Cypress Studio ==== */`)
if (Cypress.platform === 'win32') {
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\r\ncy.get(\'#increment\').click();\r\n/* ==== End Cypress Studio ==== */')
} else {
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\ncy.get(\'#increment\').click();\n/* ==== End Cypress Studio ==== */')
}
})
it('copies the studio commands to the clipboard using studio toolbar', () => {
@@ -713,10 +714,11 @@ cy.get('#increment').click();
cy.findByTestId('studio-toolbar-controls').findByTestId('copy-commands').click()
cy.get('@writeText').should('have.been.calledOnceWith',
`/* ==== Generated with Cypress Studio ==== */
cy.get('#increment').click();
/* ==== End Cypress Studio ==== */`)
if (Cypress.platform === 'win32') {
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\r\ncy.get(\'#increment\').click();\r\n/* ==== End Cypress Studio ==== */')
} else {
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\ncy.get(\'#increment\').click();\n/* ==== End Cypress Studio ==== */')
}
})
it('removes pending commands if the page is reloaded', () => {
@@ -867,7 +869,12 @@ describe('studio functionality', () => {
cy.location().its('hash').should('equal', '#/specs').and('not.contain', 'testId=').and('not.contain', 'studio=')
cy.findByTestId('alert').should('contain.text', 'Spec not found')
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress/e2e/spec.cy.js')
if (Cypress.platform === 'win32') {
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress\\e2e\\spec.cy.js')
} else {
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress/e2e/spec.cy.js')
}
})
it('appends the studio commands to the commands added to the test on the file system when file watching is disabled', () => {