Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporter error improvements #3930

Merged
merged 629 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
629 commits
Select commit Hold shift + click to select a range
eff5f72
RadioGroup set of components- RadioGroup is a set of selectable items…
andrew-codes Dec 2, 2019
f9d3367
additional styling tests to showcase common examples
andrew-codes Dec 2, 2019
ec848e1
revisit implementationradio is a form of single selection. Much of th…
andrew-codes Dec 3, 2019
4176bfa
use new select component in editor picker
chrisbreiding Dec 3, 2019
aa5340b
rename spec
chrisbreiding Dec 3, 2019
15dc266
satisfy typescript
chrisbreiding Dec 3, 2019
ee26eb9
fix dropdown test
chrisbreiding Dec 4, 2019
b700f74
ignore cypress screenshots and videos
chrisbreiding Dec 4, 2019
119c575
clean up webpack config
chrisbreiding Dec 4, 2019
499ae41
use lodash instead of lodash/fp
chrisbreiding Dec 4, 2019
456ea83
initial implementation of editor picker workflow
chrisbreiding Dec 4, 2019
3c06e0b
refactor select and editor-picker components
chrisbreiding Dec 13, 2019
4575cd8
improve saved_state api
chrisbreiding Dec 13, 2019
b04a186
create editors util
chrisbreiding Dec 13, 2019
21351de
wire up ui and server side
chrisbreiding Dec 13, 2019
7e33bf0
fix tests
chrisbreiding Dec 13, 2019
4123784
refactor editor picker modal
chrisbreiding Dec 17, 2019
b166bbf
validate editor picker
chrisbreiding Dec 17, 2019
5083cf2
trim other editor path
chrisbreiding Dec 17, 2019
8b2531e
add special handling if no user editors found
chrisbreiding Dec 17, 2019
e8230d0
improve editor picker styles
chrisbreiding Dec 19, 2019
5c52dc6
fix modal button flickering issue
chrisbreiding Dec 19, 2019
c7c36e3
add global settings with editor picker to desktop-gaui
chrisbreiding Dec 27, 2019
be31369
include font-awesome as ui-components dep
chrisbreiding Dec 30, 2019
e84688f
change order of desktop-gui scss imports
chrisbreiding Dec 30, 2019
1085c0f
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Dec 31, 2019
8d10145
fix querying spec
chrisbreiding Dec 31, 2019
03cada4
update snapshot
chrisbreiding Dec 31, 2019
2310669
fix issues and failures caused by merge
chrisbreiding Jan 2, 2020
536dad4
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Jan 2, 2020
ffe0586
try skipping this test
chrisbreiding Jan 3, 2020
e732b73
try removing listeners
chrisbreiding Jan 3, 2020
da04011
skip troublesome test for now
chrisbreiding Jan 3, 2020
01ebc76
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding Jan 3, 2020
98111cc
temp fix for desktop-gui build issue
chrisbreiding Jan 6, 2020
2948570
fix temp fix
chrisbreiding Jan 6, 2020
c02b440
one more
chrisbreiding Jan 6, 2020
3d803b3
oops
chrisbreiding Jan 6, 2020
f3ec02c
update snapshots
chrisbreiding Jan 6, 2020
6438085
move getting invocation stack to right place
chrisbreiding Jan 7, 2020
eae8f1b
fix class name
chrisbreiding Jan 7, 2020
4762f5e
fix editors types and tests
chrisbreiding Jan 7, 2020
ddff5ea
uncomment scss and hope it was just a CI cache issue
chrisbreiding Jan 7, 2020
443f0bf
nevermind :(
chrisbreiding Jan 7, 2020
7a89429
fix isCustom forwarding
chrisbreiding Jan 8, 2020
c8e0526
rename select to select-group
chrisbreiding Jan 8, 2020
ffee0bc
uncomment scss
chrisbreiding Jan 8, 2020
3c4b39e
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Jan 8, 2020
57061ea
quotes to ticks
chrisbreiding Jan 8, 2020
d5e5d5b
nest scss in reporter properly
chrisbreiding Jan 9, 2020
f466000
add print-to-console button to errors
chrisbreiding Jan 9, 2020
6e62366
Fix issue with css for err-file tooltip not being picked up
jennifer-shehane Jan 10, 2020
6ae5626
Merge branch 'develop' into jen/reporter-error-templates-fix
jennifer-shehane Jan 10, 2020
96ff964
delete duplicate coffee files
jennifer-shehane Jan 10, 2020
9856ecf
Updates to styling and wording of the error improvement areas.
jennifer-shehane Jan 10, 2020
f2b6d70
improve test error console logging
chrisbreiding Jan 10, 2020
b0eb964
remove (redundant) message from err stack when displayed in reporter
chrisbreiding Jan 10, 2020
28c5f5d
update e2e test
chrisbreiding Jan 10, 2020
c33756c
Merge branch 'develop' into jen/reporter-error-templates-fix
jennifer-shehane Jan 13, 2020
ea309bd
simplify file opening ux
chrisbreiding Jan 13, 2020
49cd386
update editors spec
chrisbreiding Jan 13, 2020
773e9ca
update e2e test
chrisbreiding Jan 13, 2020
a9c9995
upgrade mobx and mobx-react to latest
chrisbreiding Jan 14, 2020
123a073
fix typing into other editor not working
chrisbreiding Jan 14, 2020
f8509b8
ensure keydowns within select item don’t change selected item
chrisbreiding Jan 14, 2020
7a74a02
make select spec more reliable
chrisbreiding Jan 14, 2020
0463f5d
Merge remote-tracking branch 'origin/jen/reporter-error-templates-fix…
jennifer-shehane Jan 16, 2020
4f532e0
Update error padding to match submit button padding
jennifer-shehane Jan 16, 2020
d595d51
Fix issue with tooltip not displaying in Desktop-GUI
jennifer-shehane Jan 16, 2020
3559abc
Update copy or modal to match 'file opener' preference wording.
jennifer-shehane Jan 16, 2020
818202b
Update tests with new wording of modal button.
jennifer-shehane Jan 16, 2020
460bc0c
make tooltips compatible across desktop-gui, runner, reporter, & ui-c…
chrisbreiding Jan 16, 2020
d92b660
use launch-editor instead of open-editor
chrisbreiding Jan 16, 2020
d85ba7b
change editor picker validation method
chrisbreiding Jan 16, 2020
3e84653
ensure chosen editor state is cleared when modal closes
chrisbreiding Jan 16, 2020
b3af68d
improve error styles
chrisbreiding Jan 16, 2020
3765258
make on computer option os-specific
chrisbreiding Jan 16, 2020
0b08fe2
simplify editor data type
chrisbreiding Jan 16, 2020
27ec45f
move editor picker paragraph
chrisbreiding Jan 16, 2020
b1c1dea
change global settings to file preference
chrisbreiding Jan 16, 2020
7756637
Update some more styles
jennifer-shehane Jan 17, 2020
4b4fe8a
update tests
chrisbreiding Jan 17, 2020
1170200
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Jan 17, 2020
6c4c733
preserve whitespace in stack line
chrisbreiding Jan 21, 2020
12f57b0
change ‘Context.eval’ to ‘Test.run’ in stack line
chrisbreiding Jan 21, 2020
299af5a
file-preference -> file-opener-preference
chrisbreiding Jan 21, 2020
703ceb0
$utils.cypressErr -> $errUtils.cypressErr
chrisbreiding Jan 21, 2020
5c1ffae
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Jan 27, 2020
90c1429
Merge branch 'develop' into jen/reporter-error-templates-fix
jennifer-shehane Jan 28, 2020
41b1a5f
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Feb 10, 2020
3c44754
Merge branch 'jen/reporter-error-templates-fix' of github.com:cypress…
chrisbreiding Feb 10, 2020
1f0852c
fix issues, failing tests
chrisbreiding Feb 10, 2020
03025e0
fix browser beta label
chrisbreiding Feb 11, 2020
97ee660
fix ui-components test preprocessing
chrisbreiding Feb 11, 2020
78cb54b
make stringify test more reliable
chrisbreiding Feb 11, 2020
5f972b8
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Feb 12, 2020
ea965a5
update yarn.lock
chrisbreiding Feb 12, 2020
12e30cc
fix scss paths
chrisbreiding Feb 12, 2020
e095e34
handle firefox stacks when parsing
chrisbreiding Feb 12, 2020
d2dfb96
bump react and mobx to latest versions
chrisbreiding Feb 12, 2020
5660d19
sync up react and mobx versions in desktop-gui
chrisbreiding Feb 12, 2020
d324389
fix error logging
chrisbreiding Feb 13, 2020
6ff17e6
fix tests, whitespace parsing
chrisbreiding Feb 13, 2020
b81bc3c
update combineMessageAndStack signature, fix issue, update tests to b…
chrisbreiding Feb 13, 2020
25a9440
fix reporter test
chrisbreiding Feb 13, 2020
0631ae5
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Feb 14, 2020
280fd4f
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Feb 14, 2020
d35b072
remove unused method
chrisbreiding Feb 14, 2020
d75766a
fix noStackTrace and update snapshot
chrisbreiding Feb 25, 2020
88673c8
Redesign and improve reporter error display (#6467)
chrisbreiding Mar 13, 2020
689bef0
Merge branch 'develop' into error-improvements-approved
chrisbreiding Mar 13, 2020
bdde7c0
Merge branch 'error-improvements-approved' into jen/reporter-error-te…
chrisbreiding Mar 13, 2020
5ba7bcd
remove unnecessary changes
chrisbreiding Mar 16, 2020
4faf36f
url -> URL
chrisbreiding Mar 16, 2020
da604dd
fix/remove whitespace changes
chrisbreiding Mar 16, 2020
e3d798b
fix yarn.lock
chrisbreiding Mar 16, 2020
48f5b87
fix linting issues
chrisbreiding Mar 16, 2020
3342c8d
fix and refactor error utils spec
chrisbreiding Mar 16, 2020
2441bc9
fix duplicate error rendering and test errors spec
chrisbreiding Mar 16, 2020
485e060
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Mar 17, 2020
364306b
fix typing issue
chrisbreiding Mar 17, 2020
7c2ce17
fix settings spec
chrisbreiding Mar 17, 2020
8b177cd
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Mar 17, 2020
d44fb25
removed unused mdMessage, remove obselete js spec
chrisbreiding Mar 17, 2020
7f42fa3
fix merge mistake
chrisbreiding Mar 17, 2020
5ffc523
remove noisy, unnecessary changes
chrisbreiding Mar 17, 2020
dff316a
fix err model spec, improve implementation
chrisbreiding Mar 17, 2020
28a3728
fix integration test
chrisbreiding Mar 17, 2020
1aabb55
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Mar 18, 2020
f202f76
fix errors ui tests
chrisbreiding Mar 18, 2020
c8f4005
move normalizing error stack to stack utils
chrisbreiding Mar 18, 2020
b25d31a
fix replacing stack
chrisbreiding Mar 18, 2020
57034aa
fix wrong method
chrisbreiding Mar 18, 2020
9db1b89
fix tests
chrisbreiding Mar 19, 2020
57fd6f5
update snapshots
chrisbreiding Mar 19, 2020
a73d01d
update more snapshots
chrisbreiding Mar 19, 2020
64c44ce
update snapshot
chrisbreiding Mar 19, 2020
39b5c85
make sure not to replace removed stack
chrisbreiding Mar 19, 2020
3ba284b
fix replaceStack implementation
chrisbreiding Mar 19, 2020
8105e47
refactor error ui e2e test
chrisbreiding Mar 20, 2020
3c0887d
refactor errors tests into two files
chrisbreiding Mar 20, 2020
4e8f627
improve method of choosing invocation stack over original stack
chrisbreiding Mar 23, 2020
7749f3b
convert e2e test from coffeescript to typescript
chrisbreiding Mar 23, 2020
87dbd48
update snapshots
chrisbreiding Mar 23, 2020
d2dc032
add back firefox snapshot
chrisbreiding Mar 23, 2020
71806d4
fix snapshot
chrisbreiding Mar 23, 2020
ea94133
fix cy.timeout(0)
chrisbreiding Mar 23, 2020
1458138
refactor and speed up error ui e2e tests
chrisbreiding Mar 23, 2020
5e573ea
improve cypress/assertion error abstraction and auto-log all unexpect…
chrisbreiding Mar 24, 2020
a1ef020
remove duplicate error processing
chrisbreiding Mar 24, 2020
33c7b24
small refactor
chrisbreiding Mar 24, 2020
c5d3dcb
ensure we don’t overwrite stacks for internal unexpected errors
chrisbreiding Mar 24, 2020
7408dba
remove obselete implementation details
chrisbreiding Mar 24, 2020
e215738
update snapshots
chrisbreiding Mar 24, 2020
6e8ffdc
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Mar 24, 2020
3c5deed
remove obselete/unncessary changes
chrisbreiding Mar 24, 2020
4a932b4
yarn.lock has-binary2 (╯°□°)╯︵ ┻━┻
chrisbreiding Mar 24, 2020
c02e87c
update snapshot
chrisbreiding Mar 24, 2020
56e78f4
fix/improve internal error tests
chrisbreiding Mar 24, 2020
7aea881
ensure test doesn’t finish before failure with callback function
chrisbreiding Mar 25, 2020
ceba463
Merge remote-tracking branch 'origin/develop' into jen/reporter-error…
chrisbreiding Mar 27, 2020
f4c747c
yarn.lock has-binary2
chrisbreiding Mar 27, 2020
7e5c204
improve, simplify, and refactor error utills
chrisbreiding Mar 27, 2020
2801d8f
Merge branch 'develop' into jen/reporter-error-templates-fix
jennifer-shehane Mar 30, 2020
9f65887
Merge branch 'jen/reporter-error-templates-fix' of github.com:cypress…
chrisbreiding Mar 30, 2020
b194b56
fix issues with refactor
chrisbreiding Mar 30, 2020
75d0be5
fix issues
chrisbreiding Mar 31, 2020
9d50814
fix displaying stack w/o message when it has blank lines
chrisbreiding Mar 31, 2020
061e775
fix issues with uncaught errors, add tests
chrisbreiding Mar 31, 2020
b983664
improve stack replacement
chrisbreiding Apr 1, 2020
6d45951
fix test
chrisbreiding Apr 1, 2020
886cd6c
update snapshots
chrisbreiding Apr 1, 2020
eaa5ac1
ensure tests have time to fail
chrisbreiding Apr 1, 2020
600410f
update snapshot
chrisbreiding Apr 1, 2020
fd7d897
add more waits to make sure test fails
chrisbreiding Apr 1, 2020
95f13ea
wip: wip
chrisbreiding Apr 3, 2020
594288a
mutate uncaught errors instead of replacing them with new errors
chrisbreiding Apr 6, 2020
821fd91
add test for cy.readFile default assertion
chrisbreiding Apr 6, 2020
8cad5f7
include docsUrl in uncaught exception
chrisbreiding Apr 6, 2020
6f9d5ae
update snapshtos
chrisbreiding Apr 6, 2020
57cafd5
update snapshot
chrisbreiding Apr 6, 2020
68cb30f
fix test name
chrisbreiding Apr 6, 2020
bdc5c3f
test error ui in all the browsers
chrisbreiding Apr 6, 2020
1a57473
fix not replacing original message in uncaught errors
chrisbreiding Apr 7, 2020
b03d6d3
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Apr 13, 2020
cf4bb92
remove redundant method
chrisbreiding Apr 13, 2020
cb66a8e
update snapshot
chrisbreiding Apr 13, 2020
d89412c
simplify getting stack from spec iframe
chrisbreiding Apr 13, 2020
a6b5f8c
fix spec window uncaught error handling
chrisbreiding Apr 13, 2020
219266a
fix test to have same error message between browsers
chrisbreiding Apr 13, 2020
4fbc2c6
update tests
chrisbreiding Apr 13, 2020
3f00d09
append original stack to new err stack
chrisbreiding Apr 14, 2020
73e8119
directly throw visit onLoad error instead of wrapping
chrisbreiding Apr 16, 2020
9f835a3
refactor invocation stack replacement
chrisbreiding Apr 16, 2020
9a0a160
handle test-e2e —headed and —no-exit flags
chrisbreiding Apr 16, 2020
693a951
skip Error.captureStackTrace if it’s not present
chrisbreiding Apr 16, 2020
c265d0b
fix copy-pasta error
chrisbreiding Apr 16, 2020
b061aa5
fix tests
chrisbreiding Apr 16, 2020
7e5e830
put back error appending
chrisbreiding Apr 16, 2020
9d982f9
update snapshots
chrisbreiding Apr 16, 2020
3e60a85
fix testing for stack
chrisbreiding Apr 16, 2020
e9bfd78
update snapshot
chrisbreiding Apr 16, 2020
d1b0af3
don’t linkify stack lines with cypress:// or cypress_runner.js
chrisbreiding Apr 20, 2020
fd3a9dc
implement consistent user invocation stack appending strategy
chrisbreiding Apr 21, 2020
5d0a193
convert new reporter jsx files to typescript
chrisbreiding Apr 21, 2020
2ad8060
fix has-binary2
chrisbreiding Apr 21, 2020
7a7c827
append node.js internals to appropriate errors
chrisbreiding Apr 22, 2020
5d00b0b
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Apr 22, 2020
a4638f5
update snapshots
chrisbreiding Apr 22, 2020
18fc9af
turn off typescript for error ui specs
chrisbreiding Apr 23, 2020
39c83e3
remove duplicate scaffold
chrisbreiding Apr 23, 2020
8c67bec
fix function reference
chrisbreiding Apr 23, 2020
6b53036
more new line trimming util to more appropriate place
chrisbreiding Apr 23, 2020
62690b4
handle multiple docs urls
chrisbreiding Apr 23, 2020
693fbee
standardize new lines after stack
chrisbreiding Apr 23, 2020
dbe13a1
make typescript happy
chrisbreiding Apr 23, 2020
1f011f1
update snapshot
chrisbreiding Apr 23, 2020
7ff5de2
handle firefox stack differences
chrisbreiding Apr 27, 2020
dcf61f4
fix tests
chrisbreiding Apr 27, 2020
ef86211
bring custom commands spec up to parity
chrisbreiding Apr 27, 2020
c63d826
fix test
chrisbreiding Apr 27, 2020
cd79d32
fix test
chrisbreiding Apr 27, 2020
d6f8da2
handle assert errors
chrisbreiding Apr 27, 2020
204b200
normalize stack whitespace
chrisbreiding Apr 27, 2020
a9ea994
fix over-normalizing stacks
chrisbreiding Apr 28, 2020
e8d8551
prevent re-normalizing stack
chrisbreiding Apr 28, 2020
4236d37
put back normalize stack call now that it can’t happen twice
chrisbreiding Apr 28, 2020
8d1e160
adjust e2e firefox stack normalizing
chrisbreiding Apr 28, 2020
70620e6
put back e2e stack pre handling for firefox
chrisbreiding Apr 28, 2020
4127ce5
put back the slice
chrisbreiding Apr 28, 2020
6734e80
e2e firefox stack whitespace normalizing
chrisbreiding Apr 29, 2020
30139b6
try always having a consistent amount of space regardless of browser
chrisbreiding Apr 29, 2020
4def2bb
update snapshots
chrisbreiding Apr 29, 2020
53356ed
fix snapshot
chrisbreiding Apr 29, 2020
a7b2649
rename method
chrisbreiding Apr 29, 2020
1f9dc2f
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding Apr 29, 2020
6dc10ff
has-binary2
chrisbreiding Apr 29, 2020
74dc360
fix e2e exit option
chrisbreiding Apr 30, 2020
83f93b4
fix files controller
chrisbreiding Apr 30, 2020
309560c
fix integration test
chrisbreiding Apr 30, 2020
7f0a2e0
fix iframe handling
chrisbreiding Apr 30, 2020
2554870
fix method stubbing
chrisbreiding Apr 30, 2020
fa8dd26
remove mocha error message monkey patch
chrisbreiding May 1, 2020
2eb3f4f
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding May 1, 2020
e4ebb34
fixes/improvements based on feedback
chrisbreiding May 4, 2020
ce45e6f
fix/improve prism plugin loading
chrisbreiding May 4, 2020
b958a88
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding May 4, 2020
5abafa7
use 4 spaces for e2e stack trace indentation
chrisbreiding May 4, 2020
2c41a37
Revert "use 4 spaces for e2e stack trace indentation"
chrisbreiding May 5, 2020
19558f2
Merge branch 'develop' into jen/reporter-error-templates-fix
chrisbreiding May 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Cached Theme Material Design.pak
packages/desktop-gui/cypress/videos
packages/desktop-gui/src/jsconfig.json

# from driver
packages/driver/test/cypress/videos
packages/driver/test/cypress/screenshots

# from example
packages/example/app
packages/example/build
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"@types/mini-css-extract-plugin": "0.8.0",
"@types/mocha": "5.2.7",
"@types/node": "12.12.21",
"@types/prismjs": "1.16.0",
"@types/ramda": "0.25.47",
"@types/react": "^16.9.27",
"@types/react-dom": "16.9.4",
Expand Down
75 changes: 74 additions & 1 deletion packages/desktop-gui/cypress/integration/settings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ describe('Settings', () => {
})

it('opens ci guide when learn more is clicked', () => {
cy.get('.settings-record-key').contains('Learn More').click().then(function () {
cy.get('.settings-record-key').contains('Learn more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/what-is-a-record-key')
})
})
Expand Down Expand Up @@ -752,6 +752,79 @@ describe('Settings', () => {
})
})

describe('file preference panel', () => {
const availableEditors = [
{ id: 'atom', name: 'Atom', isOther: false, openerId: 'atom' },
{ id: 'vim', name: 'Vim', isOther: false, openerId: 'vim' },
{ id: 'sublime', name: 'Sublime Text', isOther: false, openerId: 'sublime' },
{ id: 'vscode', name: 'Visual Studio Code', isOther: false, openerId: 'vscode' },
{ id: 'other', name: 'Other', isOther: true, openerId: '' },
]

beforeEach(function () {
this.getUserEditor = this.util.deferred()
cy.stub(this.ipc, 'getUserEditor').returns(this.getUserEditor.promise)
cy.stub(this.ipc, 'setUserEditor').resolves()

this.openProject.resolve(this.config)
this.projectStatuses[0].id = this.config.projectId
this.getProjectStatus.resolve(this.projectStatuses[0])

this.goToSettings()

cy.contains('File Opener Preference').click()
})

it('displays file preference section', () => {
cy.contains('Your preference is used to open files')
})

it('opens file preference guide when learn more is clicked', () => {
cy.get('.file-preference').contains('Learn more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/file-opener-preference')
})
})

it('loads preferred editor and available editors', function () {
expect(this.ipc.getUserEditor).to.be.called
})

it('shows spinner', () => {
cy.get('.loading-editors')
})

describe('when editors load with preferred editor', () => {
beforeEach(function () {
this.getUserEditor.resolve({ availableEditors, preferredOpener: availableEditors[3] })
})

it('displays available editors with preferred one selected', () => {
cy.get('.loading-editors').should('not.exist')
cy.contains('Atom')
cy.contains('Other')
cy.contains('Visual Studio Code').closest('li').should('have.class', 'is-selected')
})

it('sets editor through ipc when a different editor is selected', function () {
cy.contains('Atom').click()
.closest('li').should('have.class', 'is-selected')

cy.wrap(this.ipc.setUserEditor).should('be.calledWith', availableEditors[0])
})
})

describe('when editors load without preferred editor', () => {
beforeEach(function () {
this.getUserEditor.resolve({ availableEditors })
})

it('does not select an editor', () => {
cy.get('.loading-editors').should('not.exist')
cy.get('.editor-picker li').should('not.have.class', 'is-selected')
})
})
})

describe('errors', () => {
const errorText = 'An unexpected error occurred'

Expand Down
16 changes: 8 additions & 8 deletions packages/desktop-gui/src/app/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,6 @@
margin-right: 4px;
}

.browser-beta {
font-size: 12px;
top: -5px;
position: relative;
margin-left: 4px;
color: #d87b0b;
}

.browser-info-tooltip {
background: #ececec;
border-color: #c7c7c7;
Expand All @@ -269,6 +261,14 @@
}
}

.dropdown .browser-beta {
font-size: 12px;
top: -5px;
position: relative;
margin-left: 4px;
color: #d8a10b;
}

.close-browser {
.btn {
padding: 6px 9px;
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-gui/src/lib/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ register('get:project:statuses')
register('get:project:status')
register('get:record:keys')
register('get:specs', false)
register('get:user:editor')
register('set:user:editor')
register('launch:browser', false)
register('log:out')
register('on:focus:tests', false)
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-gui/src/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
@import 'styles/components/*';
@import '!(styles)*/**/*';
@import '../../ui-components/src/dropdown';
@import '../../ui-components/src/editor-picker';
71 changes: 71 additions & 0 deletions packages/desktop-gui/src/settings/file-preference.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import _ from 'lodash'
import { action } from 'mobx'
import { EditorPicker } from '@packages/ui-components'
import { observer, useLocalStore } from 'mobx-react'
import React, { useEffect } from 'react'

import ipc from '../lib/ipc'

const openHelp = (e) => {
e.preventDefault()
ipc.externalOpen('https://on.cypress.io/file-opener-preference')
}

const save = _.debounce((editor) => {
ipc.setUserEditor(editor)
.catch(() => {}) // ignore errors
}, 500)

const FilePreference = observer(() => {
const state = useLocalStore(() => ({
editors: [],
isLoadingEditor: true,
chosenEditor: {},
setEditors: action((editors) => {
state.editors = editors
state.isLoadingEditor = false
}),
setChosenEditor: action((editor) => {
state.chosenEditor = editor
save(editor)
}),
setOtherPath: action((otherPath) => {
const otherOption = _.find(state.editors, { isOther: true })

otherOption.openerId = otherPath
save(otherOption)
}),
}))

useEffect(() => {
ipc.getUserEditor().then(({ preferredOpener, availableEditors }) => {
if (preferredOpener) {
state.setChosenEditor(preferredOpener)
}

state.setEditors(availableEditors)
})
}, [true])

return (
<div className='file-preference'>
<a href='#' className='learn-more' onClick={openHelp}>
<i className='fas fa-info-circle'></i> Learn more
</a>
<p>Your preference is used to open files from the Test Runner <em>(e.g. when clicking links in error stack traces)</em></p>
{state.isLoadingEditor ?
<p className='loading-editors'>
<i className='fas fa-spinner fa-spin'></i> Loading Editors...
</p> :
<EditorPicker
chosen={state.chosenEditor}
editors={state.editors}
onSelect={state.setChosenEditor}
onUpdateOtherPath={state.setOtherPath}
/>
}
</div>
)
})

export default FilePreference
3 changes: 1 addition & 2 deletions packages/desktop-gui/src/settings/record-key.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class RecordKey extends Component {
return (
<div>
<a href='#' className='learn-more' onClick={openRecordKeyGuide}>
<i className='fas fa-info-circle'></i>{' '}
Learn More
<i className='fas fa-info-circle'></i> Learn more
</a>
<p className='text-muted'>
A Record Key sends your failing tests, screenshots, and videos to your{' '}
Expand Down
10 changes: 7 additions & 3 deletions packages/desktop-gui/src/settings/settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ProjectId from './project-id'
import RecordKey from './record-key'
import ProxySettings from './proxy-settings'
import NodeVersion from './node-version'
import FilePreference from './file-preference'
import Experiments from './experiments'

import { getExperiments, experimental } from '@packages/server/lib/experiments'
Expand Down Expand Up @@ -45,10 +46,13 @@ const Settings = observer(({ project, app }) => {
<Panel header='Proxy Settings' key='proxy-settings' className='form-horizontal settings-proxy'>
<ProxySettings app={app} />
</Panel>
{hasExperiments &&
<Panel header='Experiments' key='experiments' className='form-horizontal settings-experiments'>
<Experiments project={project} />
<Panel header='File Opener Preference' key='file-preference' className='form-horizontal settings-file-preference'>
<FilePreference />
</Panel>
{hasExperiments &&
<Panel header='Experiments' key='experiments' className='form-horizontal settings-experiments'>
<Experiments project={project} />
</Panel>
}
</Collapse>
</div>
Expand Down
14 changes: 14 additions & 0 deletions packages/desktop-gui/src/settings/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,20 @@
}
}

.editor-picker {
margin: 0;
padding: 0;

li {
list-style: none;
}

label {
margin: 0;
font-weight: normal;
}
}

.experiment-intro {
padding-bottom: 15px;
margin-bottom: 0px;
Expand Down
11 changes: 8 additions & 3 deletions packages/desktop-gui/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import commonConfig, { HtmlWebpackPlugin } from '@packages/web-config/webpack.config.base'
import getCommonConfig, { HtmlWebpackPlugin } from '@packages/web-config/webpack.config.base'
import path from 'path'
import webpack from 'webpack'

const config: typeof commonConfig = {
...commonConfig,
// @ts-ignore
const config: webpack.Configuration = {
...getCommonConfig(),
entry: {
app: [require.resolve('@babel/polyfill'), path.resolve(__dirname, 'src/main')],
},
Expand All @@ -26,7 +28,10 @@ config.plugins = [
config.resolve = {
...config.resolve,
alias: {
'bluebird': require.resolve('bluebird'),
'lodash$': require.resolve('lodash'),
'mobx': require.resolve('mobx'),
'mobx-react': require.resolve('mobx-react'),
'react': require.resolve('react'),
'react-dom': require.resolve('react-dom'),
},
Expand Down
3 changes: 3 additions & 0 deletions packages/driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"start": "$(yarn bin coffee) test/support/server.coffee"
},
"devDependencies": {
"@babel/code-frame": "^7.0.0",
"@cypress/bower-kendo-ui": "0.0.2",
"@cypress/sinon-chai": "1.1.0",
"@cypress/underscore.inflection": "1.0.1",
Expand Down Expand Up @@ -37,6 +38,7 @@
"cors": "2.8.5",
"cypress-multi-reporters": "1.2.4",
"debug": "4.1.1",
"error-stack-parser": "2.0.6",
"errorhandler": "1.5.1",
"eventemitter2": "4.1.2",
"express": "4.16.4",
Expand All @@ -60,6 +62,7 @@
"react-dom-16.0.0": "npm:react-dom@16.0.0",
"setimmediate": "1.0.5",
"sinon": "8.1.1",
"source-map": "0.7.3",
"text-mask-addons": "3.8.0",
"underscore": "1.9.1",
"underscore.string": "3.3.5",
Expand Down
6 changes: 6 additions & 0 deletions packages/driver/src/cy/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const create = function (state, queue, retryFn) {
// them up with existing ones
cmd.set('assertionIndex', 0)

if (state('current') != null) {
state('current').set('currentAssertionCommand', cmd)
}

return cmd.get('fn').originalFn.apply(
state('ctx'),
[subject].concat(cmd.get('args')),
Expand Down Expand Up @@ -202,6 +206,8 @@ const create = function (state, queue, retryFn) {
err = e2
}

err.isDefaultAssertionErr = isDefaultAssertionErr

options.error = err

if (err.retry === false) {
Expand Down
Loading