Skip to content

Commit c66b449

Browse files
authored
test: fix studio windows tests (#31258)
1 parent 8a35c01 commit c66b449

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.circleci/workflows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ windowsWorkflowFilters: &windows-workflow-filters
8484
- equal: [ develop, << pipeline.git.branch >> ]
8585
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
8686
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
87-
- equal: [ 'feat/implement_bidi', << pipeline.git.branch >> ]
87+
- equal: [ 'mschile/studio/windows_url_fix', << pipeline.git.branch >> ]
8888
- matches:
8989
pattern: /^release\/\d+\.\d+\.\d+$/
9090
value: << pipeline.git.branch >>

packages/app/cypress/e2e/studio/studio.cy.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,11 @@ describe('studio functionality', () => {
695695

696696
cy.get('button.studio-copy').click()
697697

698-
cy.get('@writeText').should('have.been.calledOnceWith',
699-
`/* ==== Generated with Cypress Studio ==== */
700-
cy.get('#increment').click();
701-
/* ==== End Cypress Studio ==== */`)
698+
if (Cypress.platform === 'win32') {
699+
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\r\ncy.get(\'#increment\').click();\r\n/* ==== End Cypress Studio ==== */')
700+
} else {
701+
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\ncy.get(\'#increment\').click();\n/* ==== End Cypress Studio ==== */')
702+
}
702703
})
703704

704705
it('copies the studio commands to the clipboard using studio toolbar', () => {
@@ -713,10 +714,11 @@ cy.get('#increment').click();
713714

714715
cy.findByTestId('studio-toolbar-controls').findByTestId('copy-commands').click()
715716

716-
cy.get('@writeText').should('have.been.calledOnceWith',
717-
`/* ==== Generated with Cypress Studio ==== */
718-
cy.get('#increment').click();
719-
/* ==== End Cypress Studio ==== */`)
717+
if (Cypress.platform === 'win32') {
718+
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\r\ncy.get(\'#increment\').click();\r\n/* ==== End Cypress Studio ==== */')
719+
} else {
720+
cy.get('@writeText').should('have.been.calledOnceWith', '/* ==== Generated with Cypress Studio ==== */\ncy.get(\'#increment\').click();\n/* ==== End Cypress Studio ==== */')
721+
}
720722
})
721723

722724
it('removes pending commands if the page is reloaded', () => {
@@ -867,7 +869,12 @@ describe('studio functionality', () => {
867869

868870
cy.location().its('hash').should('equal', '#/specs').and('not.contain', 'testId=').and('not.contain', 'studio=')
869871
cy.findByTestId('alert').should('contain.text', 'Spec not found')
870-
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress/e2e/spec.cy.js')
872+
873+
if (Cypress.platform === 'win32') {
874+
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress\\e2e\\spec.cy.js')
875+
} else {
876+
cy.findByTestId('alert-body').should('contain.text', 'There is no spec matching the following location: cypress/e2e/spec.cy.js')
877+
}
871878
})
872879

873880
it('appends the studio commands to the commands added to the test on the file system when file watching is disabled', () => {

0 commit comments

Comments
 (0)