diff --git a/browser-versions.json b/browser-versions.json
index d04f9287fd3a..5289b951584f 100644
--- a/browser-versions.json
+++ b/browser-versions.json
@@ -1,4 +1,4 @@
{
- "chrome:beta": "91.0.4472.57",
+ "chrome:beta": "91.0.4472.69",
"chrome:stable": "90.0.4430.212"
}
diff --git a/circle.yml b/circle.yml
index c10c458189aa..72dbe41359ba 100644
--- a/circle.yml
+++ b/circle.yml
@@ -1353,7 +1353,14 @@ jobs:
command: yarn workspace @cypress/design-system build
- run:
name: Run tests
- command: yarn test --reporter cypress-circleci-reporter --reporter-options resultsDir=./test_results
+ # will use PERCY_TOKEN environment variable if available
+ command: |
+ CYPRESS_KONFIG_ENV=production \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy exec --parallel -- -- \
+ yarn test --reporter cypress-circleci-reporter --reporter-options resultsDir=./test_results
working_directory: npm/design-system
- store_test_results:
path: npm/design-system/test_results
diff --git a/npm/design-system/cypress.json b/npm/design-system/cypress.json
index 65f6885eb73c..00494ad9b75c 100644
--- a/npm/design-system/cypress.json
+++ b/npm/design-system/cypress.json
@@ -1,6 +1,6 @@
{
- "viewportWidth": 400,
- "viewportHeight": 400,
+ "viewportWidth": 1024,
+ "viewportHeight": 800,
"video": false,
"projectId": "z9dxah",
"testFiles": "**/*spec.{js,jsx,ts,tsx}",
@@ -13,4 +13,4 @@
],
"componentFolder": "src",
"fixturesFolder": false
-}
\ No newline at end of file
+}
diff --git a/npm/design-system/cypress/support/index.js b/npm/design-system/cypress/support/index.js
index c5ecc8a83e5f..1ae415651555 100644
--- a/npm/design-system/cypress/support/index.js
+++ b/npm/design-system/cypress/support/index.js
@@ -1,5 +1,6 @@
import 'regenerator-runtime/runtime'
import 'cypress-real-events/support'
+import '@percy/cypress'
import './storybook'
// Need to register these once per app. Depending which components are consumed
diff --git a/npm/design-system/src/components/Nav/LeftNav.spec.tsx b/npm/design-system/src/components/Nav/LeftNav.spec.tsx
index 820e4e319e2d..96eeaf539351 100644
--- a/npm/design-system/src/components/Nav/LeftNav.spec.tsx
+++ b/npm/design-system/src/components/Nav/LeftNav.spec.tsx
@@ -4,6 +4,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { fas } from '@fortawesome/free-solid-svg-icons'
+import { mountAndSnapshot } from 'util/testing'
import { NavItem } from './types'
import { LeftNav } from './LeftNav'
@@ -43,7 +44,7 @@ describe('LeftNav', () => {
})
it('renders a stack of items', () => {
- mount()
+ mountAndSnapshot()
cy.get('nav').should('exist')
})
diff --git a/npm/design-system/src/components/fileTree/FileTree.spec.tsx b/npm/design-system/src/components/fileTree/FileTree.spec.tsx
index ecb30fccb776..c3c193cbf9be 100644
--- a/npm/design-system/src/components/fileTree/FileTree.spec.tsx
+++ b/npm/design-system/src/components/fileTree/FileTree.spec.tsx
@@ -1,6 +1,7 @@
import React from 'react'
import { mount } from '@cypress/react'
-import { FileTree } from './index'
+import { FileTree } from './FileTree'
+import { mountAndSnapshot } from 'util/testing'
const files = [
{
@@ -36,7 +37,7 @@ describe('FileTree', () => {
it('should send onFilePress callback on space and enter', () => {
const filePressStub = cy.stub()
- mount(
+ mountAndSnapshot(
,
@@ -118,6 +119,8 @@ describe('FileTree', () => {
cy.get('[data-cy=virtualized-tree] > div').scrollTo('bottom')
+ cy.contains('.treeChild', 'File 99').should('be.visible')
+
cy.get('[data-cy=virtualized-tree]').focus().type('{downarrow}').type('{downarrow}')
cy.contains('.treeChild', 'File 3').should('be.visible')
diff --git a/npm/design-system/src/components/searchInput/SearchInput.spec.tsx b/npm/design-system/src/components/searchInput/SearchInput.spec.tsx
index c5fd9163040c..a91f97c649ab 100644
--- a/npm/design-system/src/components/searchInput/SearchInput.spec.tsx
+++ b/npm/design-system/src/components/searchInput/SearchInput.spec.tsx
@@ -3,6 +3,7 @@ import { mount } from '@cypress/react'
import { SearchInput } from './SearchInput'
import { useCallback, useState } from 'react'
+import { mountAndSnapshot } from 'util/testing'
describe('SearchInput', () => {
const StatefulWrapper: React.FC<{onInput?: (input: string) => void}> = ({ onInput }) => {
@@ -18,7 +19,7 @@ describe('SearchInput', () => {
}
it('should render', () => {
- mount( {}} />)
+ mountAndSnapshot( {}} />)
cy.get('input').should('exist')
})
@@ -47,6 +48,8 @@ describe('SearchInput', () => {
cy.get('input').type('some input')
cy.get('[aria-label="Clear search"]').should('exist')
+
+ cy.percySnapshot()
})
it('should clear input on click', () => {
diff --git a/npm/design-system/src/components/virtualizedTree/VirtualizedTree.spec.tsx b/npm/design-system/src/components/virtualizedTree/VirtualizedTree.spec.tsx
index 01bdaa89b490..529e668fd7df 100644
--- a/npm/design-system/src/components/virtualizedTree/VirtualizedTree.spec.tsx
+++ b/npm/design-system/src/components/virtualizedTree/VirtualizedTree.spec.tsx
@@ -1,12 +1,14 @@
import * as React from 'react'
-import { mount } from '@cypress/react'
import { composeStories } from '@storybook/testing-react'
-import * as stories from './VirtualizedTree.stories'
+import { mountAndSnapshot } from 'util/testing'
+
+import * as stories from './VirtualizedTree.stories'
const { VirtualizedTree } = composeStories(stories)
+// TODO: Autogenerate from stories
describe('', () => {
- it('playground', () => {
- mount()
+ it('VirtualizedTree', () => {
+ mountAndSnapshot()
})
})
diff --git a/npm/design-system/src/core/button/Button.spec.tsx b/npm/design-system/src/core/button/Button.spec.tsx
new file mode 100644
index 000000000000..68b7f7a0353f
--- /dev/null
+++ b/npm/design-system/src/core/button/Button.spec.tsx
@@ -0,0 +1,28 @@
+import * as React from 'react'
+import { composeStories } from '@storybook/testing-react'
+
+import { mountAndSnapshot } from 'util/testing'
+
+import * as stories from './Button.stories'
+const { Button, IconButton } = composeStories(stories)
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('Button', () => {
+ mountAndSnapshot()
+ })
+
+ it('ButtonSizes', () => {
+ const ButtonSizes = () => (
+
+ {stories.buttonSizesWithSizes(['text-xs', 'text-s', 'text-ms', 'text-m', 'text-ml', 'text-l', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl'])}
+
+ )
+
+ mountAndSnapshot()
+ })
+
+ it('IconButton', () => {
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/button/Button.stories.tsx b/npm/design-system/src/core/button/Button.stories.tsx
index 56e932eaaf4f..ddf523bc9301 100644
--- a/npm/design-system/src/core/button/Button.stories.tsx
+++ b/npm/design-system/src/core/button/Button.stories.tsx
@@ -32,22 +32,24 @@ export const Button = createStory(() => (
))
+export const buttonSizesWithSizes = (sizes: string[]) => sizes.filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono')).map((key) => {
+ const size = key.replace('text-', '')
+
+ return (
+
+ {`Button ${size}`}
+
+ )
+})
+
export const ButtonSizes = createStory(() => (
- {Object.keys(typography).filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono')).map((key) => {
- const size = key.replace('text-', '')
-
- return (
-
- {`Button ${size}`}
-
- )
- })}
+ {buttonSizesWithSizes(Object.keys(typography))}
))
diff --git a/npm/design-system/src/core/icon/Icon.spec.tsx b/npm/design-system/src/core/icon/Icon.spec.tsx
new file mode 100644
index 000000000000..7676903d57a7
--- /dev/null
+++ b/npm/design-system/src/core/icon/Icon.spec.tsx
@@ -0,0 +1,28 @@
+import * as React from 'react'
+import { Icon } from './Icon'
+import { mountAndSnapshot } from 'util/testing'
+
+import styles from './Icon.stories.module.scss'
+import { iconLines } from './Icon.stories'
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('Standard icons', () => {
+ const Icons = () => (
+
+
+
+
+
+
+ )
+
+ mountAndSnapshot()
+ })
+
+ it('Icon lines', () => {
+ const Icons = () => iconLines(['text-xs', 'text-s', 'text-ms', 'text-m', 'text-ml', 'text-l', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl'])
+
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/icon/Icon.stories.tsx b/npm/design-system/src/core/icon/Icon.stories.tsx
index 9ccee87756f2..32ad7ce5d232 100644
--- a/npm/design-system/src/core/icon/Icon.stories.tsx
+++ b/npm/design-system/src/core/icon/Icon.stories.tsx
@@ -1,5 +1,4 @@
import * as React from 'react'
-import { Story } from '@storybook/react'
import { createStory, createStorybookConfig } from 'stories/util'
@@ -29,11 +28,34 @@ export default createStorybookConfig({
},
},
},
+ excludeStories: ['IconLines'],
})
-const Template: Story<{
- font: string
-}> = ({ font }) => (
+export const iconLines = (sizes: string[]) => sizes.filter((key) => key !== 'type').map((key) => {
+ const size = key.replace('text-', '')
+
+ return (
+
+
+ {size}
+
+
+
+
+ The five boxing wizards jump quickly
+
+
+
+
+ )
+})
+
+export const Icon = createStory<{ font: string }>(({ font }) => (
- {Object.keys(typography).filter((key) => key !== 'type').map((key) => {
- const size = key.replace('text-', '')
-
- return (
-
-
- {size}
-
-
-
-
- The five boxing wizards jump quickly
-
-
-
-
- )
- })}
+ {iconLines(Object.keys(typography))}
-)
-
-export const Icon = createStory(Template, {
+), {
font: fontOptions[0],
})
diff --git a/npm/design-system/src/core/input/Input.spec.tsx b/npm/design-system/src/core/input/Input.spec.tsx
new file mode 100644
index 000000000000..2fe6ae783ab6
--- /dev/null
+++ b/npm/design-system/src/core/input/Input.spec.tsx
@@ -0,0 +1,28 @@
+import * as React from 'react'
+import { composeStories } from '@storybook/testing-react'
+import * as stories from './Input.stories'
+import { mountAndSnapshot } from 'util/testing'
+import { iconSizesWithSizes } from './Input.stories'
+
+const { Input, Icon } = composeStories(stories)
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('Standard input', () => {
+ mountAndSnapshot()
+ })
+
+ it('IconInput', () => {
+ mountAndSnapshot()
+ })
+
+ it('IconInput sizes', () => {
+ const IconInput = () => (
+ <>
+ {iconSizesWithSizes(['xs', 's', 'ms', 'm', 'ml', 'l', 'xl', '2xl'])}
+ >
+ )
+
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/input/Input.stories.tsx b/npm/design-system/src/core/input/Input.stories.tsx
index e54d8e3edefd..a4b1aac173cb 100644
--- a/npm/design-system/src/core/input/Input.stories.tsx
+++ b/npm/design-system/src/core/input/Input.stories.tsx
@@ -11,6 +11,7 @@ import { TextSize } from 'css'
export default createStorybookConfig({
title: 'Core/Input',
+ excludeStories: ['iconSizesWithSizes'],
})
export const Input = createStory(() => (
@@ -110,30 +111,32 @@ export const Icon = createStory(() => (
))
+export const iconSizesWithSizes = (sizes: string[]) => sizes.map((key) => {
+ const size = key.replace('text-', '')
+
+ return (
+
+ )
+})
+
export const IconSizes = createStory(() => (
- {Object.keys(typography).filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono') && key !== 'text-3xl' && key !== 'text-4xl').map((key) => {
- const size = key.replace('text-', '')
-
- return (
-
- )
- })}
+ {iconSizesWithSizes(Object.keys(typography).filter((key) => key !== 'type' && !key.startsWith('line-height') && !key.startsWith('text-mono') && key !== 'text-3xl' && key !== 'text-4xl'))}
))
diff --git a/npm/design-system/src/core/surface/elevation/Elevation.spec.tsx b/npm/design-system/src/core/surface/elevation/Elevation.spec.tsx
new file mode 100644
index 000000000000..5b5296193a81
--- /dev/null
+++ b/npm/design-system/src/core/surface/elevation/Elevation.spec.tsx
@@ -0,0 +1,14 @@
+import * as React from 'react'
+import { composeStories } from '@storybook/testing-react'
+
+import { mountAndSnapshot } from 'util/testing'
+
+import * as stories from './Elevation.stories'
+const { Elevation } = composeStories(stories)
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('Elevation', () => {
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/surface/elevation/Elevation.stories.tsx b/npm/design-system/src/core/surface/elevation/Elevation.stories.tsx
index f55b66694e6d..011a61ff3bca 100644
--- a/npm/design-system/src/core/surface/elevation/Elevation.stories.tsx
+++ b/npm/design-system/src/core/surface/elevation/Elevation.stories.tsx
@@ -1,5 +1,4 @@
import * as React from 'react'
-import { Story } from '@storybook/react'
import { createStory, createStorybookConfig } from 'stories/util'
@@ -22,22 +21,20 @@ export default createStorybookConfig({
},
})
-const Template: Story<{
- elevation: SurfaceElevation
-}> = ({ elevation }) => (
-
-
- {lorem}
-
-
-
+export const Elevation = createStory<{
+ elevation: SurfaceElevation
+ }>(({ elevation }) => (
+
{lorem}
-
-
-)
-
-export const Elevation = createStory(Template, {
- elevation: 'bordered',
-})
+
+
+
+ {lorem}
+
+
+
+ ), {
+ elevation: 'bordered',
+ })
diff --git a/npm/design-system/src/core/surface/paddedBox/PaddedBox.spec.tsx b/npm/design-system/src/core/surface/paddedBox/PaddedBox.spec.tsx
new file mode 100644
index 000000000000..1dadf72a5986
--- /dev/null
+++ b/npm/design-system/src/core/surface/paddedBox/PaddedBox.spec.tsx
@@ -0,0 +1,14 @@
+import * as React from 'react'
+import { composeStories } from '@storybook/testing-react'
+
+import { mountAndSnapshot } from 'util/testing'
+
+import * as stories from './PaddedBox.stories'
+const { PaddedBox } = composeStories(stories)
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('PaddedBox', () => {
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/surface/paddedBox/PaddedBox.stories.tsx b/npm/design-system/src/core/surface/paddedBox/PaddedBox.stories.tsx
index a98735d8749a..302a978359a1 100644
--- a/npm/design-system/src/core/surface/paddedBox/PaddedBox.stories.tsx
+++ b/npm/design-system/src/core/surface/paddedBox/PaddedBox.stories.tsx
@@ -1,5 +1,4 @@
import * as React from 'react'
-import { Story } from '@storybook/react'
import { createStory, createStorybookConfig } from 'stories/util'
@@ -22,21 +21,19 @@ export default createStorybookConfig({
},
})
-const Template: Story<{
- padding: Spacing
-}> = ({ padding }) => (
-
-)
-
-export const PaddedBox = createStory(Template, {
- padding: 'm',
-})
+export const PaddedBox = createStory<{
+ padding: Spacing
+ }>(({ padding }) => (
+
+ ), {
+ padding: 'm',
+ })
// Required to prevent Storybook from separating into two words and creating unnecessary nesting
PaddedBox.storyName = 'PaddedBox'
diff --git a/npm/design-system/src/core/text/placeholder/Placeholder.spec.tsx b/npm/design-system/src/core/text/placeholder/Placeholder.spec.tsx
new file mode 100644
index 000000000000..cef5338335f1
--- /dev/null
+++ b/npm/design-system/src/core/text/placeholder/Placeholder.spec.tsx
@@ -0,0 +1,14 @@
+import * as React from 'react'
+import { composeStories } from '@storybook/testing-react'
+
+import { mountAndSnapshot } from 'util/testing'
+
+import * as stories from './Placeholder.stories'
+const { Placeholder } = composeStories(stories)
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('Placeholder', () => {
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/text/placeholder/Placeholder.stories.tsx b/npm/design-system/src/core/text/placeholder/Placeholder.stories.tsx
index d22b01d364e1..9dbd9323237e 100644
--- a/npm/design-system/src/core/text/placeholder/Placeholder.stories.tsx
+++ b/npm/design-system/src/core/text/placeholder/Placeholder.stories.tsx
@@ -9,7 +9,7 @@ export default createStorybookConfig({
title: 'Core/Placeholder',
})
-export const StyledText = createStory(() => (
+export const Placeholder = createStory(() => (
diff --git a/npm/design-system/src/core/text/styledText/StyledText.spec.tsx b/npm/design-system/src/core/text/styledText/StyledText.spec.tsx
new file mode 100644
index 000000000000..5d7a629936e4
--- /dev/null
+++ b/npm/design-system/src/core/text/styledText/StyledText.spec.tsx
@@ -0,0 +1,18 @@
+import * as React from 'react'
+
+import { mountAndSnapshot } from 'util/testing'
+
+import { styledTextWithSizes } from './StyledText.stories'
+
+// TODO: Autogenerate from stories
+describe('', () => {
+ it('StyledText', () => {
+ const StyledText = () => (
+ <>
+ {styledTextWithSizes(['text-xs', 'text-s', 'text-ms', 'text-m', 'text-ml', 'text-l', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl'])}
+ >
+ )
+
+ mountAndSnapshot()
+ })
+})
diff --git a/npm/design-system/src/core/text/styledText/StyledText.stories.tsx b/npm/design-system/src/core/text/styledText/StyledText.stories.tsx
index d49c4332a073..f9e851561373 100644
--- a/npm/design-system/src/core/text/styledText/StyledText.stories.tsx
+++ b/npm/design-system/src/core/text/styledText/StyledText.stories.tsx
@@ -1,5 +1,4 @@
import * as React from 'react'
-import { Story } from '@storybook/react'
import { StyledText as TextComponent } from './StyledText'
import { createStory, createStorybookConfig } from 'stories/util'
@@ -10,30 +9,31 @@ import { lorem } from 'util/lorem'
export default createStorybookConfig({
title: 'Core/StyledText',
+ excludeStories: ['styledTextWithSizes'],
})
-const Template: Story = () => (
+export const styledTextWithSizes = (sizes: string[]) => sizes.filter((key) => !key.startsWith('line-height')).map((key) => {
+ return (
+ <>
+
+
+ {key}
+
+
+
+
+ {lorem}
+
+
+
+ >
+ )
+})
+
+export const StyledText = createStory(() => (
- {Object.keys(typography).filter((key) => !key.startsWith('line-height')).map((key) => {
- return (
- <>
-
-
- {key}
-
-
-
-
- {lorem}
-
-
-
- >
- )
- })}
+ {styledTextWithSizes(Object.keys(typography))}
-)
-
-export const StyledText = createStory(Template)
+))
StyledText.storyName = 'StyledText'
diff --git a/npm/design-system/src/stories/util.ts b/npm/design-system/src/stories/util.ts
index 8227d84629f3..fac4b3fb5fa7 100644
--- a/npm/design-system/src/stories/util.ts
+++ b/npm/design-system/src/stories/util.ts
@@ -1,4 +1,4 @@
-import { Story, Meta } from '@storybook/react'
+import type { Story, Meta } from '@storybook/react'
/**
* Passthrough config creator for typing without casting
@@ -8,7 +8,7 @@ export const createStorybookConfig = (config: Meta): Meta => config
/**
* Compact way of declaring a new story
*/
-export const createStory = (template: Story, args?: Partial): Story => {
+export const createStory = (template: Story, args?: Partial) => {
const story = template.bind({})
story.args = args
diff --git a/npm/design-system/src/util/testing.ts b/npm/design-system/src/util/testing.ts
new file mode 100644
index 000000000000..b9a9285f8dd1
--- /dev/null
+++ b/npm/design-system/src/util/testing.ts
@@ -0,0 +1,9 @@
+import { mount } from '@cypress/react'
+import React from 'react'
+
+export const mountAndSnapshot =
+(component: React.ReactChild) => {
+ mount(component)
+
+ cy.percySnapshot()
+}
diff --git a/npm/design-system/tsconfig.json b/npm/design-system/tsconfig.json
index 33da6e3d80ba..9b724cdb866f 100644
--- a/npm/design-system/tsconfig.json
+++ b/npm/design-system/tsconfig.json
@@ -18,7 +18,8 @@
"strict": true /* Enable all strict type-checking options. */,
/* Module Resolution Options */
"types": [
- "cypress"
+ "cypress",
+ "@percy/cypress"
] /* Type declaration files to be included in compilation. */,
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
"esModuleInterop": true,
@@ -34,5 +35,4 @@
}
},
"include": ["src"],
- "exclude": ["src/**/*.spec.ts", "src/**/*.spec.tsx"],
}
diff --git a/packages/desktop-gui/cypress/integration/footer_spec.js b/packages/desktop-gui/cypress/integration/footer_spec.js
old mode 100644
new mode 100755
diff --git a/packages/desktop-gui/src/footer/footer.jsx b/packages/desktop-gui/src/footer/footer.jsx
old mode 100644
new mode 100755
diff --git a/packages/driver/package.json b/packages/driver/package.json
index 4f0768aa1d31..7bcc8deac9c2 100644
--- a/packages/driver/package.json
+++ b/packages/driver/package.json
@@ -48,7 +48,7 @@
"eventemitter2": "6.4.2",
"express": "4.17.1",
"jquery": "3.1.1",
- "jquery.scrollto": "2.1.2",
+ "jquery.scrollto": "2.1.3",
"js-cookie": "2.2.1",
"jsdom": "14.1.0",
"lodash": "4.17.21",
diff --git a/packages/example/cypress/fixtures/example.json b/packages/example/cypress/fixtures/example.json
old mode 100644
new mode 100755
diff --git a/packages/example/cypress/plugins/index.js b/packages/example/cypress/plugins/index.js
old mode 100644
new mode 100755
diff --git a/packages/example/cypress/support/commands.js b/packages/example/cypress/support/commands.js
old mode 100644
new mode 100755
diff --git a/packages/example/cypress/support/index.js b/packages/example/cypress/support/index.js
old mode 100644
new mode 100755
diff --git a/packages/reporter/cypress/integration/header_spec.ts b/packages/reporter/cypress/integration/header_spec.ts
old mode 100644
new mode 100755
index e6b3bff35644..6fb822b4a578
--- a/packages/reporter/cypress/integration/header_spec.ts
+++ b/packages/reporter/cypress/integration/header_spec.ts
@@ -125,14 +125,14 @@ describe('header', () => {
it('has tooltip with right title when auto-scrolling is enabled', () => {
cy.get('.toggle-auto-scrolling').trigger('mouseover')
- cy.get('.cy-tooltip').should('have.text', 'Disable Auto-scrolling')
+ cy.get('.cy-tooltip').should('have.text', 'Disable Auto-scrolling A')
})
it('has tooltip with right title when auto-scrolling is disabled', () => {
runner.emit('reporter:start', { autoScrollingEnabled: false })
cy.get('.toggle-auto-scrolling').trigger('mouseover')
- cy.get('.cy-tooltip').should('have.text', 'Enable Auto-scrolling')
+ cy.get('.cy-tooltip').should('have.text', 'Enable Auto-scrolling A')
})
it('emits save:state event when clicked', () => {
@@ -193,7 +193,7 @@ describe('header', () => {
it('displays tooltip for play button', () => {
cy.get('.play').trigger('mouseover')
- cy.get('.cy-tooltip').should('have.text', 'Resume')
+ cy.get('.cy-tooltip').should('have.text', 'Resume C')
})
it('emits runner:resume when play button is clicked', () => {
@@ -208,7 +208,7 @@ describe('header', () => {
it('displays tooltip for next button', () => {
cy.get('.next').trigger('mouseover')
- cy.get('.cy-tooltip').should('have.text', `Next: 'find'`)
+ cy.get('.cy-tooltip').should('have.text', `Next [N]:find`)
})
it('emits runner:next when next button is clicked', () => {
diff --git a/packages/reporter/cypress/integration/shortcuts_spec.ts b/packages/reporter/cypress/integration/shortcuts_spec.ts
old mode 100644
new mode 100755
index 85d2a89267f8..aaaeb0c912ca
--- a/packages/reporter/cypress/integration/shortcuts_spec.ts
+++ b/packages/reporter/cypress/integration/shortcuts_spec.ts
@@ -83,6 +83,33 @@ describe('shortcuts', function () {
})
})
+ it('continues resuming tests', () => {
+ cy.get('body').type('s').then(() => {
+ expect(runner.emit).to.have.been.calledWith('runner:stop')
+ })
+
+ cy.get('body').type('c').then(() => {
+ expect(runner.emit).to.have.been.calledWith('runner:resume')
+ })
+ })
+
+ it('go to next test', () => {
+ cy.get('body').type('s').then(() => {
+ expect(runner.emit).to.have.been.calledWith('runner:stop')
+ })
+
+ cy.get('body').type('n').then(() => {
+ expect(runner.emit).to.have.been.calledWith('runner:next')
+ })
+ })
+
+ it('toggles auto-scrolling', () => {
+ cy.get('body').type('a')
+ cy.get('.toggle-auto-scrolling').should('not.have.class', 'auto-scrolling-enabled')
+ cy.get('body').type('a')
+ cy.get('.toggle-auto-scrolling').should('have.class', 'auto-scrolling-enabled')
+ })
+
it('does not run shortcut if typed into an input', () => {
cy.get('body')
.then(($body) => {
diff --git a/packages/reporter/src/header/controls.tsx b/packages/reporter/src/header/controls.tsx
old mode 100644
new mode 100755
index 67abbbb98c9e..9de5afaca72d
--- a/packages/reporter/src/header/controls.tsx
+++ b/packages/reporter/src/header/controls.tsx
@@ -32,14 +32,14 @@ const Controls = observer(({ events = defaultEvents, appState }: Props) => {
))}
{ifThen(appState.isPaused, (
-
+ Resume C} className='cy-tooltip'>
))}
{ifThen(!appState.isPaused, (
-
+ {appState.autoScrollingEnabled ? 'Disable' : 'Enable'} Auto-scrolling A} className='cy-tooltip'>
))}
{ifThen(!!appState.nextCommandName, (
-
-