Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into zachw/issue-22525
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 committed Jul 19, 2022
2 parents 56f5d69 + 1da95a7 commit 7a65ef8
Show file tree
Hide file tree
Showing 17 changed files with 163 additions and 76 deletions.
11 changes: 4 additions & 7 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ macWorkflowFilters: &darwin-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- equal: [ 'zachw/issue-22525', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
Expand All @@ -46,7 +45,6 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -65,7 +63,6 @@ windowsWorkflowFilters: &windows-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -658,7 +655,7 @@ commands:
## by default, assert that at least 1 test ran
default: 0
steps:
- run:
- run:
name: 'Verify Mocha Results'
command: |
source ./scripts/ensure-node.sh
Expand Down Expand Up @@ -1614,7 +1611,7 @@ jobs:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
- store-npm-logs

run-vite-dev-server-integration-tests:
<<: *defaults
Expand All @@ -1636,7 +1633,7 @@ jobs:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
- store-npm-logs

ui-components-integration-tests:
<<: *defaults
Expand Down Expand Up @@ -2363,7 +2360,7 @@ linux-x64-workflow: &linux-x64-workflow
- run-vite-dev-server-integration-tests:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- system-tests-node-modules-install
- system-tests-node-modules-install
- run-app-component-tests-chrome:
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
percy: true
Expand Down
6 changes: 6 additions & 0 deletions cli/lib/exec/open.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const { exitWithError } = require('../errors')
* @returns {string[]} list of CLI arguments
*/
const processOpenOptions = (options = {}) => {
// In addition to setting the project directory, setting the project option
// here ultimately decides whether cypress is run in global mode or not.
// It's first based off whether it's installed globally by npm/yarn (-g).
// A global install can be overridden by the --project flag, putting Cypress
// in project mode. A non-global install can be overridden by the --global
// flag, putting it in global mode.
if (!util.isInstalledGlobally() && !options.global && !options.project) {
options.project = process.cwd()
}
Expand Down
6 changes: 3 additions & 3 deletions packages/app/cypress/e2e/specs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('App: Specs', () => {
}).should('be.visible').within(() => {
cy.validateExternalLink({ name: 'Need help', href: 'https://on.cypress.io/test-type-options' })
cy.findByRole('button', { name: 'Close' }).should('be.visible').as('CloseDialogButton')
cy.get('[data-cy="file-match-indicator"]').contains('0 Matches')
cy.get('[data-cy="file-match-indicator"]').contains('No Matches')
cy.get('[data-cy="spec-pattern"]').contains('cypress/e2e/**/*.cy.{js,jsx,ts,tsx}')
})

Expand Down Expand Up @@ -320,7 +320,7 @@ describe('App: Specs', () => {
.should('be.visible')
.and('contain', defaultMessages.createSpec.page.customPatternNoSpecs.description.split('{0}')[0])

cy.findByTestId('file-match-indicator').should('contain', '0 Matches')
cy.findByTestId('file-match-indicator').should('contain', 'No Matches')
cy.findByRole('button', { name: 'cypress.config.js' })
cy.findByTestId('spec-pattern').should('contain', 'src/**/*.{cy,spec}.{js,jsx}')

Expand Down Expand Up @@ -652,7 +652,7 @@ describe('App: Specs', () => {
.should('be.visible')
.and('contain', defaultMessages.createSpec.page.customPatternNoSpecs.description.split('{0}')[0])

cy.findByTestId('file-match-indicator').should('contain', '0 Matches')
cy.findByTestId('file-match-indicator').should('contain', 'No Matches')
cy.findByRole('button', { name: 'cypress.config.js' })
cy.findByTestId('spec-pattern').should('contain', 'src/specs-folder/*.cy.{js,jsx}')

Expand Down
34 changes: 33 additions & 1 deletion packages/app/src/components/SpecPatterns.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('<SpecPatterns />', () => {
cy.get('[data-cy="file-match-indicator"]').contains('50 Matches')
})

it('renders component spec pattern should not show matches', () => {
it('renders component spec pattern should not show matches verbiage', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
Expand All @@ -46,4 +46,36 @@ describe('<SpecPatterns />', () => {
cy.get('[data-cy="spec-pattern"]').contains('**/*.cy.{js,jsx,ts,tsx}')
cy.get('[data-cy="file-match-indicator"]').should('contain', 'specPattern')
})

it('displays `No Matches` when specs are empty', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
return
}

res.currentTestingType = 'component'
res.specs = []
},
render: (gql) => <div class="p-16px"><SpecPatterns gql={gql}/></div>,
})

cy.get('[data-cy="file-match-indicator"]').contains('No Matches')
})

it('displays `1 Match` when specs has 1 element', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
return
}

res.currentTestingType = 'component'
res.specs = res.specs.slice(0, 1) || []
},
render: (gql) => <div class="p-16px"><SpecPatterns gql={gql}/></div>,
})

cy.get('[data-cy="file-match-indicator"]').contains('1 Match')
})
})
10 changes: 3 additions & 7 deletions packages/app/src/components/SpecPatterns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
<div class="flex p-16px items-center justify-between">
<FileMatchIndicator :variant="props.variant">
<span v-if="props.variant === 'info'">specPattern</span>
<i18n-t
v-else
scope="global"
keypath="components.specPattern.matches"
>
{{ props.gql.specs.length }}
</i18n-t>
<span v-else>{{ t('components.specPattern.matches', props.gql.specs.length) }}</span>
</FileMatchIndicator>
<OpenConfigFileInIDE
v-slot="{onClick}"
Expand Down Expand Up @@ -41,6 +35,7 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { gql } from '@urql/core'
import { useI18n } from 'vue-i18n'
import type { SpecPatternsFragment } from '../generated/graphql'
import OpenConfigFileInIDE from '@packages/frontend-shared/src/gql-components/OpenConfigFileInIDE.vue'
import FileMatchIndicator from './FileMatchIndicator.vue'
Expand All @@ -58,6 +53,7 @@ fragment SpecPatterns on CurrentProject {
}
`
const { t } = useI18n()
const props = defineProps<{
gql: SpecPatternsFragment
variant?: 'default' | 'info'
Expand Down
Loading

3 comments on commit 7a65ef8

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7a65ef8 Jul 19, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.1/linux-x64/zachw/issue-22525-7a65ef80e1b2fd15f0abb743d53d80b61e9a1cdc/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7a65ef8 Jul 19, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-arm64/zachw/issue-22525-7a65ef80e1b2fd15f0abb743d53d80b61e9a1cdc/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7a65ef8 Jul 19, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-x64/zachw/issue-22525-7a65ef80e1b2fd15f0abb743d53d80b61e9a1cdc/cypress.tgz

Please sign in to comment.