-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Zachary Williams <ZachJW34@gmail.com> Co-authored-by: Ankit <ankit@cypress.io> Co-authored-by: Stokes Player <stokes.player@gmail.com> Co-authored-by: elevatebart <bart@cypress.io> Co-authored-by: Rocky <25568640+rockindahizzy@users.noreply.github.com> Co-authored-by: Stokes Player <stokes@cypress.io> Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> Co-authored-by: Mark Noonan <mark@cypress.io> Co-authored-by: Mike Plummer <mikep@cypress.io> Co-authored-by: amehta265 <65267668+amehta265@users.noreply.github.com> Co-authored-by: Adam Stone-Lord <adams@cypress.io> Co-authored-by: Mike Plummer <mike-plummer@users.noreply.github.com> Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
- Loading branch information
1 parent
ee97b94
commit 660ff67
Showing
173 changed files
with
14,412 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
import RelevantRunsDataSource_RunsByCommitShas from '../fixtures/gql-RelevantRunsDataSource_RunsByCommitShas.json' | ||
|
||
Cypress.on('window:before:load', (win) => { | ||
win.__CYPRESS_GQL_NO_SOCKET__ = 'true' | ||
}) | ||
|
||
// These mocks all the responses so we can get deterministic | ||
// results to test the debug page. | ||
// The JSON fixtures were generated by using a real app and capturing | ||
// the responses. | ||
describe('App - Debug Page', () => { | ||
beforeEach(() => { | ||
cy.scaffoldProject('cypress-in-cypress') | ||
cy.openProject('cypress-in-cypress') | ||
cy.startAppServer('component') | ||
|
||
cy.loginUser() | ||
cy.withCtx((ctx) => { | ||
ctx.git?.__setGitHashesForTesting(['commit1', 'commit2']) | ||
}) | ||
|
||
cy.remoteGraphQLIntercept((obj, _testState, options) => { | ||
if (obj.operationName === 'RelevantRunsDataSource_RunsByCommitShas') { | ||
obj.result.data = options.RelevantRunsDataSource_RunsByCommitShas.data | ||
} | ||
|
||
return obj.result | ||
}, { RelevantRunsDataSource_RunsByCommitShas }) | ||
}) | ||
|
||
it('all tests passed', () => { | ||
// This mocks all the responses so we can get deterministic | ||
// results to test the debug page. | ||
cy.intercept('POST', '/__cypress/graphql/query-Debug', { | ||
fixture: 'debug-Passing/gql-Debug.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-CloudViewerAndProject_RequiredData', { | ||
fixture: 'debug-Passing/gql-CloudViewerAndProject_RequiredData.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-MainAppQuery', { | ||
fixture: 'debug-Passing/gql-MainAppQuery.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-SideBarNavigationContainer', { | ||
fixture: 'debug-Passing/gql-SideBarNavigationContainer', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-HeaderBar_HeaderBarQuery', { | ||
fixture: 'debug-Passing/gql-HeaderBar_HeaderBarQuery', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-SpecsPageContainer', { | ||
fixture: 'debug-Passing/gql-SpecsPageContainer', | ||
}) | ||
|
||
cy.visitApp() | ||
|
||
cy.findByTestId('sidebar-link-debug-page').click() | ||
cy.findByTestId('debug-container').should('be.visible') | ||
|
||
cy.findByTestId('header-top').contains('update projectId') | ||
cy.findByTestId('debug-header-dashboard-link') | ||
.contains('View in Cypress Cloud') | ||
.should('have.attr', 'href', 'https://cloud.cypress.io/projects/7p5uce/runs/2') | ||
|
||
cy.findByTestId('debug-runNumber-PASSED').contains('#2') | ||
cy.findByTestId('debug-commitsAhead').contains('You are 1 commit ahead') | ||
|
||
cy.findByTestId('metadata').within(() => { | ||
cy.get('[title="passed"]').contains('2') | ||
cy.get('[title="failed"]').contains('0') | ||
cy.get('[title="skipped"]').contains('0') | ||
cy.get('[title="pending"]').contains('2') | ||
cy.findByTestId('debug-header-branch').contains('main') | ||
cy.findByTestId('debug-header-commitHash').contains('e9d176f') | ||
cy.findByTestId('debug-header-author').contains('Lachlan Miller') | ||
cy.findByTestId('debug-header-createdAt').contains('01:18') | ||
}) | ||
|
||
cy.findByTestId('debug-passed').contains('Well Done!') | ||
cy.findByTestId('debug-passed').contains('All your tests passed.') | ||
cy.findByLabelText('Relevant run passed').should('be.visible').contains('0') | ||
cy.findByTestId('run-failures').should('not.exist') | ||
}) | ||
|
||
it('shows information about a failed spec', () => { | ||
cy.intercept('POST', '/__cypress/graphql/query-Debug', { | ||
fixture: 'debug-Failing/gql-Debug.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-CloudViewerAndProject_RequiredData', { | ||
fixture: 'debug-Failing/gql-CloudViewerAndProject_RequiredData.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-MainAppQuery', { | ||
fixture: 'debug-Failing/gql-MainAppQuery.json', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-SideBarNavigationContainer', { | ||
fixture: 'debug-Failing/gql-SideBarNavigationContainer', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-HeaderBar_HeaderBarQuery', { | ||
fixture: 'debug-Failing/gql-HeaderBar_HeaderBarQuery', | ||
}) | ||
|
||
cy.intercept('POST', '/__cypress/graphql/query-SpecsPageContainer', { | ||
fixture: 'debug-Failing/gql-SpecsPageContainer', | ||
}) | ||
|
||
cy.visitApp() | ||
|
||
cy.findByTestId('sidebar-link-debug-page').click() | ||
cy.findByTestId('debug-container').should('be.visible') | ||
|
||
cy.findByTestId('header-top').contains('chore: testing cypress') | ||
cy.findByTestId('debug-header-dashboard-link') | ||
.contains('View in Cypress Cloud') | ||
.should('have.attr', 'href', 'https://cloud.cypress.io/projects/vgqrwp/runs/136') | ||
|
||
cy.findByLabelText('Relevant run had 1 test failure').should('be.visible').contains('1') | ||
|
||
cy.findByTestId('debug-runNumber-FAILED').contains('#136') | ||
cy.findByTestId('debug-commitsAhead').contains('You are 1 commit ahead') | ||
|
||
cy.findByTestId('metadata').within(() => { | ||
cy.get('[title="passed"]').contains('1') | ||
cy.get('[title="failed"]').contains('1') | ||
cy.get('[title="skipped"]').contains('0') | ||
cy.get('[title="pending"]').contains('0') | ||
cy.findByTestId('debug-header-branch').contains('main') | ||
cy.findByTestId('debug-header-commitHash').contains('commit1') | ||
cy.findByTestId('debug-header-author').contains('Lachlan Miller') | ||
cy.findByTestId('debug-header-createdAt').contains('00:19') | ||
}) | ||
|
||
cy.findByTestId('spec-contents').within(() => { | ||
cy.contains('src/components/InfoPanel/InfoPanel.cy.ts') | ||
cy.findByTestId('metaData-Results-spec-duration').contains('00:04') | ||
cy.findByTestId('metaData-Results-operating-system').contains('Linux Ubuntu') | ||
cy.findByTestId('metaData-Results-browser').contains('Electron 106') | ||
cy.findByTestId('metaData-Results-testing-type').contains('Component') | ||
}) | ||
|
||
cy.findByTestId('test-row').contains('InfoPanel') | ||
cy.findByTestId('test-row').contains('renders') | ||
cy.findByTestId('run-failures').should('exist').should('have.attr', 'href', '#/specs/runner?file=src/components/InfoPanel/InfoPanel.cy.ts&mode=debug') | ||
}) | ||
}) |
157 changes: 157 additions & 0 deletions
157
packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
describe('cloud debug test filtering', () => { | ||
beforeEach(() => { | ||
cy.scaffoldProject('cloud-debug-filter') | ||
cy.openProject('cloud-debug-filter') | ||
cy.startAppServer('e2e') | ||
}) | ||
|
||
it('works with nested suites', () => { | ||
cy.visitApp(`specs/runner?file=cypress/e2e/test.cy.js`) | ||
|
||
cy.waitForSpecToFinish() | ||
|
||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/test.cy.js': ['t2'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/test.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
|
||
cy.get('.runnable-title').contains('t2') | ||
|
||
cy.get('.debug-dismiss').contains('1 / 4 tests').click() | ||
cy.waitForSpecToFinish({ passCount: 2, failCount: 2 }) | ||
|
||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/test.cy.js': ['s1 t4'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/test.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
|
||
cy.get('.runnable-title').contains('t4') | ||
}) | ||
|
||
it('wraps filter UI with large number of tests', () => { | ||
cy.visitApp(`specs/runner?file=cypress/e2e/lots-of-tests.cy.js`) | ||
|
||
cy.get('[data-cy="reporter-panel"]').as('reporterPanel') | ||
|
||
cy.waitForSpecToFinish() | ||
|
||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/lots-of-tests.cy.js': ['test1'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/lots-of-tests.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 50 }) | ||
|
||
cy.get('@reporterPanel').then((el) => el.width(500)) | ||
cy.get('@reporterPanel').percySnapshot('wide') | ||
|
||
cy.get('@reporterPanel').then((el) => el.width(350)) | ||
cy.get('@reporterPanel').percySnapshot('medium') | ||
|
||
cy.get('@reporterPanel').then((el) => el.width(250)) | ||
cy.get('@reporterPanel').percySnapshot('narrow') | ||
|
||
cy.get('@reporterPanel').then((el) => el.width(150)) | ||
cy.get('@reporterPanel').percySnapshot('skinny') | ||
}) | ||
|
||
it('works with skips and onlys', () => { | ||
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js`) | ||
|
||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
|
||
// .only is respected | ||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/skip-and-only.cy.js': ['t1', 't3'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
|
||
cy.get('.runnable-title').contains('t1') | ||
|
||
cy.get('.debug-dismiss').click().waitForSpecToFinish() | ||
|
||
// .only is ignored as it is not in set of filtered tests | ||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/skip-and-only.cy.js': ['t3'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
|
||
cy.get('.runnable-title').contains('t3') | ||
|
||
cy.get('.debug-dismiss').click().waitForSpecToFinish() | ||
|
||
// .skip is respected | ||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/skip-and-only.cy.js': ['t2', 't3'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1, pendingCount: 1 }) | ||
cy.get('.runnable-title').first().contains('t2') | ||
cy.get('.runnable-title').last().contains('t3') | ||
|
||
cy.get('.debug-dismiss').contains('2 / 4 tests').click().waitForSpecToFinish() | ||
|
||
// suite.only is respected | ||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/skip-and-only.cy.js': ['t3', 's1 t4'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/skip-and-only.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ passCount: 0, failCount: 1 }) | ||
cy.get('.runnable-title').contains('t4') | ||
}) | ||
|
||
it('works with browser filter', () => { | ||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/lots-of-tests.cy.j': ['t1', 's1 t2'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/browsers.cy.js&mode=debug`) | ||
|
||
cy.get('.runnable-title').eq(0).contains('t1 (skipped due to browser)') | ||
cy.get('.runnable-title').eq(1).contains('s1 (skipped due to browser)') | ||
cy.get('.runnable-title').eq(2).contains('t2') | ||
}) | ||
|
||
it('filter is maintained across cross-domain reinitialization', () => { | ||
cy.visitApp(`specs/runner?file=cypress/e2e/domain-change.cy.js`) | ||
|
||
cy.get('[data-cy="reporter-panel"]').as('reporterPanel') | ||
|
||
cy.waitForSpecToFinish() | ||
|
||
cy.withCtx((ctx) => { | ||
ctx.coreData.cloud.testsForRunResults = { | ||
'cypress/e2e/lots-of-tests.cy.j': ['t2', 't3'], | ||
} | ||
}) | ||
|
||
cy.visitApp(`specs/runner?file=cypress/e2e/domain-change.cy.js&mode=debug`) | ||
cy.waitForSpecToFinish({ failCount: 2 }) | ||
}) | ||
}) |
Oops, something went wrong.
660ff67
There was a problem hiding this comment.
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:
660ff67
There was a problem hiding this comment.
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:
660ff67
There was a problem hiding this comment.
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:
660ff67
There was a problem hiding this comment.
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:
660ff67
There was a problem hiding this comment.
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: