Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display Cypress Dashboard metrics in the Specs Explorer #21250

Merged
merged 138 commits into from Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 131 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
e0ac37a
WIP: display latest runs
MuazOthman Apr 25, 2022
a595cbf
WIP: display latest runs [CLOUD-577]
MuazOthman Apr 28, 2022
1b05474
Merge branch '10.0-release' into muaz/CLOUD-577-spec-list-display-lat…
MuazOthman Apr 28, 2022
846f9b6
WIP: display latest runs [CLOUD-577]
MuazOthman Apr 29, 2022
3417dfe
Fixed code styling issues
MuazOthman May 3, 2022
c7be100
Merge branch '10.0-release' into muaz/CLOUD-577-spec-list-display-lat…
MuazOthman May 3, 2022
9426f72
Merge branch 10.0-release into muaz/CLOUD-577-spec-list-display-lates…
MuazOthman May 3, 2022
b162782
Added test to verify recent runs are rendered in spec list [CLOUD-577]
MuazOthman May 3, 2022
dda74fa
Merge branch 'muaz/CLOUD-576-spec-list-move-git-status' into muaz/CLO…
MuazOthman May 9, 2022
829cb2c
Added tooltip for Latest runs header
MuazOthman May 10, 2022
9bc2a5a
Merge branch 'muaz/CLOUD-576-spec-list-move-git-status' into muaz/CLO…
MuazOthman May 10, 2022
2ead38a
Merge branch '10.0-release' into muaz/CLOUD-577-spec-list-display-lat…
MuazOthman May 10, 2022
7c3f791
feat: add remoteField for consistent stitching of remote queries
tgriesser May 12, 2022
02f59e6
Added spec latest run tooltip with mock data [CLOUD-578]
MuazOthman May 12, 2022
b4d29d9
Updated the cloud schema to match latest changes
MuazOthman May 12, 2022
9554901
cleanup fetching logic
tgriesser May 12, 2022
029f489
Merge branch 'feat/app-cloud-intergation' into muaz/CLOUD-577-spec-li…
MuazOthman May 12, 2022
7383e79
Merge branch '10.0-release' into tgriesser/feat/remoteField-stitching
tgriesser May 13, 2022
f8689dc
Fix ts types, add cloudSpec field
tgriesser May 13, 2022
0b0a5d4
Updates in reponse to PR #21250
MuazOthman May 13, 2022
632cfcd
Merge branch 'tgriesser/feat/remoteField-stitching' into muaz/CLOUD-5…
MuazOthman May 13, 2022
576e0ac
Wired up latest runs with remote GQL query
MuazOthman May 16, 2022
d001f70
fix for remote fetching
tgriesser May 16, 2022
a9fbe79
Added average duration column
MuazOthman May 16, 2022
0b8631d
Styling updates for latest run tooltip
MuazOthman May 16, 2022
4c5668c
Latest run - Added a reload option to test fetching errors
MuazOthman May 17, 2022
223ba3e
fix: add name to deduplicate multiple remote field calls, make branch…
tgriesser May 17, 2022
1d1f211
Updated latest run tooltip and fixed auth flow for headings of spec list
MuazOthman May 18, 2022
405f549
Merge branch 'feat/app-cloud-intergation' into tgriesser/feat/remoteF…
MuazOthman Jun 1, 2022
088cf0b
Merge branch 'tgriesser/feat/remoteField-stitching' into muaz/CLOUD-5…
MuazOthman Jun 1, 2022
cae87d5
Added a tooltip for Last updated header and improved tooltip accessab…
MuazOthman Jun 2, 2022
9a8818e
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 3, 2022
92c2bab
Fixed a few broken tests
MuazOthman Jun 3, 2022
bfa8be0
Implemented lazy loading
MuazOthman Jun 3, 2022
e001817
Code cleanup and style fixes
MuazOthman Jun 3, 2022
d1cb5e0
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 6, 2022
27dbc91
Added some component tests
MuazOthman Jun 6, 2022
d9eb85e
Polished some styles
MuazOthman Jun 8, 2022
5c95239
after pairing w/ Muaz on polling for runs list metadata
tgriesser Jun 8, 2022
e85aeae
Merge branch 'develop' into mikep/CLOUD-577-develop-merge
mike-plummer Jun 9, 2022
1489d14
Added fromBranch param to averageDuration
MuazOthman Jun 9, 2022
f26ea2d
Merge pull request #22223 from cypress-io/mikep/CLOUD-577-develop-merge
MuazOthman Jun 9, 2022
57b661a
fix: Styling fixes around Spec List
mike-plummer Jun 9, 2022
e4073eb
Merge pull request #22232 from cypress-io/mikep/CLOUD-577-styling-fixes
MuazOthman Jun 9, 2022
c322c71
Fixed styling for RunStatusDots and skeleton
MuazOthman Jun 9, 2022
e2ca778
Fixed TS issues
MuazOthman Jun 9, 2022
f50b333
Finished polling implementation
MuazOthman Jun 9, 2022
9ef75dc
Fixed a bug preventing refetching
MuazOthman Jun 10, 2022
8bbe8aa
fix: SpecsList scrolling performance fixes
mike-plummer Jun 10, 2022
1cf0e3f
fix: Attempt to fix tooltip disposal issue
mike-plummer Jun 10, 2022
307a078
Fixed a couple of broken tests
MuazOthman Jun 10, 2022
c372eab
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 10, 2022
0a23a61
fix: ACI styling issues
mike-plummer Jun 10, 2022
54a08ad
fix: Tooltip hide issue
mike-plummer Jun 10, 2022
3c33a6b
fix: Fix cursor styling on tooltip headers
mike-plummer Jun 10, 2022
610224d
Merge pull request #22256 from cypress-io/mikep/COUD-577-specs-list-s…
MuazOthman Jun 11, 2022
3e653c0
Refactored to use batched fetches
MuazOthman Jun 11, 2022
86d262f
Fixed mocks in CT tests
MuazOthman Jun 11, 2022
2a5b8c2
Removed OUTDATED from RemoteFetchableStatus
MuazOthman Jun 11, 2022
b103ce3
Column width updates for latest runs and average duration work
pstakoun Jun 12, 2022
20d0fa9
Changes from code review
pstakoun Jun 13, 2022
1004d16
Update column widths
pstakoun Jun 13, 2022
54821d2
Update loading width
pstakoun Jun 13, 2022
4e6e6f9
Updated tooltips
MuazOthman Jun 13, 2022
3de3cdf
Added UTM params for login buttons
MuazOthman Jun 13, 2022
72f0653
Fixed a minor UX is with cloud data fetching
MuazOthman Jun 13, 2022
bd1a839
Added missing imports
MuazOthman Jun 13, 2022
e3c89b0
fix: Allow GQL variable definitions in `mountFragment`
mike-plummer Jun 13, 2022
22047ee
fixes for the GraphQL variables in remote request stitching
tgriesser Jun 13, 2022
40a8e24
Revert to full width
pstakoun Jun 13, 2022
b66bb04
unit test fixes
tgriesser Jun 13, 2022
4e4e461
Merge pull request #22288 from cypress-io/tgriesser/fix/gql-issues
MuazOthman Jun 13, 2022
e1ad458
Merge branch 'muaz/CLOUD-577-spec-list-display-latest-runs' of https:…
MuazOthman Jun 13, 2022
51fa2f0
Fixed duplicate imports
MuazOthman Jun 13, 2022
61213e1
Added E2E tests for happy path
MuazOthman Jun 14, 2022
d181a96
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 14, 2022
24da048
Merge pull request #22287 from cypress-io/mikep/CLOUD-577-fix-compone…
MuazOthman Jun 14, 2022
2ba124e
Fixes unintentinally causing other tests to break
MuazOthman Jun 14, 2022
5b1a6da
Fixed broken tests and addressed a few PR comments
MuazOthman Jun 14, 2022
b8546e7
Addressed PR comments
MuazOthman Jun 14, 2022
d80e719
Fixed tests
MuazOthman Jun 14, 2022
845941f
Merge remote-tracking branch 'origin/muaz/CLOUD-577-spec-list-display…
pstakoun Jun 14, 2022
4afc459
Update column spacing to use padding when scrollbar is visible
pstakoun Jun 14, 2022
25b3de3
Addressed a PR comment to make code easier to read
MuazOthman Jun 14, 2022
f0ce4f1
fix: attempt to fix issues w/ race condition around queries + fragmen…
tgriesser Jun 14, 2022
692cb69
Always add padding
pstakoun Jun 14, 2022
7e44f29
Merge pull request #22269 from cypress-io/peter/feat/aci-columns
pstakoun Jun 14, 2022
dff4ca6
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
tgriesser Jun 14, 2022
9ea4021
fix writeFragment / caching issue
tgriesser Jun 15, 2022
e7ea10f
Refactored E2E tests and added more scenarios
MuazOthman Jun 15, 2022
9fb0784
Add offline detection to E2E tests
MuazOthman Jun 15, 2022
52d738f
fix: Add component tests for ACI latest specs (#22318)
mike-plummer Jun 15, 2022
91c1683
fix: Update ACI tooltip content
mike-plummer Jun 15, 2022
7dfa984
Fixed UTM parameters
MuazOthman Jun 15, 2022
3003f56
Changed utm_source for login back to historical value
MuazOthman Jun 15, 2022
8223ac8
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 15, 2022
bd00d04
fix: Support 'access requested' state in cloud data tooltip
mike-plummer Jun 15, 2022
16cc5d6
Fixed a unit test
MuazOthman Jun 15, 2022
98655ae
Updated UTM params to match proposal
MuazOthman Jun 15, 2022
d72e493
Fix for E2E offline tests
MuazOthman Jun 15, 2022
2ad1c35
Merge pull request #22345 from cypress-io/mikep/CLOUD-577-tooltip-upd…
MuazOthman Jun 16, 2022
32720ba
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 16, 2022
0d8cec5
Merge branch 'muaz/CLOUD-577-spec-list-display-latest-runs' of https:…
MuazOthman Jun 16, 2022
6734541
Update ACI column behavior
pstakoun Jun 15, 2022
1f6b537
Add -- empty state for average duration
pstakoun Jun 15, 2022
a66c96b
Fix TS error
pstakoun Jun 16, 2022
46fc617
Add short header versions
pstakoun Jun 16, 2022
4000a0a
Fix tests
pstakoun Jun 16, 2022
92ec62e
Improve short header logic
pstakoun Jun 16, 2022
c18938a
Merge pull request #22357 from cypress-io/peter/feat/responsive-aci-c…
MuazOthman Jun 16, 2022
852113a
Fixed SpecsList component tests
MuazOthman Jun 16, 2022
156887e
Fixed E2E tests after updated tooltips
MuazOthman Jun 16, 2022
f6dbd3f
Fixed E2E tests
MuazOthman Jun 17, 2022
1c8c18e
More E2E fixes
MuazOthman Jun 17, 2022
508b719
Fixed unit tests and E2E test
MuazOthman Jun 17, 2022
6e93c36
fix: fix Last updated header (#22379)
pstakoun Jun 17, 2022
1a5f668
fix: make virtual-list loading more efficient (#22384)
ZachJW34 Jun 17, 2022
d8d6566
Merge remote-tracking branch 'remotes/origin/develop' into muaz/CLOUD…
MuazOthman Jun 19, 2022
616510a
fix: Preserve tree expansion state (#22347)
mike-plummer Jun 21, 2022
9523c67
fix: Restructure filename comparison so it works on Windows
mike-plummer Jun 21, 2022
4f74d66
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
mike-plummer Jun 21, 2022
d8f8b15
feat: Update ACI tooltip copy (#22427)
pstakoun Jun 21, 2022
4067c9f
fix: Address GQL runs data being lost after navigation (#22435)
mike-plummer Jun 22, 2022
4696337
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
mike-plummer Jun 22, 2022
17a37cb
fix: remove ctx.cloud.reset in tests, handle infinite loop in stale r…
tgriesser Jun 23, 2022
4247bee
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
mike-plummer Jun 23, 2022
44641ba
feat: Support "Queued" latest run status (#22497)
mike-plummer Jun 24, 2022
0390470
fix: Update "Request Access" button state after requesting access (AC…
mike-plummer Jun 24, 2022
e4b1255
Address code review findings
mike-plummer Jun 26, 2022
35275d4
Address code review findings
mike-plummer Jun 27, 2022
c1a9182
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
mike-plummer Jun 27, 2022
013385b
re: @lmiller1990 PR comments
tgriesser Jun 27, 2022
25486dd
followup on other comments
tgriesser Jun 27, 2022
ef3b9ff
Address code review comments
mike-plummer Jun 27, 2022
c3f8182
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
tgriesser Jun 27, 2022
2f17729
address comments from @marktnoonan
tgriesser Jun 27, 2022
d4ee389
Merge branch 'develop' into muaz/CLOUD-577-spec-list-display-latest-runs
tgriesser Jun 27, 2022
a874fa8
remove early return for continueAuth
tgriesser Jun 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion .vscode/cspell.json
Expand Up @@ -6,32 +6,46 @@
"words": [
"Chainable",
"composables",
"dedup",
"ERRORED",
"execa",
"Fetchable",
"Fetchables",
"forcedefault",
"getenv",
"graphcache",
"headlessui",
"Iconify",
"intlify",
"Lachlan",
"loggedin",
"msapplication",
"NOTESTS",
"OVERLIMIT",
"overscan",
"Pinia",
"pnpm",
"pseudoclass",
"revparse",
"Screenshotting",
"semibold",
"shiki",
"speclist",
"testid",
"TIMEDOUT",
"titleize",
"topnav",
"unconfigured",
"unplugin",
"unrunnable",
"unstaged",
"urql",
"viewports",
"vite",
"vitejs",
"vueuse",
"Windi"
],
"ignoreWords": [],
"import": []
}
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Expand Up @@ -28,7 +28,7 @@

// Name: Volar
// Description: Language server for Vue. Required for any syntax highlighting in Vue files.
"vue.volar",
"Vue.volar",

// Name: Code Spell Checker
// Description: Add spell-checking help to your code.
Expand Down
3 changes: 3 additions & 0 deletions graphql-codegen.yml
Expand Up @@ -67,11 +67,14 @@ generates:
- 'packages/frontend-shared/script/codegen-type-map.js'

'./packages/graphql/src/gen/cloud-source-types.gen.ts':
config:
useTypeImports: true
schema: 'packages/graphql/schemas/cloud.graphql'
plugins:
- add:
content: '/* eslint-disable */'
- 'typescript'
- 'typescript-resolvers'

###
# Generates types for us to infer the correct keys for graphcache
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -83,6 +83,7 @@
"@graphql-codegen/typed-document-node": "2.2.8",
"@graphql-codegen/typescript": "2.4.2",
"@graphql-codegen/typescript-operations": "2.2.3",
"@graphql-codegen/typescript-resolvers": "^2.6.4",
"@graphql-codegen/typescript-urql-graphcache": "2.2.3",
"@graphql-tools/delegate": "8.2.1",
"@graphql-tools/utils": "8.2.3",
Expand Down Expand Up @@ -276,4 +277,4 @@
"sharp": "0.29.3",
"vue-template-compiler": "2.6.12"
}
}
}
3 changes: 2 additions & 1 deletion packages/app/cypress.config.ts
Expand Up @@ -3,9 +3,10 @@ import getenv from 'getenv'
import { initGitRepoForTestProject, resetGitRepoForTestProject } from './cypress/tasks/git'

const CYPRESS_INTERNAL_CLOUD_ENV = getenv('CYPRESS_INTERNAL_CLOUD_ENV', process.env.CYPRESS_INTERNAL_ENV || 'development')
const CYPRESS_INTERNAL_DEV_PROJECT_ID = getenv('CYPRESS_INTERNAL_DEV_PROJECT_ID', process.env.CYPRESS_INTERNAL_DEV_PROJECT_ID || 'sehy69')

export default defineConfig({
projectId: CYPRESS_INTERNAL_CLOUD_ENV === 'staging' ? 'ypt4pf' : 'sehy69',
projectId: CYPRESS_INTERNAL_CLOUD_ENV === 'staging' ? 'ypt4pf' : CYPRESS_INTERNAL_DEV_PROJECT_ID,
retries: {
runMode: 2,
openMode: 0,
Expand Down
18 changes: 9 additions & 9 deletions packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts
Expand Up @@ -80,25 +80,25 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout:

it('redirects to the specs list with error if a spec is not found', () => {
cy.visitApp()
const { noSpecErrorTitle, noSpecErrorIntro, noSpecErrorExplainer } = defaultMessages.specPage
const { title, intro, explainer } = defaultMessages.specPage.noSpecError
const badFilePath = 'src/DoesNotExist.spec.js'

cy.visitApp(`/specs/runner?file=${badFilePath}`)
cy.contains(noSpecErrorTitle).should('be.visible')
cy.contains(noSpecErrorIntro).should('be.visible')
cy.contains(noSpecErrorExplainer).should('be.visible')
cy.contains(title).should('be.visible')
cy.contains(intro).should('be.visible')
cy.contains(explainer).should('be.visible')
cy.contains(getPathForPlatform(badFilePath)).should('be.visible')
cy.location()
.its('href')
.should('eq', 'http://localhost:4455/__/#/specs')

// should clear after reload
cy.reload()
cy.contains(noSpecErrorTitle).should('not.exist')
cy.contains(title).should('not.exist')
})

it('redirects to the specs list with error if an open spec is not found when specs list updates', () => {
const { noSpecErrorTitle, noSpecErrorIntro, noSpecErrorExplainer } = defaultMessages.specPage
const { title, intro, explainer } = defaultMessages.specPage.noSpecError

const goodFilePath = 'src/TestComponent.spec.jsx'

Expand All @@ -109,9 +109,9 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout:
cy.withCtx((ctx, o) => {
ctx.actions.project.setSpecs(ctx.project.specs.filter((spec) => !spec.absolute.includes(o.path)))
}, { path: goodFilePath }).then(() => {
cy.contains(noSpecErrorTitle).should('be.visible')
cy.contains(noSpecErrorIntro).should('be.visible')
cy.contains(noSpecErrorExplainer).should('be.visible')
cy.contains(title).should('be.visible')
cy.contains(intro).should('be.visible')
cy.contains(explainer).should('be.visible')
cy.contains(getPathForPlatform(goodFilePath)).should('be.visible')
cy.location()
.its('href')
Expand Down
18 changes: 9 additions & 9 deletions packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts
Expand Up @@ -98,13 +98,13 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout:
})

it('redirects to the specs list with error if a spec is not found when navigating', () => {
const { noSpecErrorTitle, noSpecErrorIntro, noSpecErrorExplainer } = defaultMessages.specPage
const { title, intro, explainer } = defaultMessages.specPage.noSpecError
const badFilePath = 'cypress/e2e/does-not-exist.spec.js'

cy.visitApp(`/specs/runner?file=${badFilePath}`)
cy.contains(noSpecErrorTitle).should('be.visible')
cy.contains(noSpecErrorIntro).should('be.visible')
cy.contains(noSpecErrorExplainer).should('be.visible')
cy.contains(title).should('be.visible')
cy.contains(intro).should('be.visible')
cy.contains(explainer).should('be.visible')
cy.contains(getPathForPlatform(badFilePath)).should('be.visible')
cy.location()
.its('href')
Expand All @@ -114,11 +114,11 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout:

// should clear after reload
cy.reload()
cy.contains(noSpecErrorTitle).should('not.exist')
cy.contains(title).should('not.exist')
})

it('redirects to the specs list with error if an open spec is not found when specs list updates', () => {
const { noSpecErrorTitle, noSpecErrorIntro, noSpecErrorExplainer } = defaultMessages.specPage
const { title, intro, explainer } = defaultMessages.specPage.noSpecError

const goodFilePath = 'cypress/e2e/dom-content.spec.js'

Expand All @@ -129,9 +129,9 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout:
cy.withCtx((ctx, o) => {
ctx.actions.project.setSpecs(ctx.project.specs.filter((spec) => !spec.absolute.includes(o.path)))
}, { path: goodFilePath }).then(() => {
cy.contains(noSpecErrorTitle).should('be.visible')
cy.contains(noSpecErrorIntro).should('be.visible')
cy.contains(noSpecErrorExplainer).should('be.visible')
cy.contains(title).should('be.visible')
cy.contains(intro).should('be.visible')
cy.contains(explainer).should('be.visible')
cy.contains(getPathForPlatform(goodFilePath)).should('be.visible')
cy.location()
.its('href')
Expand Down
4 changes: 2 additions & 2 deletions packages/app/cypress/e2e/reporter_header.cy.ts
Expand Up @@ -13,7 +13,7 @@ describe('Reporter Header', () => {
cy.get('body').type('f')

cy.get('[data-selected-spec="true"]').should('contain', 'dom-content').should('have.length', '1')
cy.get('[data-selected-spec="false"]').should('have.length', '18')
cy.get('[data-selected-spec="false"]').should('have.length', '27')
})

it('filters the list of specs when searching for specs', () => {
Expand All @@ -26,7 +26,7 @@ describe('Reporter Header', () => {

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

cy.get('[data-cy="spec-file-item"]').should('have.length', '3')
mike-plummer marked this conversation as resolved.
Show resolved Hide resolved
cy.get('[data-cy="spec-file-item"]').should('have.length', 3)

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

Expand Down
9 changes: 5 additions & 4 deletions packages/app/cypress/e2e/runs.cy.ts
Expand Up @@ -10,7 +10,7 @@ function scaffoldTestingTypeAndVisitRunsPage (testingType: 'e2e' | 'component')

// make sure there are no runs found for the project ID
cy.remoteGraphQLIntercept(async (obj) => {
if (obj.result.data?.cloudProjectBySlug) {
if (obj.result.data?.cloudProjectBySlug?.runs?.nodes) {
obj.result.data.cloudProjectBySlug.runs.nodes = []
}

Expand Down Expand Up @@ -136,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 Down Expand Up @@ -597,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 @@ -610,7 +608,10 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
return obj.result
})

cy.visitApp()

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

cy.contains('h2', 'Cannot connect to the Cypress Dashboard')
cy.percySnapshot()

Expand Down
3 changes: 2 additions & 1 deletion packages/app/cypress/e2e/sidebar_navigation.cy.ts
Expand Up @@ -221,7 +221,8 @@ describe('Sidebar Navigation', () => {

it('has a menu item labeled "Runs" which takes you to the Runs page', () => {
cy.get('[data-cy="app-header-bar"]').findByText('Runs').should('not.exist')
cy.findByText('Runs').should('be.visible').click()

cy.findByTestId('sidebar-link-runs-page').should('have.text', 'Runs').should('be.visible').click()
cy.get('[data-cy="app-header-bar"]').findByText('Runs').should('be.visible')
cy.get('.router-link-active').findByText('Runs').should('be.visible')
})
Expand Down
14 changes: 6 additions & 8 deletions packages/app/cypress/e2e/specs_list_e2e.cy.ts
Expand Up @@ -112,19 +112,19 @@ describe('App: Spec List (E2E)', () => {

describe('typing the filter', function () {
it('displays only matching spec', function () {
cy.get('button').contains('14 Matches')
cy.get('button').contains('23 Matches')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for another day, but every time we touch these tests we have to update a lot of numbers, I wonder if we can either derive them from from our own fixtures, or just move them into constants.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd add a task that fetches the correct number, if we do want to address this one in the future.

cy.findByLabelText('Search Specs').type('content')
cy.get('[data-cy="spec-item"]')
.should('have.length', 2)
.and('contain', 'dom-content.spec.js')

cy.get('button').contains('2 of 14 Matches')
cy.get('button').contains('2 of 23 Matches')

cy.findByLabelText('Search Specs').clear().type('asdf')
cy.get('[data-cy="spec-item"]')
.should('have.length', 0)

cy.get('button').contains('0 of 14 Matches')
cy.get('button').contains('0 of 23 Matches')
})

it('only shows matching folders', () => {
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('App: Spec List (E2E)', () => {
.should('have.value', '')

cy.get('[data-cy="spec-item"]')
.should('have.length', 14)
.should('have.length', 23)
})

it('clears the filter if the user presses ESC key', function () {
Expand All @@ -187,8 +187,7 @@ describe('App: Spec List (E2E)', () => {
cy.findByLabelText('Search Specs')
.should('have.value', '')

cy.get('[data-cy="spec-item"]')
.should('have.length', 14)
cy.get('button').contains('23 Matches')
})

it('shows empty message if no results', function () {
Expand All @@ -203,8 +202,7 @@ describe('App: Spec List (E2E)', () => {
cy.findByText('Clear Search').click()
cy.focused().should('have.id', 'spec-filter')

cy.get('[data-cy="spec-item"]')
.should('have.length', 14)
cy.get('button').contains('23 Matches')
})

//TODO: https://cypress-io.atlassian.net/browse/UNIFY-1588
Expand Down