Skip to content

Commit

Permalink
Merge branch '10.0-release' into tgriesser/chore/e2e-data-clean-refactor
Browse files Browse the repository at this point in the history
* 10.0-release:
  feat(graphql): ability to update/query for appData (#19082)
  fix system test
  fix failing tests due to merge
  resolve conflicts
  test: node_modules installs for system-tests, other improvements (#18574)
  update yarn.lock
  chore(deps): update dependency semantic-release to v17.2.3 [security] (#19022)
  chore: remove flaky ci jobs for main builds (#19071)
  chore(contributing): clarify PULL_REQUEST_TEMPLATE (#19068)
  fix: the shadow root container element is ignored when clicking an element in it. (#18908)
  'Fix' flaky redirect test (#19042)
  release 9.1.0 [skip ci]
  fix: Allow 'this' to be used in overridden commands (#18899)
  fix(react): link to rerender example (#19020)
  chore(deps): update dependency aws-sdk to v2.814.0 [security] (#18948)
  fix: test config overrides leak for .only execution (#18961)
  feat: Set CYPRESS=true as env var in child processes where Cypress runs user code in Node (#18981)
  fix: Restore broken gif (#18987)
  chore: release @cypress/vite-dev-server-v2.2.1
  • Loading branch information
tgriesser committed Nov 29, 2021
2 parents c519e7d + cc3be10 commit d79a5b7
Show file tree
Hide file tree
Showing 124 changed files with 7,810 additions and 2,269 deletions.
14 changes: 10 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
- Closes <!-- link to the issue here, if there is one -->

### User facing changelog
<!-- Explain the change(s) for every user to read in our changelog. Examples: https://on.cypress.io/changelog -->
<!--
Explain the change(s) for every user to read in our changelog. Examples: https://on.cypress.io/changelog
If the change is not user-facing, write "n/a".
-->

### Additional details
<!-- Examples:
Expand All @@ -22,11 +25,14 @@
Screenshots or GIFs are preferred. -->

### PR Tasks
<!-- These tasks must be completed before a PR is merged.
Delete tasks if they are not applicable. -->
<!--
These tasks must be completed before a PR is merged.
If a task does not apply, write [na] instead of checking the box.
DO NOT DELETE the PR checklist.
-->

- [ ] Have tests been added/updated?
- [ ] Has the original issue or this PR been tagged with a release in ZenHub? <!-- (internal team only)-->
- [ ] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
- [ ] Has a PR for user-facing changes been opened in [`cypress-documentation`](https://github.com/cypress-io/cypress-documentation)? <!-- Link to PR here -->
- [ ] Have API changes been updated in the [`type definitions`](https://github.com/cypress-io/cypress/blob/develop/cli/types/cypress.d.ts)?
- [ ] Have new configuration options been added to the [`cypress.schema.json`](https://github.com/cypress-io/cypress/blob/develop/cli/schema/cypress.schema.json)?
86 changes: 67 additions & 19 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,55 @@ commands:
name: Restore all node_modules to proper workspace folders
command: node scripts/circle-cache.js --action unpack

restore_cached_system_tests_deps:
description: 'Restore the cached node_modules for projects in "system-tests/projects/**"'
steps:
- run:
name: Generate Circle Cache key for system tests
command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key
- restore_cache:
name: Restore system tests node_modules cache
keys:
- v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
- v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-

update_cached_system_tests_deps:
description: 'Update the cached node_modules for projects in "system-tests/projects/**"'
steps:
- run:
name: Generate Circle Cache key for system tests
command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key
- restore_cache:
name: Restore cache state, to check for known modules cache existence
keys:
- v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }}
- run:
name: Bail if specific cache exists
command: |
if [[ -f "system_tests_node_modules_installed" ]]; then
echo "No updates to system tests node modules, exiting"
circleci-agent step halt
fi
- restore_cache:
name: Restore system tests node_modules cache
keys:
- v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
- v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-
- run:
name: Update system-tests node_modules cache
command: yarn workspace @tooling/system-tests projects:yarn:install
- save_cache:
name: Save system tests node_modules cache
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
paths:
- ~/.cache/cy-system-tests-node-modules
- run: touch system_tests_node_modules_installed
- save_cache:
name: Save system tests node_modules cache state key
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }}
paths:
- system_tests_node_modules_installed

caching-dependency-installer:
description: 'Installs & caches the dependencies based on yarn lock & package json dependencies'
parameters:
Expand Down Expand Up @@ -468,6 +517,7 @@ commands:
type: string
steps:
- restore_cached_workspace
- restore_cached_system_tests_deps
- run:
name: Run system tests
command: |
Expand Down Expand Up @@ -1154,6 +1204,12 @@ jobs:
path: /tmp/artifacts
- store-npm-logs

system-tests-node-modules-install:
<<: *defaults
steps:
- restore_cached_workspace
- update_cached_system_tests_deps

system-tests-chrome:
<<: *defaults
resource_class: medium
Expand Down Expand Up @@ -1991,17 +2047,6 @@ jobs:
repo: cypress-example-todomvc
browser: firefox

"test-binary-against-documentation-firefox":
<<: *defaults
resource_class: medium
steps:
- test-binary-against-repo:
repo: cypress-documentation
browser: firefox
command: "yarn cypress run"
wait-on: http://localhost:3000
server-start-command: yarn serve:dist

"test-binary-against-conduit-chrome":
<<: *defaults
resource_class: medium
Expand Down Expand Up @@ -2136,19 +2181,22 @@ linux-workflow: &linux-workflow
- server-performance-tests:
requires:
- build
- system-tests-chrome:
- system-tests-node-modules-install:
requires:
- build
- system-tests-chrome:
requires:
- system-tests-node-modules-install
- system-tests-electron:
requires:
- build
- system-tests-node-modules-install
- system-tests-firefox:
requires:
- build
- system-tests-node-modules-install
- system-tests-non-root:
executor: non-root-docker-user
requires:
- build
- system-tests-node-modules-install
- driver-integration-tests-chrome:
requires:
- build
Expand Down Expand Up @@ -2368,16 +2416,16 @@ linux-workflow: &linux-workflow

- test-binary-against-kitchensink-chrome:
<<: *onlyMainBranches
- test-binary-against-conduit-chrome:
<<: *onlyMainBranches
# Re-enable when the cypress-example-conduit-app project is fixed.
# https://github.com/cypress-io/cypress-example-conduit-app/issues/346
# - test-binary-against-conduit-chrome:
# <<: *onlyMainBranches
- test-binary-against-recipes-firefox:
<<: *onlyMainBranches
- test-binary-against-kitchensink-firefox:
<<: *onlyMainBranches
- test-binary-against-todomvc-firefox:
<<: *onlyMainBranches
- test-binary-against-documentation-firefox:
<<: *onlyMainBranches
- test-binary-against-api-testing-firefox:
<<: *onlyMainBranches
- test-binary-against-piechopper-firefox:
Expand Down
Binary file modified npm/create-cypress-tests/demo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion npm/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Spec | Description
[css modules](cypress/component/basic/css-modules) | Shows that component that using css modules styles works
[network](cypress/component/basic/network) | Confirms we can use `cy.route` to stub / spy on component's network calls
[no-visit](cypress/component/basic/no-visit) | Component specs cannot call `cy.visit`
[re-render](cypress/component/basic/re-render) | Checking how the component re-renders when its props change
[rerender](cypress/component/basic/rerender) | Checking how the component re-renders when its props change
[react-book-by-chris-noring](cypress/component/basic/react-book-by-chris-noring) | Copied test examples from [React Book](https://softchris.github.io/books/react) and adapted for Cypress component tests
[react-tutorial](cypress/component/basic/react-tutorial) | Tests from official [ReactJS tutorial](https://reactjs.org/tutorial/tutorial.html) copied and adapted for Cypress component tests
[stub-example](cypress/component/basic/stub-example) | Uses `cy.stub` as component props
Expand Down
7 changes: 7 additions & 0 deletions npm/vite-dev-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [@cypress/vite-dev-server-v2.2.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.2.0...@cypress/vite-dev-server-v2.2.1) (2021-11-19)


### Bug Fixes

* compile npm packages for node 12 ([#18989](https://github.com/cypress-io/cypress/issues/18989)) ([30b3eb2](https://github.com/cypress-io/cypress/commit/30b3eb2376bc1ed69087ba96f60448687e8489e6))

# [@cypress/vite-dev-server-v2.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.1...@cypress/vite-dev-server-v2.2.0) (2021-10-15)


Expand Down
10 changes: 9 additions & 1 deletion npm/webpack-preprocessor/lib/typescript-overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ export const overrideSourceMaps = (sourceMap: boolean, typescriptPath?: string)
return
}

const typescript = require(typescriptPath || 'typescript') as typeof import('typescript')
// when using webpack-preprocessor as a local filesystem dependency (`file:...`),
// require(typescript) will resolve to this repo's `typescript` devDependency, not the
// targeted project's `typescript`, which breaks monkeypatching. resolving from the
// CWD avoids this issue.
const projectTsPath = require.resolve(typescriptPath || 'typescript', {
paths: [process.cwd()],
})

const typescript = require(projectTsPath) as typeof import('typescript')
const { createProgram } = typescript

debug('typescript found, overriding typescript.createProgram()')
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 @@ -53,7 +53,7 @@
"react": "16.13.1",
"react-dom": "16.13.1",
"react-scripts": "3.2",
"semantic-release": "17.0.4",
"semantic-release": "17.2.3",
"shx": "0.3.3",
"sinon": "^9.0.0",
"sinon-chai": "^3.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('./lib/typescript-overrides', () => {
const err = typescriptOverrides.overrideSourceMaps(true)

expect(err).to.be.instanceOf(Error)
expect(err.message).to.eq(`Cannot find module 'typescript'`)
expect(err.message).to.match(/Cannot find module '.*typescript\.js'/)
})
})
})
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "9.0.0",
"version": "9.1.0",
"description": "Cypress.io end to end testing tool",
"private": true,
"scripts": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"npm-release": "node scripts/npm-release.js",
"prestart": "yarn ensure-deps",
"start": "cypress open --dev --global",
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude e2e.ts,cypress-tests.ts",
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude e2e.ts,cypress-tests.ts,*only_spec.js",
"stop-only-all": "yarn stop-only --folder packages",
"pretest": "yarn ensure-deps",
"test": "yarn lerna exec yarn test --scope cypress --scope \"'@packages/{config,electron,extension,https-proxy,launcher,net-stubbing,network,proxy,rewriter,runner,runner-shared,socket}'\"",
Expand Down Expand Up @@ -126,7 +126,7 @@
"arg": "4.1.2",
"ascii-table": "0.0.9",
"autobarrel": "^1.1.0",
"aws-sdk": "2.447.0",
"aws-sdk": "2.814.0",
"babel-eslint": "10.1.0",
"bluebird": "3.5.3",
"bluebird-retry": "0.11.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/runner/SpecRunner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

<script lang="ts" setup>
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { useI18n } from '@cy/i18n'
import { REPORTER_ID, RUNNER_ID, getRunnerElement, getReporterElement, empty } from '../runner/utils'
import { gql } from '@urql/core'
import InlineSpecList from '../specs/InlineSpecList.vue'
Expand Down Expand Up @@ -103,7 +102,6 @@ const eventManager = getEventManager()
const autStore = useAutStore()
const screenshotStore = useScreenshotStore()
const runnerUiStore = useRunnerUiStore()
const { t } = useI18n()
const runnerPane = ref<HTMLDivElement>()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/settings/SettingsContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mutation SettingsContainer_ReconfigureProject($testingType: TestingTypeEnum!) {
gql`
fragment SettingsContainer on Query {
... TestingPreferences
...TestingPreferences
currentProject {
id
...ProjectSettings
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/settings/device/ExternalEditorSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import { useMutation } from '@urql/vue'
gql`
mutation ExternalEditorSettings_SetPreferredEditorBinary ($value: String!) {
setPreferredEditorBinary (value: $value)
setPreferences (value: $value)
}`
const { t } = useI18n()
const setPreferredBinaryEditor = useMutation(ExternalEditorSettings_SetPreferredEditorBinaryDocument)
function handleChoseEditor (binary: string) {
setPreferredBinaryEditor.executeMutation({ value: binary })
setPreferredBinaryEditor.executeMutation({ value: JSON.stringify({ preferredEditorBinary: binary }) })
}
gql`
Expand Down
31 changes: 11 additions & 20 deletions packages/app/src/settings/device/TestingPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class="mx-8px"
:value="props.gql.localSettings.preferences[pref.id] ?? false"
:name="pref.title"
@update="(value) => pref.mutation.executeMutation({ value })"
@update="(value) => updatePref(pref.id, value)"
/>
</h4>
<p class="text-size-14px leading-24px text-gray-600">
Expand All @@ -37,9 +37,7 @@ import { useI18n } from '@cy/i18n'
import Switch from '@packages/frontend-shared/src/components/Switch.vue'
import { gql, useMutation } from '@urql/vue'
import {
SetAutoScrollingEnabledDocument,
SetUseDarkSidebarDocument,
SetWatchForSpecChangeDocument,
SetTestingPreferencesDocument,
} from '@packages/data-context/src/gen/all-operations.gen'
import type { TestingPreferencesFragment } from '../../generated/graphql'
Expand All @@ -58,43 +56,36 @@ fragment TestingPreferences on Query {
`
gql`
mutation SetAutoScrollingEnabled($value: Boolean!) {
setAutoScrollingEnabled(value: $value) {
autoScrollingEnabled
}
}`
gql`
mutation SetUseDarkSidebar($value: Boolean!) {
setUseDarkSidebar(value: $value)
mutation SetTestingPreferences($value: String!) {
setPreferences (value: $value)
}`
gql`
mutation SetWatchForSpecChange($value: Boolean!) {
setWatchForSpecChange(value: $value)
}`
const setPreferences = useMutation(SetTestingPreferencesDocument)
const prefs = [
{
id: 'autoScrollingEnabled',
title: t('settingsPage.testingPreferences.autoScrollingEnabled.title'),
mutation: useMutation(SetAutoScrollingEnabledDocument),
description: t('settingsPage.testingPreferences.autoScrollingEnabled.description'),
},
{
id: 'useDarkSidebar',
title: t('settingsPage.testingPreferences.useDarkSidebar.title'),
mutation: useMutation(SetUseDarkSidebarDocument),
description: t('settingsPage.testingPreferences.useDarkSidebar.description'),
},
{
id: 'watchForSpecChange',
title: t('settingsPage.testingPreferences.watchForSpecChange.title'),
mutation: useMutation(SetWatchForSpecChangeDocument),
description: t('settingsPage.testingPreferences.watchForSpecChange.description'),
},
] as const
function updatePref (preferenceId: typeof prefs[number]['id'], value: boolean) {
setPreferences.executeMutation({
value: JSON.stringify({ [preferenceId]: value }),
})
}
const props = defineProps<{
gql: TestingPreferencesFragment
}>()
Expand Down

0 comments on commit d79a5b7

Please sign in to comment.