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:
  test: Addressing launchpad test flake in Windows (#22536)
  address comments from @marktnoonan
  Address code review comments
  followup on other comments
  re: @lmiller1990 PR comments
  chore(deps): update dependency semantic-release to v19 [security] (#22238)
  chore: Address skipped specs in server package (#22356)
  Address code review findings
  Address code review findings
  Empty-Commit to generate new percy nonce
  fix: handle case of implicit plugins/index.js files during migration (#22501)
  • Loading branch information
tgriesser committed Jun 27, 2022
2 parents b6b9a89 + d4ee389 commit 7365734
Show file tree
Hide file tree
Showing 52 changed files with 1,385 additions and 1,438 deletions.
2 changes: 1 addition & 1 deletion npm/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"raw-loader": "1.0.0",
"renderkid": "2.0.5",
"rxjs": "~6.6.0",
"semantic-release": "17.4.2",
"semantic-release": "19.0.3",
"to-string-loader": "1.1.6",
"ts-loader": "8.1.0",
"ts-node": "^10.2.1",
Expand Down
2 changes: 1 addition & 1 deletion npm/cypress-schematic/sandbox12/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@angular/compiler-cli": "~13.1.3",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.7.0",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-preprocessor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"react-dom": "16.13.1",
"react-scripts": "3.2",
"rimraf": "3.0.2",
"semantic-release": "17.2.3",
"semantic-release": "19.0.3",
"sinon": "^9.0.0",
"sinon-chai": "^3.5.0",
"snap-shot-it": "7.9.2",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"print-arch": "1.0.0",
"proxyquire": "2.1.3",
"rimraf": "3.0.2",
"semantic-release": "17.2.3",
"semantic-release": "19.0.3",
"semantic-release-monorepo": "7.0.3",
"semver": "7.3.2",
"shelljs": "0.8.5",
Expand Down
6 changes: 5 additions & 1 deletion packages/app/cypress/e2e/reporter_header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ describe('Reporter Header', () => {
cy.get('[data-cy="spec-file-item"]').should('have.length', 3)
.should('contain', 'dom-content.spec')

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

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

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

cy.get('[data-cy="spec-file-item"]').should('have.length', 0)
})
Expand Down
54 changes: 38 additions & 16 deletions packages/app/cypress/e2e/specs_list_latest_runs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function allVisibleSpecsShouldBePlaceholders () {
cy.get('.spec-list-container').scrollTo('bottom')
}

describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewportHeight: 900 }, () => {
describe('App/Cloud Integration - Latest runs and Average duration', { viewportWidth: 1200, viewportHeight: 900 }, () => {
beforeEach(() => {
cy.scaffoldProject('cypress-in-cypress')
cy.openProject('cypress-in-cypress')
Expand Down Expand Up @@ -166,8 +166,12 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo

it('shows correct tooltips with log in buttons', () => {
cy.findByTestId('latest-runs-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'Connect to the Cypress Dashboard to see the status of your latest runs')
cy.get('.v-popper__popper--shown button').should('have.text', 'Log in to the Dashboard').click()
cy.get('.v-popper__popper--shown')
.should('contain', 'Connect to the Cypress Dashboard to see the status of your latest runs')
.find('button')
.should('have.text', 'Log in to the Dashboard')
.click()

cy.findByRole('dialog', { name: 'Log in to Cypress' }).within(() => {
cy.get('button').contains('Log In')
cy.get('[aria-label="Close"]').click()
Expand All @@ -176,8 +180,12 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo
cy.findByTestId('latest-runs-header').trigger('mouseleave')

cy.findByTestId('average-duration-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'Connect to the Cypress Dashboard to see the average spec durations of your latest runs')
cy.get('.v-popper__popper--shown button').should('have.text', 'Log in to the Dashboard').click()
cy.get('.v-popper__popper--shown')
.should('contain', 'Connect to the Cypress Dashboard to see the average spec durations of your latest runs')
.find('button')
.should('have.text', 'Log in to the Dashboard')
.click()

cy.findByRole('dialog', { name: 'Log in to Cypress' }).within(() => {
cy.get('button').contains('Log In')
cy.get('[aria-label="Close"]').click()
Expand All @@ -204,17 +212,25 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo

it('shows correct tooltips with log in buttons', () => {
cy.findByTestId('latest-runs-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'Connect to the Cypress Dashboard to see the status of your latest runs')
cy.get('.v-popper__popper--shown button').should('have.text', 'Connect your project').click()
cy.get('.v-popper__popper--shown')
.should('contain', 'Connect to the Cypress Dashboard to see the status of your latest runs')
.find('button')
.should('have.text', 'Connect your project')
.click()

cy.findByRole('dialog', { name: 'Create project' }).within(() => {
cy.get('[aria-label="Close"]').click({ force: true })
})

cy.findByTestId('latest-runs-header').trigger('mouseleave')

cy.findByTestId('average-duration-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'Connect to the Cypress Dashboard to see the average spec durations of your latest runs')
cy.get('.v-popper__popper--shown button').should('have.text', 'Connect your project').click()
cy.get('.v-popper__popper--shown')
.should('contain', 'Connect to the Cypress Dashboard to see the average spec durations of your latest runs')
.find('button')
.should('have.text', 'Connect your project')
.click()

cy.findByRole('dialog', { name: 'Create project' }).within(() => {
cy.get('[aria-label="Close"]').click({ force: true })
})
Expand Down Expand Up @@ -252,13 +268,19 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo

it('shows correct tooltips', () => {
cy.findByTestId('latest-runs-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'The status of your latest runs in the Cypress Dashboard')
cy.get('.v-popper__popper--shown button').should('not.exist')
cy.get('.v-popper__popper--shown')
.should('contain', 'The status of your latest runs in the Cypress Dashboard')
.find('button')
.should('not.exist')

cy.findByTestId('latest-runs-header').trigger('mouseleave')

cy.findByTestId('average-duration-header').trigger('mouseenter')
cy.contains('.v-popper__popper--shown', 'The average spec durations of your latest runs in the Cypress Dashboard')
cy.get('.v-popper__popper--shown button').should('not.exist')
cy.get('.v-popper__popper--shown')
.should('contain', 'The average spec durations of your latest runs in the Cypress Dashboard')
.find('button')
.should('not.exist')

cy.findByTestId('average-duration-header').trigger('mouseleave')
})

Expand Down Expand Up @@ -334,7 +356,7 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo
})

it('should retain data after app navigation', () => {
// ACI data should load and render to start
// App/Cloud Integration data should load and render to start
specShouldShow('accounts_list.spec.js', ['orange-400', 'gray-300', 'red-400'], 'PASSED')
cy.get(averageDurationSelector('accounts_list.spec.js')).contains('0:12')

Expand All @@ -348,7 +370,7 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo
cy.location('hash').should('include', '/specs')
cy.findByText('E2E specs').should('be.visible')

// ACI data should still be loaded and rendered
// App/Cloud Integration data should still be loaded and rendered
specShouldShow('accounts_list.spec.js', ['orange-400', 'gray-300', 'red-400'], 'PASSED')
cy.get(averageDurationSelector('accounts_list.spec.js')).contains('0:12')
})
Expand Down Expand Up @@ -583,7 +605,7 @@ describe('ACI - Latest runs and Average duration', { viewportWidth: 1200, viewpo
})
})

describe('ACI - Latest runs and Average duration', { viewportWidth: 1200 }, () => {
describe('App/Cloud Integration - Latest runs and Average duration', { viewportWidth: 1200 }, () => {
context('when offline', () => {
beforeEach(() => {
cy.scaffoldProject('cypress-in-cypress')
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/runs/CloudConnectButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<LoginModal
v-model="isLoginOpen"
:gql="props.gql"
:utm-medium="'Runs Tab'"
utm-medium="Runs Tab"
/>
<CloudConnectModals
v-if="isProjectConnectOpen"
Expand Down
10 changes: 8 additions & 2 deletions packages/app/src/runs/RunsErrorRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ mutation RunsErrorRenderer_RequestAccess( $projectId: String! ) {
const hasRequestedAccess = ref(false)
onMounted(() => {
hasRequestedAccess.value = (props.gql.currentProject?.cloudProject?.__typename === 'CloudProjectUnauthorized' && props.gql.currentProject.cloudProject.hasRequestedAccess) ?? false
if (props.gql.currentProject?.cloudProject?.__typename === 'CloudProjectUnauthorized') {
hasRequestedAccess.value = props.gql.currentProject.cloudProject.hasRequestedAccess ?? false
}
})
const requestAccessMutation = useMutation(RunsErrorRenderer_RequestAccessDocument)
Expand All @@ -140,7 +142,11 @@ async function requestAccess () {
if (projectId) {
const result = await requestAccessMutation.executeMutation({ projectId })
hasRequestedAccess.value = result.data?.cloudProjectRequestAccess?.__typename === 'CloudProjectUnauthorized' ? result.data.cloudProjectRequestAccess.hasRequestedAccess ?? false : false
if (result.data?.cloudProjectRequestAccess?.__typename === 'CloudProjectUnauthorized') {
hasRequestedAccess.value = result.data.cloudProjectRequestAccess.hasRequestedAccess ?? false
} else {
hasRequestedAccess.value = false
}
}
}
Expand Down
15 changes: 6 additions & 9 deletions packages/app/src/specs/LastUpdatedHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,18 @@ import Tooltip from '@packages/frontend-shared/src/components/Tooltip.vue'
import { getUrlWithParams } from '@packages/frontend-shared/src/utils/getUrlWithParams'
import ExternalLink from '@cy/gql-components/ExternalLink.vue'
import { useI18n } from '@cy/i18n'
import { computed } from 'vue'
const { t } = useI18n()
const props = defineProps<{
isGitAvailable: boolean
}>()
const docsUrl = computed(() => {
return getUrlWithParams({
url: 'https://on.cypress.io/specs-last-updated',
params: {
utm_medium: 'Specs Last Updated Tooltip',
utm_campaign: 'Last Updated',
},
})
const docsUrl = getUrlWithParams({
url: 'https://on.cypress.io/specs-last-updated',
params: {
utm_medium: 'Specs Last Updated Tooltip',
utm_campaign: 'Last Updated',
},
})
</script>
6 changes: 1 addition & 5 deletions packages/app/src/specs/RunStatusDots.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ const dotClasses = computed(() => {
})
const latestRun = computed(() => {
if (runs.value == null || runs.value.length === 0 || runs.value[0] === null) {
return null
}
return runs.value[0]
return runs.value?.[0] ?? null
})
const latestDot = computed(() => {
Expand Down
29 changes: 12 additions & 17 deletions packages/app/src/specs/SpecHeaderCloudDataTooltip.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { defaultMessages } from '@cy/i18n'
describe('SpecHeaderCloudDataTooltip', () => {
function mountWithStatus (
status: 'NOT_FOUND' | 'LOGGED_OUT' | 'CONNECTED' | 'NOT_CONNECTED' | 'UNAUTHORIZED' | 'ACCESS_REQUESTED',
mode: string,
msgKeys: {
header: string
connected: string
Expand Down Expand Up @@ -49,13 +50,7 @@ describe('SpecHeaderCloudDataTooltip', () => {
<div class="flex justify-around">
<SpecHeaderCloudDataTooltip
gql={gql}
headerTextKeyPath={msgKeys.header}
connectedTextKeyPath={msgKeys.connected}
notConnectedTextKeyPath={msgKeys.notConnected}
noAccessTextKeyPath={msgKeys.noAccess}
docsTextKeyPath={msgKeys.docs}
docsUrl="https://dummy.cypress.io/specs-latest-runs?utm_medium=Specs+Latest+Runs+Tooltip&utm_campaign=Latest+Runs"
data-cy="latest-runs-header"
mode={mode as any}
onShowLogin={showLoginSpy}
onShowConnectToProject={showConnectToProjectSpy}
/>
Expand All @@ -65,7 +60,7 @@ describe('SpecHeaderCloudDataTooltip', () => {
}

[{
contextName: 'Average Duration',
mode: 'AVG_DURATION',
msgKeys: {
header: 'specPage.averageDuration.header',
connected: 'specPage.averageDuration.tooltip.connected',
Expand All @@ -74,19 +69,19 @@ describe('SpecHeaderCloudDataTooltip', () => {
docs: 'specPage.averageDuration.tooltip.linkText',
},
}, {
contextName: 'Latest Runs',
mode: 'LATEST_RUNS',
msgKeys: {
header: 'specPage.latestRuns.header',
connected: 'specPage.latestRuns.tooltip.connected',
notConnected: 'specPage.latestRuns.tooltip.notConnected',
noAccess: 'specPage.latestRuns.tooltip.noAccess',
docs: 'specPage.latestRuns.tooltip.linkText',
},
}].forEach(({ contextName, msgKeys }) => {
context(contextName, () => {
}].forEach(({ mode, msgKeys }) => {
context(mode, () => {
context('connected', () => {
beforeEach(() => {
mountWithStatus('CONNECTED', msgKeys)
mountWithStatus('CONNECTED', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand All @@ -104,7 +99,7 @@ describe('SpecHeaderCloudDataTooltip', () => {

context('not connected', () => {
beforeEach(() => {
mountWithStatus('NOT_CONNECTED', msgKeys)
mountWithStatus('NOT_CONNECTED', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand All @@ -126,7 +121,7 @@ describe('SpecHeaderCloudDataTooltip', () => {

context('unauthorized', () => {
beforeEach(() => {
mountWithStatus('UNAUTHORIZED', msgKeys)
mountWithStatus('UNAUTHORIZED', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand Down Expand Up @@ -164,7 +159,7 @@ describe('SpecHeaderCloudDataTooltip', () => {

context('access requested', () => {
beforeEach(() => {
mountWithStatus('ACCESS_REQUESTED', msgKeys)
mountWithStatus('ACCESS_REQUESTED', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand All @@ -184,7 +179,7 @@ describe('SpecHeaderCloudDataTooltip', () => {

context('logged out', () => {
beforeEach(() => {
mountWithStatus('LOGGED_OUT', msgKeys)
mountWithStatus('LOGGED_OUT', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand All @@ -206,7 +201,7 @@ describe('SpecHeaderCloudDataTooltip', () => {

context('not found', () => {
beforeEach(() => {
mountWithStatus('NOT_FOUND', msgKeys)
mountWithStatus('NOT_FOUND', mode, msgKeys)
})

it('should render expected tooltip content', () => {
Expand Down
Loading

0 comments on commit 7365734

Please sign in to comment.