-
Notifications
You must be signed in to change notification settings - Fork 337
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
Show hint about :auto on CALL {...} IN TRANSACTIONS #1637
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ed2a47d
Update :auto hint
OskarDamkjaer d81ca6b
Update regex to match new error texts
OskarDamkjaer 50efeaa
Update tests
OskarDamkjaer c59333c
update e2e test to be more flexible
OskarDamkjaer effc682
update e2e test
OskarDamkjaer e7e5cfc
Add comment to e2e test
OskarDamkjaer File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright (c) 2002-2021 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
describe(':auto prefix in browser', () => { | ||
before(() => { | ||
cy.visit(Cypress.config('url')).title().should('include', 'Neo4j Browser') | ||
cy.wait(3000) | ||
cy.ensureConnection() | ||
}) | ||
beforeEach(() => { | ||
cy.executeCommand(':clear') | ||
}) | ||
|
||
it('shows help link when running period commit without :auto', () => { | ||
cy.executeCommand('USING PERIODIC COMMIT RETURN "Verdanturf"') | ||
cy.getFrames().contains('ERROR') | ||
cy.getFrames().contains(':auto') | ||
}) | ||
|
||
it('adding :auto enables running periodic commit', () => { | ||
cy.executeCommand(':auto USING PERIODIC COMMIT RETURN "Laverre";') | ||
// the only valid PERIODIC COMMIT queries require csv files on | ||
// the server, so as a shortcut we're just looking for a new error message | ||
cy.getFrames().contains('ERROR') | ||
cy.getFrames().contains(/LOAD/i) | ||
}) | ||
|
||
if (Cypress.config('serverVersion') >= 4.4) { | ||
it('shows help link when running CALL IN TRANSACTIONS without :auto', () => { | ||
cy.executeCommand( | ||
'CALL {{} return "Dendemille" } IN TRANSACTIONS return "Dendemille";' | ||
) | ||
cy.getFrames().contains('ERROR') | ||
cy.getFrames().contains(':auto') | ||
}) | ||
|
||
it('adding :auto enables running CALL IN TRANSACTIONS', () => { | ||
cy.executeCommand( | ||
':auto CALL {{} return "Undella" } IN TRANSACTIONS return "Undella";' | ||
) | ||
cy.getFrames().should('not.contain', 'ERROR') | ||
cy.getFrames().contains('"Undella"') | ||
}) | ||
} | ||
|
||
it('can use :auto command in multi-statements', () => { | ||
cy.executeCommand('create ();') | ||
cy.executeCommand(':clear') | ||
const query = `:auto CREATE (t:MultiStmtTest {{}name: "Pacifidlog"}) RETURN t;:auto CREATE (t:MultiStmtTest {{}name: "Wyndon"}) RETURN t;` | ||
cy.executeCommand(query) | ||
cy.get('[data-testid="frame"]', { timeout: 10000 }).should('have.length', 1) | ||
const frame = cy.get('[data-testid="frame"]', { timeout: 10000 }).first() | ||
frame.find('[data-testid="multi-statement-list"]').should('have.length', 1) | ||
frame | ||
.get('[data-testid="multi-statement-list-title"]') | ||
.should('have.length', 2) | ||
frame.get('[data-testid="multi-statement-list-title"]').eq(0).click() | ||
frame | ||
.get('[data-testid="multi-statement-list-content"]', { timeout: 10000 }) | ||
.contains('SUCCESS') | ||
frame.get('[data-testid="multi-statement-list-title"]').eq(1).click() | ||
frame | ||
.get('[data-testid="multi-statement-list-content"]', { timeout: 10000 }) | ||
.contains('SUCCESS') | ||
cy.executeCommand('match (n: MultiStmtTest) return n.name') | ||
cy.get('[role="cell"]').contains('Pacifidlog') | ||
cy.get('[role="cell"]').contains('Wyndon') | ||
cy.executeCommand('match (n: MultiStmtTest) delete n') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining why we're looking for an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, it definitely looks a bit odd