Skip to content

Commit

Permalink
Merge branch 'muaz/CLOUD-577-spec-list-display-latest-runs' into tgri…
Browse files Browse the repository at this point in the history
…esser/CLOUD-577-spec-list-display-latest-runs-batching

* muaz/CLOUD-577-spec-list-display-latest-runs:
  fix: Update "Request Access" button state after requesting access (ACI) (#22499)
  feat: Support "Queued" latest run status (#22497)
  fix: remove ctx.cloud.reset in tests, handle infinite loop in stale results (#22483)
  chore: add reporter webpack to gulp watch script (#22386)
  fix: Increase timeout for npm-webpack-dev-server tests (#22489)
  fix: Time out unmatched prerequests in proxy to avoid leaking memory (#22462)
  fix: Sort results in findCrossOriginLogs test helper to deterministic (#22481)
  fix: memory leak caused by storing base64 encoded files recieved by CDP `Network.requestWillBeSent` (#22460)
  fix: Improve cross-origin cookie handling (#22320)
  feat: Add button to clear value from search fields (#22202)
  chore: Add test to verify settings panels are collapsed by default (#22382)
  fix: process_profiler follow up work for v10 (#22363)
  chore: Update Chrome (stable) to 103.0.5060.53 (#22441)
  refactor: use design system windicss config (#21503)
  chore: update readme logo (#22433)
  chore: Update Chrome (beta) to 103.0.5060.53 (#22351)
  chore: updating version (#22432)
  Trigger Build
  • Loading branch information
tgriesser committed Jun 24, 2022
2 parents 2517f8b + 0390470 commit 7f042c4
Show file tree
Hide file tree
Showing 102 changed files with 2,423 additions and 1,505 deletions.
8 changes: 7 additions & 1 deletion README.md
@@ -1,5 +1,11 @@
<p align="center">
<a href="https://www.cypress.io"><img src="https://cloud.githubusercontent.com/assets/1268976/20607953/d7ae489c-b24a-11e6-9cc4-91c6c74c5e88.png"/></a>
<a href="https://www.cypress.io">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/cypress-logo-dark.png">
<source media="(prefers-color-scheme: light)" srcset="./assets/cypress-logo-light.png">
<img alt="Cypress Logo" src="./assets/cypress-logo-light.png">
</picture>
</a>
</p>
<p align="center">
<a href="https://on.cypress.io">Documentation</a> |
Expand Down
Binary file added assets/cypress-logo-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cypress-logo-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions browser-versions.json
@@ -1,4 +1,4 @@
{
"chrome:beta": "103.0.5060.42",
"chrome:stable": "102.0.5005.115"
"chrome:beta": "103.0.5060.53",
"chrome:stable": "103.0.5060.53"
}
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/test/.mocharc.js
@@ -1,4 +1,4 @@
module.exports = {
spec: 'test/**/*.spec.ts',
timeout: 10000,
timeout: 15000,
}
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "10.1.0",
"version": "10.2.0",
"description": "Cypress.io end to end testing tool",
"private": true,
"scripts": {
Expand Down
8 changes: 1 addition & 7 deletions packages/app/cypress/e2e/reporter_header.cy.ts
Expand Up @@ -24,13 +24,7 @@ describe('Reporter Header', () => {
cy.get('[data-cy="spec-file-item"]').should('have.length', 3)
.should('contain', 'dom-content.spec')

cy.get('body').type('f')

cy.get('input').clear()

cy.get('[data-cy="spec-file-item"]').should('have.length', '3')

cy.get('input').type('asdf', { force: true })
cy.get('input').clear().type('asdf', { force: true })

cy.get('[data-cy="spec-file-item"]').should('have.length', 0)
})
Expand Down
23 changes: 3 additions & 20 deletions packages/app/cypress/e2e/runs.cy.ts
Expand Up @@ -107,12 +107,6 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {

cy.findByTestId('sidebar-link-runs-page').click()

// TODO: investigate the scenario for this test
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})

cy.findByText(defaultMessages.runs.connect.buttonProject).click()
cy.get('[aria-modal="true"]').should('exist')

Expand Down Expand Up @@ -142,7 +136,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
cy.visitApp()

cy.remoteGraphQLIntercept(async (obj) => {
if ((obj.operationName === 'CheckCloudOrganizations_cloudViewerChange_cloudViewer' || obj.operationName === 'Runs_cloudViewer')) {
if ((obj.operationName === 'CheckCloudOrganizations_cloudViewerChange_cloudViewer' || obj.operationName === 'Runs_cloudViewer' || obj.operationName === 'SpecsPageContainer_cloudViewer')) {
if (obj.result.data?.cloudViewer?.organizations?.nodes) {
obj.result.data.cloudViewer.organizations.nodes = []
}
Expand All @@ -153,12 +147,6 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {

cy.findByTestId('sidebar-link-runs-page').click()

// TODO: investigate the scenario for this test
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})

cy.findByText(defaultMessages.runs.connect.buttonProject).click()
cy.get('[aria-modal="true"]').should('exist')

Expand Down Expand Up @@ -609,8 +597,6 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
let cloudData: any

cy.loginUser()
cy.visitApp()

cy.remoteGraphQLIntercept((obj) => {
if (obj.operationName === 'Runs_currentProject_cloudProject_cloudProjectBySlug') {
cloudData = obj.result
Expand All @@ -622,12 +608,9 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
return obj.result
})

cy.visitApp()

cy.findByTestId('sidebar-link-runs-page').click()
// TODO: investigate the scenario for this test
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})

cy.contains('h2', 'Cannot connect to the Cypress Dashboard')
cy.percySnapshot()
Expand Down
24 changes: 0 additions & 24 deletions packages/app/cypress/e2e/specs_list_latest_runs.cy.ts
Expand Up @@ -128,23 +128,11 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo
cy.openProject('cypress-in-cypress')
cy.startAppServer()

cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})

cy.withCtx((ctx, o) => {
o.sinon.stub(ctx.lifecycleManager.git!, 'currentBranch').value('fakeBranch')
})
})

afterEach(() => {
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})
})

context('when no runs are recorded', () => {
beforeEach(() => {
cy.loginUser()
Expand Down Expand Up @@ -596,11 +584,6 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200 }, () =
cy.openProject('cypress-in-cypress')
cy.startAppServer()

cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})

cy.loginUser()

simulateRunData()
Expand All @@ -612,13 +595,6 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200 }, () =
cy.goOffline()
})

afterEach(() => {
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})
})

it('shows placeholders for all visible specs', () => {
allVisibleSpecsShouldBePlaceholders()
})
Expand Down
Expand Up @@ -15,11 +15,10 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
cy.startAppServer('component')

cy.loginUser()
cy.visitApp()

// Simulate no orgs
cy.remoteGraphQLIntercept(async (obj) => {
if ((obj.operationName === 'CheckCloudOrganizations_cloudViewerChange_cloudViewer' || obj.operationName === 'Runs_cloudViewer')) {
if ((obj.operationName === 'CheckCloudOrganizations_cloudViewerChange_cloudViewer' || obj.operationName === 'Runs_cloudViewer' || obj.operationName === 'SpecsPageContainer_cloudViewer')) {
if (obj.result.data?.cloudViewer?.organizations?.nodes) {
obj.result.data.cloudViewer.organizations.nodes = []
}
Expand All @@ -28,13 +27,9 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
return obj.result
})

cy.findByTestId('sidebar-link-runs-page').click()
cy.visitApp()

// TODO: investigate the scenario for this test
cy.withCtx((ctx) => {
// clear cloud cache
ctx.cloud.reset()
})
cy.findByTestId('sidebar-link-runs-page').click()

cy.findByText(defaultMessages.runs.connect.buttonProject).click()
cy.get('[aria-modal="true"]').should('exist')
Expand Down
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/support/execute-spec.ts
Expand Up @@ -9,7 +9,7 @@ declare global {
* 3. Waits (with a timeout of 30s) for the Rerun all tests button to be present. This ensures all tests have completed
*
*/
waitForSpecToFinish()
waitForSpecToFinish(): void
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/app/package.json
Expand Up @@ -34,7 +34,6 @@
"@vitejs/plugin-vue": "2.2.4",
"@vitejs/plugin-vue-jsx": "1.3.8",
"@vueuse/core": "7.2.2",
"@windicss/plugin-interaction-variants": "1.0.0",
"ansi-to-html": "0.6.14",
"bluebird": "3.5.3",
"classnames": "2.3.1",
Expand Down Expand Up @@ -69,7 +68,6 @@
"vue-i18n": "9.2.0-beta.7",
"vue-router": "4",
"vue-tsc": "^0.3.0",
"windicss": "3.1.4",
"wonka": "^4.0.15"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/runner/event-manager.ts
Expand Up @@ -39,7 +39,7 @@ const driverToSocketEvents = 'backend:request automation:request mocha recorder:
const driverTestEvents = 'test:before:run:async test:after:run'.split(' ')
const driverToLocalEvents = 'viewport:changed config stop url:changed page:loading visit:failed visit:blank cypress:in:cypress:runner:event'.split(' ')
const socketRerunEvents = 'runner:restart watched:file:changed'.split(' ')
const socketToDriverEvents = 'net:stubbing:event request:event script:error'.split(' ')
const socketToDriverEvents = 'net:stubbing:event request:event script:error cross:origin:automation:cookies'.split(' ')
const localToReporterEvents = 'reporter:log:add reporter:log:state:changed reporter:log:remove'.split(' ')

/**
Expand Down
24 changes: 13 additions & 11 deletions packages/app/src/runs/RunsError.spec.tsx
Expand Up @@ -6,17 +6,19 @@ describe('<RunsError />', () => {
cy.mount({
name: 'RunsError',
render () {
return (<div class="h-screen">
<RunsError
message="Cannot connect to the Cypress Dashboard"
icon="error"
buttonText="Request Access"
buttonIcon={PaperAirplaneIcon}
>
The request timed out when trying to retrieve the recorded runs from the Cypress Dashboard. <br/>
Please refresh the page to try again and visit our Status Page if this behavior continues.
</RunsError>
</div>)
return (
<div class="h-screen">
<RunsError
message="Cannot connect to the Cypress Dashboard"
icon="error"
buttonText="Request Access"
buttonIcon={PaperAirplaneIcon}
>
The request timed out when trying to retrieve the recorded runs from the Cypress Dashboard. <br/>
Please refresh the page to try again and visit our Status Page if this behavior continues.
</RunsError>
</div>
)
},
})
})
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/settings/SettingsCard.vue
Expand Up @@ -32,7 +32,10 @@
</template>
</ListRowHeader>
</template>
<div class="divide-y space-y-32px divide-gray-100 p-24px children:pt-24px first:first:pt-0">
<div
data-cy="setting-expanded-container"
class="divide-y space-y-32px divide-gray-100 p-24px children:pt-24px first:first:pt-0"
>
<slot />
</div>
</Collapsible>
Expand Down
17 changes: 7 additions & 10 deletions packages/app/src/settings/SettingsContainer.cy.tsx
Expand Up @@ -2,17 +2,19 @@ import { SettingsContainerFragmentDoc } from '../generated/graphql-test'
import { defaultMessages } from '@cy/i18n'
import SettingsContainer from './SettingsContainer.vue'

const mountSettingsContainer = () => cy.mountFragment(SettingsContainerFragmentDoc, { render: (gql) => <SettingsContainer gql={gql} /> })

beforeEach(() => mountSettingsContainer())

describe('<SettingsContainer />', { viewportHeight: 800, viewportWidth: 900 }, () => {
const mountSettingsContainer = () => cy.mountFragment(SettingsContainerFragmentDoc, { render: (gql) => <SettingsContainer gql={gql} /> })
it('renders sections collapsed by default', () => {
cy.findByTestId('settings').should('be.visible')
cy.findByTestId('setting-expanded-container').should('not.exist')

it('renders', () => {
mountSettingsContainer()
cy.percySnapshot()
})

it('expands and collapses project settings', () => {
mountSettingsContainer()

cy.contains('Project Settings').click()

cy.findByText(defaultMessages.settingsPage.experiments.title).scrollIntoView().should('be.visible')
Expand All @@ -25,8 +27,6 @@ describe('<SettingsContainer />', { viewportHeight: 800, viewportWidth: 900 }, (
})

it('expands and collapses device settings', () => {
mountSettingsContainer()

cy.contains('Device Settings').click()

cy.findByText(defaultMessages.settingsPage.editor.title).should('be.visible')
Expand All @@ -40,8 +40,6 @@ describe('<SettingsContainer />', { viewportHeight: 800, viewportWidth: 900 }, (
})

it('expands and collapses cloud settings', () => {
mountSettingsContainer()

cy.contains('Dashboard Settings').click()

cy.findByText(defaultMessages.settingsPage.projectId.title).scrollIntoView().should('be.visible')
Expand All @@ -52,7 +50,6 @@ describe('<SettingsContainer />', { viewportHeight: 800, viewportWidth: 900 }, (
})

it('renders footer with CTA button', () => {
mountSettingsContainer()
cy.contains('p', defaultMessages.settingsPage.footer.text.replace('{testingType}', 'E2E'))
cy.contains('a', defaultMessages.settingsPage.footer.button)
.should('have.attr', 'href', defaultMessages.settingsPage.footer.buttonLink)
Expand Down
19 changes: 17 additions & 2 deletions packages/app/src/specs/InlineSpecListHeader.cy.tsx
Expand Up @@ -10,7 +10,6 @@ describe('InlineSpecListHeader', () => {
cy.wrap(search).as('search')

const methods = {
search: search.value,
'onUpdate:search': (val: string) => {
search.value = val
},
Expand All @@ -19,7 +18,7 @@ describe('InlineSpecListHeader', () => {

cy.mount(() =>
(<div class="bg-gray-1000">
<InlineSpecListHeader {...methods} resultCount={resultCount} />
<InlineSpecListHeader {...methods} search={search.value} resultCount={resultCount} />
</div>))
}

Expand All @@ -28,6 +27,7 @@ describe('InlineSpecListHeader', () => {
const searchString = 'my/component.cy.tsx'

cy.findByLabelText(defaultMessages.specPage.searchPlaceholder)
// `force` necessary due to the field label being overlaid on top of the input
.type(searchString, { delay: 0, force: true })
.get('@search').its('value').should('eq', searchString)
})
Expand All @@ -40,6 +40,21 @@ describe('InlineSpecListHeader', () => {
.should('have.been.called')
})

it('clears search field when clear button is clicked', () => {
mountWithResultCount(0)

cy.findByTestId('clear-search-button')
.should('not.exist')

cy.findByLabelText(defaultMessages.specPage.searchPlaceholder)
// `force` necessary due to the field label being overlaid on top of the input
.type('abcd', { delay: 0, force: true })
.get('@search').its('value').should('eq', 'abcd')

cy.findByTestId('clear-search-button').click()
cy.get('@search').its('value').should('eq', '')
})

it('exposes the result count correctly to assistive tech', () => {
mountWithResultCount(0)
cy.contains('No Matches')
Expand Down

0 comments on commit 7f042c4

Please sign in to comment.