Skip to content

Commit afdabc2

Browse files
authored
Merge branch '10.0-release' into alejandro/fix/scaffold-correct-config-file
2 parents e99b8d3 + d307abe commit afdabc2

File tree

13 files changed

+68
-44
lines changed

13 files changed

+68
-44
lines changed

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

+21
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ describe('App: Settings', () => {
2424
cy.findByText('Project ID').should('be.visible')
2525
})
2626

27+
it('shows the recordKeys section', () => {
28+
cy.loginUser()
29+
30+
cy.visitApp()
31+
cy.findByText('Settings').click()
32+
cy.findByText('Project Settings').click()
33+
cy.findByText('Record Key').should('be.visible')
34+
})
35+
36+
it('opens cloud settings when clicking on "Manage Keys"', () => {
37+
cy.loginUser()
38+
cy.intercept('mutation-ExternalLink_OpenExternal', { 'data': { 'openExternal': true } }).as('OpenExternal')
39+
cy.visitApp()
40+
cy.findByText('Settings').click()
41+
cy.findByText('Project Settings').click()
42+
cy.findByText('Manage Keys').click()
43+
cy.wait('@OpenExternal')
44+
.its('request.body.variables.url')
45+
.should('equal', 'http:/test.cloud/cloud-project/settings')
46+
})
47+
2748
it('can reconfigure a project', () => {
2849
cy.visitApp('settings')
2950

packages/app/src/pages/Specs/Runner.vue

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
<template>
2-
<!--
3-
Run Mode is a more minimal UI.
4-
It does not render things like the SpecList,
5-
Side and Top Nav, etc.
6-
It also has no GraphQL dependency.
7-
-->
8-
<SpecRunnerContainerRunMode
9-
v-if="isRunMode"
10-
:run-mode-specs="specs"
11-
/>
12-
13-
<!--
14-
Open Mode is the full Cypress runner UI -
15-
including things like the SpecList,
16-
Side and Top Nav, Selector Playgroundn etc.
17-
It is driven by GraphQL and urql.
18-
-->
19-
<SpecRunnerContainerOpenMode
20-
v-else-if="query.data.value?.currentProject?.specs"
21-
:gql="query.data.value"
22-
/>
2+
<div>
3+
<!--
4+
Run Mode is a more minimal UI.
5+
It does not render things like the SpecList,
6+
Side and Top Nav, etc.
7+
It also has no GraphQL dependency.
8+
-->
9+
<SpecRunnerContainerRunMode
10+
v-if="isRunMode"
11+
:run-mode-specs="specs"
12+
/>
13+
14+
<!--
15+
Open Mode is the full Cypress runner UI -
16+
including things like the SpecList,
17+
Side and Top Nav, Selector Playgroundn etc.
18+
It is driven by GraphQL and urql.
19+
-->
20+
<SpecRunnerContainerOpenMode
21+
v-else-if="query.data.value?.currentProject?.specs"
22+
:gql="query.data.value"
23+
/>
24+
</div>
2325
</template>
2426

2527
<script lang="ts" setup>

packages/app/src/runner/unifiedRunner.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function useUnifiedRunner () {
1515

1616
onBeforeUnmount(() => {
1717
UnifiedRunnerAPI.teardown()
18+
initialized.value = false
1819
})
1920

2021
return {

packages/app/src/settings/project/ProjectSettings.vue

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
v-for="key of props.gql.currentProject.cloudProject.recordKeys"
99
:key="key.id"
1010
:gql="key"
11+
:manage-keys-url="props.gql.currentProject.cloudProject.cloudProjectSettingsUrl"
1112
/>
1213
</template>
1314
<SpecPatterns :gql="props.gql.currentProject" />
@@ -34,6 +35,7 @@ fragment ProjectSettings on Query {
3435
__typename
3536
... on CloudProject {
3637
id
38+
cloudProjectSettingsUrl
3739
recordKeys {
3840
id
3941
...RecordKey

packages/app/src/settings/project/RecordKey.cy.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('<RecordKey />', () => {
1212
},
1313
render: (gql) => (
1414
<div class="py-4 px-8">
15-
<RecordKey gql={gql} />
15+
<RecordKey gql={gql} manageKeysUrl="http://project.cypress.io/settings" />
1616
</div>
1717
),
1818
})

packages/app/src/settings/project/RecordKey.vue

+12-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</template>
2121
<div
2222
v-if="recordKey"
23-
class="inline-flex justify-start gap-10px"
23+
class="gap-10px inline-flex justify-start"
2424
>
2525
<CodeBox
2626
:code="recordKey"
@@ -45,16 +45,19 @@
4545

4646
<script lang="ts" setup>
4747
import { computed, ref } from 'vue'
48-
import { useI18n } from '@cy/i18n'
49-
import type { RecordKeyFragment } from '../../generated/graphql'
50-
import SettingsSection from '../SettingsSection.vue'
48+
import { gql } from '@urql/core'
5149
import Button from '@cy/components/Button.vue'
50+
import CopyButton from '@cy/components/CopyButton.vue'
51+
import ExternalLink from '@cy/gql-components/ExternalLink.vue'
52+
import { useExternalLink } from '@cy/gql-components/useExternalLink'
5253
import IconKey from '~icons/cy/placeholder_x16.svg'
5354
import IconExport from '~icons/cy/export_x16.svg'
54-
import { gql } from '@urql/core'
55-
import CopyButton from '@cy/components/CopyButton.vue'
55+
import type { RecordKeyFragment } from '../../generated/graphql'
56+
import SettingsSection from '../SettingsSection.vue'
5657
import CodeBox from './CodeBox.vue'
57-
import ExternalLink from '@packages/frontend-shared/src/gql-components/ExternalLink.vue'
58+
import { useI18n } from '@cy/i18n'
59+
60+
const { t } = useI18n()
5861
5962
gql`
6063
fragment RecordKey on CloudRecordKey {
@@ -65,11 +68,10 @@ fragment RecordKey on CloudRecordKey {
6568
6669
const props = defineProps<{
6770
gql: RecordKeyFragment
71+
manageKeysUrl: string
6872
}>()
6973
70-
const openManageKeys = () => { }
71-
const showRecordKey = ref(false)
72-
const { t } = useI18n()
74+
const openManageKeys = useExternalLink(props.manageKeysUrl)
7375
7476
const recordKey = computed(() => props.gql.key)
7577
</script>

packages/data-context/src/actions/ProjectActions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export class ProjectActions {
305305
throw Error(`Cannot save preferences without currentProject.`)
306306
}
307307

308-
this.api.insertProjectPreferencesToCache(this.ctx.lifecycleManager.projectTitle, { ...args })
308+
this.api.insertProjectPreferencesToCache(this.ctx.lifecycleManager.projectTitle, args)
309309
}
310310

311311
async codeGenSpec (codeGenCandidate: string, codeGenType: CodeGenType): Promise<NexusGenObjects['ScaffoldedFile']> {

packages/graphql/schemas/schema.graphql

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ type Mutation {
685685
setProjectIdInConfigFile(projectId: String!): Query
686686

687687
"""Save the projects preferences to cache"""
688-
setProjectPreferences(browserPath: String!, testingType: TestingTypeEnum!): Query!
688+
setProjectPreferences(testingType: TestingTypeEnum!): Query!
689689

690690
"""Save the prompt-shown state for this project"""
691691
setPromptShown(slug: String!): Boolean

packages/graphql/src/schemaTypes/objectTypes/gql-Mutation.ts

-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ export const mutation = mutationType({
316316
description: 'Save the projects preferences to cache',
317317
args: {
318318
testingType: nonNull(TestingTypeEnum),
319-
browserPath: nonNull(stringArg()),
320319
},
321320
async resolve (_, args, ctx) {
322321
await ctx.actions.project.setProjectPreferences(args)

packages/launchpad/cypress/e2e/choose-a-browser.cy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ describe('Choose a Browser Page', () => {
114114
cy.get('@launchButton').click()
115115

116116
cy.wait('@launchProject').then(({ request }) => {
117-
expect(request?.body.variables.browserPath).to.contain('/test/chrome/path')
118117
expect(request?.body.variables.testingType).to.eq('e2e')
119118
})
120119
})

packages/launchpad/src/setup/OpenBrowser.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ mutation OpenBrowser_ClearTestingType {
5555
`
5656
5757
gql`
58-
mutation OpenBrowser_LaunchProject ($testingType: TestingTypeEnum!, $browserPath: String!) {
58+
mutation OpenBrowser_LaunchProject ($testingType: TestingTypeEnum!) {
5959
launchOpenProject {
6060
id
6161
}
6262
# Removing for now until we decide what the behavior should be
6363
# hideBrowserWindow
64-
setProjectPreferences(testingType: $testingType, browserPath: $browserPath) {
64+
setProjectPreferences(testingType: $testingType) {
6565
currentProject {
6666
id
6767
title
@@ -73,12 +73,11 @@ mutation OpenBrowser_LaunchProject ($testingType: TestingTypeEnum!, $browserPath
7373
const launchOpenProject = useMutation(OpenBrowser_LaunchProjectDocument)
7474
const clearCurrentTestingType = useMutation(OpenBrowser_ClearTestingTypeDocument)
7575
76-
const launch = (browserPath?: string) => {
76+
const launch = () => {
7777
const testingType = query.data.value?.currentTestingType
7878
79-
if (browserPath && testingType) {
79+
if (testingType) {
8080
launchOpenProject.executeMutation({
81-
browserPath,
8281
testingType,
8382
})
8483
}

packages/launchpad/src/setup/OpenBrowserList.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<form
33
v-if="browsers"
4-
@submit.prevent="emit('launch', props.gql?.currentBrowser?.path)"
4+
@submit.prevent="emit('launch')"
55
>
66
<div
77
class="flex flex-wrap py-40px gap-24px justify-center"
@@ -130,7 +130,7 @@ const props = defineProps<{
130130
131131
const emit = defineEmits<{
132132
(e: 'navigated-back'): void
133-
(e: 'launch', value: string | undefined): void
133+
(e: 'launch'): void
134134
}>()
135135
136136
const { t } = useI18n()

packages/types/src/cache.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export interface Cache {
55
}
66

77
export interface Preferences {
8-
browserPath: string | null
98
testingType: 'e2e' | 'component' | null
109
}
1110

0 commit comments

Comments
 (0)