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

Make commands editable and re-usable #1268

Merged
merged 63 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
308bd55
clean up unused styling
Nov 16, 2020
a4ba072
Fix compile issues
OskarDamkjaer Nov 3, 2020
7e462a6
mellan
OskarDamkjaer Nov 4, 2020
c4cc712
Wrestle some more types
OskarDamkjaer Nov 4, 2020
88841f4
Frame header ts
OskarDamkjaer Nov 6, 2020
d57a96b
Titlebar ts
OskarDamkjaer Nov 6, 2020
97fa2ba
battling with style
OskarDamkjaer Nov 18, 2020
c443268
Add monaco
OskarDamkjaer Nov 19, 2020
f52ae74
add todos for where i left off
OskarDamkjaer Nov 19, 2020
425eb21
Merge
OskarDamkjaer Nov 26, 2020
e0af9d9
start history
OskarDamkjaer Nov 26, 2020
00a4fa2
remove unused options
OskarDamkjaer Nov 27, 2020
28785d1
Solve bug where guides and help would not re-use
OskarDamkjaer Nov 30, 2020
d1740eb
Convert to function component
OskarDamkjaer Nov 30, 2020
dde3667
Write stream as fucntion comp
OskarDamkjaer Nov 30, 2020
5e89426
Re-write animation to prevent extra rolling
OskarDamkjaer Nov 30, 2020
c3cc708
Repair run button
OskarDamkjaer Nov 30, 2020
bce7218
Remove logs and error in console
OskarDamkjaer Nov 30, 2020
a8d1dc2
Keep focus when swithcing framtype
OskarDamkjaer Dec 1, 2020
3d994d9
Focus management work around
OskarDamkjaer Dec 1, 2020
c4bcfcd
Fix animation bug
OskarDamkjaer Dec 1, 2020
38bd753
Remove todos and move deps
OskarDamkjaer Dec 1, 2020
cb5c28a
Fix bug going from graph result to table result
OskarDamkjaer Dec 1, 2020
d890ad7
Enable multistatements to be re-runnable
OskarDamkjaer Dec 2, 2020
adbf903
Full screen only small frame
OskarDamkjaer Dec 2, 2020
309a54c
Make animation more efficient and fix fullscreen issue
OskarDamkjaer Dec 2, 2020
4f9c41d
Remove react-spring
OskarDamkjaer Dec 3, 2020
6f5c1ce
meln
OskarDamkjaer Dec 3, 2020
75d656f
Nice resizing
OskarDamkjaer Dec 3, 2020
43e072b
Add ignore comment
OskarDamkjaer Dec 3, 2020
6e670a8
Merge
OskarDamkjaer Dec 3, 2020
0c67d59
Add feature toggle for re-usable frame
OskarDamkjaer Dec 4, 2020
b92fe6a
Cancel debounced calls on unmount
OskarDamkjaer Dec 4, 2020
051ef2f
Add history
OskarDamkjaer Dec 4, 2020
70eb871
Fix height
OskarDamkjaer Dec 4, 2020
d9e8f87
Self review
OskarDamkjaer Dec 14, 2020
30e7515
more self review
OskarDamkjaer Dec 14, 2020
83099bd
Add safari width fix and work on tests
OskarDamkjaer Dec 14, 2020
2c289c5
Fix version
OskarDamkjaer Dec 14, 2020
5fd2090
Fix test
OskarDamkjaer Dec 14, 2020
5cc46f3
fix ts checker
OskarDamkjaer Dec 15, 2020
7283ef0
Remove unused history state and set position better
OskarDamkjaer Dec 15, 2020
a011aa2
Fix function naming
OskarDamkjaer Dec 15, 2020
3bc93d6
Update licenses
OskarDamkjaer Dec 15, 2020
5059e88
Re-add dotted line
OskarDamkjaer Dec 15, 2020
e88f9d5
Fix command duck tests
OskarDamkjaer Dec 15, 2020
49fbb14
Fix :edit frame
OskarDamkjaer Dec 15, 2020
1655bb7
Add custom cmd
OskarDamkjaer Dec 16, 2020
0231985
Fix and improve e2e tests
OskarDamkjaer Dec 17, 2020
f30196f
Fix merge issues
OskarDamkjaer Jan 21, 2021
11d370c
Update licenses
OskarDamkjaer Jan 21, 2021
1a5e6c8
Re add midssed file
OskarDamkjaer Jan 21, 2021
7b8ba49
Update snapshots
OskarDamkjaer Jan 21, 2021
f8de7a6
Add data-test-id
OskarDamkjaer Jan 21, 2021
1784b82
Fix minor errors and allow only one fullscreen at a time
OskarDamkjaer Jan 29, 2021
63f9702
Fix padding issue
OskarDamkjaer Jan 29, 2021
1427e71
Fix unit tests
OskarDamkjaer Jan 29, 2021
ad4055c
Update e2e tests
OskarDamkjaer Jan 29, 2021
e35d9b0
Fix e2e tests
OskarDamkjaer Jan 29, 2021
372bcd3
Remove unneeded test-id
OskarDamkjaer Jan 29, 2021
7137059
Remove conditional render of fullscreen button
OskarDamkjaer Jan 29, 2021
8710e92
Fix review comments
OskarDamkjaer Jan 30, 2021
3589745
Fix e2e test
OskarDamkjaer Jan 30, 2021
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
32 changes: 16 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@
"react"
],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/ban-types": "off",
"react/prop-types": "off",
"prefer-spread": "off",
"react/no-unescaped-entities": "off",
"no-var": "off",
"@typescript-eslint/no-unused-vars": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-this-alias": "off",
"prefer-rest-params": "off",
"@typescript-eslint/no-var-requires": "off",
"react-hooks/rules-of-hooks": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/ban-types": "warn",
"react/prop-types": "warn",
"prefer-spread": "warn",
"react/no-unescaped-entities": "warn",
"no-var": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-this-alias": "warn",
"prefer-rest-params": "warn",
"@typescript-eslint/no-var-requires": "warn",
"react-hooks/rules-of-hooks": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off", // remove this when migrated fully to ts. right now it makes warnings unreadable
"@typescript-eslint/ban-ts-comment": "off", // remove this when typings for react-spring allow multiple animation stages,
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-explicit-any": "warn", // remove this when migrated fully to ts. right now it makes warnings unreadable
"@typescript-eslint/ban-ts-comment": "warn", // remove this when typings for react-spring allow multiple animation stages,
"@typescript-eslint/no-non-null-assertion": "warn"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ SOFTWARE.

-----

The following software may be included in this product: @types/asap, @types/color-name, @types/dateformat, @types/file-saver, @types/hoist-non-react-statics, @types/jsonic, @types/long, @types/mdast, @types/parse-json, @types/prop-types, @types/shallowequal, @types/unist, @types/url-parse. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/asap), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/color-name), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/dateformat), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/file-saver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hoist-non-react-statics), https://github.com/DefinitelyTyped/DefinitelyTyped.git.git (@types/jsonic), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/long), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mdast), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse-json), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prop-types), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/shallowequal), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/unist), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/url-parse). This software contains the following license and notice below:
The following software may be included in this product: @types/asap, @types/color-name, @types/hoist-non-react-statics, @types/long, @types/mdast, @types/parse-json, @types/prop-types, @types/shallowequal, @types/unist. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/asap), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/color-name), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hoist-non-react-statics), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/long), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mdast), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse-json), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prop-types), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/shallowequal), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/unist). This software contains the following license and notice below:

MIT License

Expand All @@ -1206,7 +1206,7 @@ MIT License

-----

The following software may be included in this product: @types/d3, @types/hast, @types/invariant, @types/node, @types/parse5, @types/react, @types/semver, @types/zen-observable. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/d3), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hast), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/invariant), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse5), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/semver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/zen-observable). This software contains the following license and notice below:
The following software may be included in this product: @types/hast, @types/invariant, @types/node, @types/parse5, @types/react, @types/zen-observable. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hast), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/invariant), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse5), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/zen-observable). This software contains the following license and notice below:

MIT License

Expand Down
22 changes: 5 additions & 17 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Third-party licenses
│ ├─ long@4.0.0
│ │ ├─ URL: https://github.com/dcodeIO/long.js.git
│ │ └─ VendorName: Daniel Wirtz
│ ├─ neo4j-driver@4.1.2
│ ├─ neo4j-driver@4.2.2
│ │ ├─ URL: git://github.com/neo4j/neo4j-javascript-driver.git
│ │ └─ VendorName: Neo4j
│ ├─ oauth-sign@0.9.0
Expand Down Expand Up @@ -283,6 +283,10 @@ Third-party licenses
│ │ ├─ URL: http://github.com/garycourt/uri-js
│ │ ├─ VendorName: Gary Court
│ │ └─ VendorUrl: https://github.com/garycourt/uri-js
│ ├─ uri-js@4.4.1
│ │ ├─ URL: http://github.com/garycourt/uri-js
│ │ ├─ VendorName: Gary Court
│ │ └─ VendorUrl: https://github.com/garycourt/uri-js
│ └─ webidl-conversions@3.0.1
│ ├─ URL: https://github.com/jsdom/webidl-conversions.git
│ ├─ VendorName: Domenic Denicola
Expand Down Expand Up @@ -661,20 +665,12 @@ Third-party licenses
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/color-name@1.1.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/d3@3.5.44
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/dateformat@3.0.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/file-saver@2.0.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/hast@2.3.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/hoist-non-react-statics@3.3.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/invariant@2.2.34
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/jsonic@0.3.0
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git.git
│ ├─ @types/long@4.0.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/mdast@3.0.3
Expand All @@ -691,14 +687,10 @@ Third-party licenses
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/react@16.9.49
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/semver@7.3.4
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/shallowequal@1.1.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/unist@2.0.3
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/url-parse@1.4.3
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @types/zen-observable@0.8.1
│ │ └─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
│ ├─ @wry/context@0.5.2
Expand Down Expand Up @@ -1524,10 +1516,6 @@ Third-party licenses
│ │ ├─ URL: https://github.com/reduxjs/react-redux.git
│ │ ├─ VendorName: Dan Abramov
│ │ └─ VendorUrl: https://github.com/reduxjs/react-redux
│ ├─ react-spring@8.0.27
│ │ ├─ URL: git+https://github.com/drcmda/react-spring.git
│ │ ├─ VendorName: Paul Henschel
│ │ └─ VendorUrl: https://github.com/drcmda/react-spring#readme
│ ├─ react-suber@1.0.4
│ │ ├─ URL: https://github.com/oskarhane/react-suber.git
│ │ ├─ VendorName: Oskar Hane
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/webpack-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module.exports = () => {
}),
new ForkTsCheckerNotifierWebpackPlugin({
title: 'TypeScript',
excludeWarnings: false
excludeWarnings: true // remove as we move to ts
OskarDamkjaer marked this conversation as resolved.
Show resolved Hide resolved
}),
new MonacoWebpackPlugin({
features: [
Expand Down
32 changes: 12 additions & 20 deletions e2e_tests/integration/0.index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ describe('Neo4j Browser', () => {
cy.setInitialPassword(newPassword)
cy.disconnect()
})
it('populates the editor when clicking the connect banner', () => {

it(':server disconnect frame is re-runnable', () => {
cy.get('[data-testid="disconnectedBannerCode"]').click()
cy.get('[data-testid="frameCommand"]')
.first()
.should('contain', ':server connect')
cy.get('[data-testid="activeEditor"] [data-testid="editor-discard"]')
cy.get('[data-testid="frameCommand"]').contains(':server connect')
cy.typeInFrame(':play movies{enter}', 0)
cy.get('[data-testid=frame]').contains('the Bacon Path')
})
it('can connect', () => {
const password = Cypress.config('password')
Expand All @@ -55,9 +55,7 @@ describe('Neo4j Browser', () => {
const query = 'MATCH (n) DETACH DELETE n'
cy.executeCommand(query)
cy.waitForCommandResult()
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
cy.get('[data-testid="frameStatusbar"]', { timeout: 100000 })
.first()
.contains(/completed/i)
Expand All @@ -67,9 +65,7 @@ describe('Neo4j Browser', () => {
const query = 'RETURN 1'
cy.executeCommand(query)
cy.waitForCommandResult()
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
cy.get('[data-testid="frameStatusbar"]', { timeout: 10000 })
.first()
.should('contain', 'Started streaming')
Expand All @@ -78,9 +74,7 @@ describe('Neo4j Browser', () => {
cy.executeCommand(':clear')
const query = ':unknown'
cy.executeCommand(query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
cy.get('[data-testid="frame"]', { timeout: 10000 })
.first()
.should('contain', 'Error')
Expand All @@ -89,9 +83,7 @@ describe('Neo4j Browser', () => {
cy.executeCommand(':clear')
const query = ':play movies'
cy.executeCommand(query)
cy.get('[data-testid="frameCommand"]')
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]').contains(query)
cy.get(Carousel)
.find('[data-testid="nextSlide"]')
.click()
Expand All @@ -106,9 +98,9 @@ describe('Neo4j Browser', () => {
.click()
cy.get(SubmitQueryButton).click()
cy.waitForCommandResult()
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', 'Emil Eifrem')
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(
'Keanu Reeves'
)
})
it('can display meta items from side drawer', () => {
cy.executeCommand(':clear')
Expand Down
8 changes: 8 additions & 0 deletions e2e_tests/integration/commands.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,12 @@ describe('Commands', () => {
cy.executeCommand(':clear')
})
})

it('can re-run all simple commands while connected without blowing up', () => {
cy.executeCommand('return 1')
commands.forEach(cmd => {
cy.typeInFrame(`${cmd}{enter}`)
cy.wait(300)
})
})
})
2 changes: 1 addition & 1 deletion e2e_tests/integration/connect-form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('Connect form', () => {
`Automatic retry using the "${schemeWithEncryptionFlag('bolt')}"`
)
cy.wait(7000) // auto retry is in 5 secs
getFirstFrameCommand().should('contain', ':play start')
getFirstFrameCommand().contains(':play start')
cy.executeCommand(':server disconnect')
cy.executeCommand(':clear')
})
Expand Down
4 changes: 2 additions & 2 deletions e2e_tests/integration/desktop-env-url.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Neo4j Desktop environment using url field', () => {
frames.should('have.length', 2)

// Auto connected = :play start
frames.first().should('contain', ':play start')
frames.first().contains(':play start')
cy.wait(1000)
})
it('switches connection when that event is triggered using url field', () => {
Expand All @@ -63,7 +63,7 @@ describe('Neo4j Desktop environment using url field', () => {
const frames = cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
frames.should('have.length', 1)

frames.first().should('contain', ':server switch success')
frames.first().contains(':server switch success')

cy.get('[data-testid="frame"]', { timeout: 10000 })
.first()
Expand Down
6 changes: 3 additions & 3 deletions e2e_tests/integration/desktop-env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Neo4j Desktop environment', () => {
frames.should('have.length', 2)

// Auto connected = :play start
frames.first().should('contain', ':play start')
frames.first().contains(':play start')
cy.wait(1000)
})
it('switches connection when that event is triggered using host + port fields', () => {
Expand All @@ -57,7 +57,7 @@ describe('Neo4j Desktop environment', () => {
const frames = cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
frames.should('have.length', 1)

frames.first().should('contain', ':server switch success')
frames.first().contains(':server switch success')

cy.get('[data-testid="frame"]', { timeout: 10000 })
.first()
Expand All @@ -79,7 +79,7 @@ describe('Neo4j Desktop environment', () => {
const frames = cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
frames.should('have.length', 1)

frames.first().should('contain', ':server switch fail')
frames.first().contains(':server switch fail')

cy.get('[data-testid="disconnectedBanner"]', { timeout: 10000 })
.first()
Expand Down
10 changes: 4 additions & 6 deletions e2e_tests/integration/multi-db.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ describe('Multi database', () => {

// Select to use db, make sure backticked
databaseOptionList().select('name-with-dash')
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', ':use `name-with-dash`')
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(
':use `name-with-dash`'
)
cy.resultContains(
'Queries from this point and forward are using the database'
)
Expand Down Expand Up @@ -203,9 +203,7 @@ describe('Multi database', () => {
)

// Click re-run
cy.get('[data-testid="rerunFrameButton"]', { timeout: 10000 })
.first()
.click()
cy.get('[data-testid="rerunFrameButton"]', { timeout: 10000 }).click()

// Make sure we have what we expect
cy.get('[data-testid="frame"]', { timeout: 10000 })
Expand Down
6 changes: 3 additions & 3 deletions e2e_tests/integration/multistatements.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ describe('Multi statements', () => {

// Then
// Error expected
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', validQuery)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(
validQuery
)
cy.get('[data-testid="frameContents"]', { timeout: 10000 })
.first()
.should('contain', 'Error')
Expand Down
4 changes: 1 addition & 3 deletions e2e_tests/integration/style.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ describe(':style', () => {

const query = ':style'
cy.executeCommand(query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
cy.get('[data-testid="frameContents"]', { timeout: 10000 })
.first()
.should('contain', 'node {')
Expand Down
8 changes: 2 additions & 6 deletions e2e_tests/integration/topics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ describe('Help topics', () => {
cy.executeCommand(':clear')
const query = ':help commands'
cy.executeCommand(query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
OskarDamkjaer marked this conversation as resolved.
Show resolved Hide resolved
cy.get('[data-testid="frameContents"]', { timeout: 10000 })
.first()
.should('contain', ':help style')
Expand All @@ -42,9 +40,7 @@ describe('Help topics', () => {
cy.executeCommand(':clear')
const query = ':help style'
cy.executeCommand(query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy.get('[data-testid="frameCommand"]', { timeout: 10000 }).contains(query)
cy.get('[data-testid="frameContents"]', { timeout: 10000 })
.first()
.should('contain', 'style command')
Expand Down
19 changes: 14 additions & 5 deletions e2e_tests/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Cypress.Commands.add(
cy.get('button[data-testid="changePassword"]').click()

cy.get('input[data-testid="changePassword"]').should('not.be.visible')
cy.get('[data-testid="frameCommand"]', { timeout: 30000 }).should(
'contain',
cy.get('[data-testid="frame"]', { timeout: 25000 }).should('have.length', 2)
cy.get('[data-testid="frameCommand"]', { timeout: 30000 }).contains(
':play start'
)
}
Expand Down Expand Up @@ -90,9 +90,7 @@ Cypress.Commands.add(
2
)
cy.wait(500)
cy.get('[data-testid="frameCommand"]')
.first()
.should('contain', ':play start')
cy.get('[data-testid="frameCommand"]').contains(':server connect')
cy.executeCommand(':clear')
}
}
Expand All @@ -102,6 +100,17 @@ Cypress.Commands.add('disconnect', () => {
cy.executeCommand(query)
})

Cypress.Commands.add('typeInFrame', (cmd: string, frameIndex = 0) => {
cy.get('[id^=monaco-]')
.eq(frameIndex + 1) // the first monaco editor is the main one
.type(
Cypress.platform === 'darwin'
? '{cmd}a {backspace}'
: '{ctrl}a {backspace}'
)
.type(cmd)
})

Cypress.Commands.add('executeCommand', (query, options = {}) => {
cy.get(VisibleEditor).click()
cy.get(EditorTextField).type(query, { force: true, ...options })
Expand Down
4 changes: 4 additions & 0 deletions e2e_tests/support/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ declare global {
boltUrl?: string,
force?: boolean
): Cypress.Chainable<void>
/**
* Custom command to type a command in a frame
*/
typeInFrame(cmd: string, frameIndex?: number): Cypress.Chainable<void>
/**
* Custom command to type and submit query in cypher editor.
* @example cy.executeCommand(':clear')
Expand Down
Loading