Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 authored Jun 27, 2022
2 parents 9c4aefa + 9101a90 commit 56d8d26
Show file tree
Hide file tree
Showing 157 changed files with 6,971 additions and 1,753 deletions.
16 changes: 15 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
47 changes: 39 additions & 8 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,14 +528,45 @@ commands:
browser: <<parameters.browser>>
- run:
command: |
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
echo Current working directory is $PWD
echo Total containers $CIRCLE_NODE_TOTAL
if [[ -v MAIN_RECORD_KEY ]]; then
# internal PR
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
else
# external PR
# To make `circleci tests` work correctly, we need to step into the package folder.
cd packages/<<parameters.package>>
GLOB="cypress/e2e/**/*cy.*"
if [[ <<parameters.type>> == 'ct' ]]; then
# component tests are located side by side with the source codes.
GLOB="src/**/*cy.*"
fi
TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
echo "Test files for this machine are $TESTFILES"
# To run the `yarn` command, we need to walk out of the package folder.
cd ../..
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --spec $TESTFILES
fi
- run:
command: |
if [[ <<parameters.package>> == 'app' && <<parameters.percy>> == 'true' && -d "packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions graphql-codegen.yml
Original file line number Diff line number Diff line change
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
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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
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 @@ -196,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 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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')
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/specs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('App: Specs', () => {

const expectedScaffoldPathsForPlatform = expectedScaffoldPaths.map(getPathForPlatform)

it('scaffolds example files when card is clicked', () => {
it('scaffolds example files when card is clicked', { viewportHeight: 1200 }, () => {
cy.get('@ScaffoldCard').click()

cy.findByRole('dialog', {
Expand Down
Loading

0 comments on commit 56d8d26

Please sign in to comment.