Skip to content

Commit

Permalink
Now?
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarhane committed Aug 31, 2018
1 parent aa40363 commit c13ab40
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 188 deletions.
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"animationDistanceThreshold": 5,
"baseUrl": null,
"chromeWebSecurity": true,
"chromeWebSecurity": false,
"defaultCommandTimeout": 4000,
"environmentVariables": {},
"execTimeout": 60000,
Expand Down
1 change: 0 additions & 1 deletion e2e_tests/cypress.json

This file was deleted.

4 changes: 2 additions & 2 deletions e2e_tests/integration/0.index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ClearEditorButton = '[data-test-id="clearEditorContent"]'

describe('Neo4j Browser', () => {
it('sets new login credentials', () => {
const newPassword = Cypress.env('browser-password') || 'newpassword'
const newPassword = Cypress.config.password
cy.setInitialPassword(newPassword)
cy.disconnect()
})
Expand All @@ -37,7 +37,7 @@ describe('Neo4j Browser', () => {
cy.get(ClearEditorButton).click()
})
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/integration/bolt.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Bolt connections', () => {
})
it('users with no role can connect', () => {
cy.executeCommand(':clear')
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
14 changes: 11 additions & 3 deletions e2e_tests/integration/commands.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ describe('Commands', () => {
})
it('can show connection error', () => {
const password = 'unlikely password'
cy.connect('neo4j', password, undefined, false)
cy.connect(
'neo4j',
password,
undefined,
false
)
})
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
cy.connect('neo4j', password)
const password = Cypress.config.password
cy.connect(
'neo4j',
password
)
})
it('can run all simple commands while connected without blowing up', () => {
commands.forEach(cmd => {
Expand Down
18 changes: 10 additions & 8 deletions e2e_tests/integration/desktop-env.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ let appContextListener

describe('Neo4j Desktop environment', () => {
it('loads with fake desktop api injected', () => {
cy.visit(Cypress.env('BROWSER_URL') || 'http://localhost:8080', {
cy.visit(Cypress.config.url, {
onBeforeLoad: win => {
win.neo4jDesktopApi = {
getContext: () => Promise.resolve(context),
getContext: () => Promise.resolve(getContext()),
onContextUpdate: fn => (appContextListener = fn.bind(fn))
}
}
Expand All @@ -44,7 +44,7 @@ describe('Neo4j Desktop environment', () => {
it('switches connection when that event is triggered', () => {
cy.executeCommand(':clear')
cy.wait(1000).then(() => {
appContextListener({ type: 'GRAPH_ACTIVE', id: 'test' }, context)
appContextListener({ type: 'GRAPH_ACTIVE', id: 'test' }, getContext())
})

const frames = cy.get('[data-test-id="frameCommand"]', { timeout: 10000 })
Expand All @@ -58,7 +58,7 @@ describe('Neo4j Desktop environment', () => {
})
})

const context = {
const getContext = () => ({
projects: [
{
graphs: [
Expand All @@ -71,15 +71,17 @@ const context = {
bolt: {
enabled: true,
username: 'neo4j',
password: Cypress.env('browser-password') || 'newpassword',
password: Cypress.config.password,
host: 'localhost',
port: '7687',
tlsLevel: 'OPTIONAL'
tlsLevel: Cypress.config.url.startsWith('https')
? 'REQUIRED'
: 'OPTIONAL'
},
http: {
enabled: true,
username: 'neo4j',
password: Cypress.env('browser-password') || 'newpassword',
password: Cypress.config.password,
host: 'localhost',
port: '7474'
}
Expand All @@ -90,4 +92,4 @@ const context = {
]
}
]
}
})
7 changes: 5 additions & 2 deletions e2e_tests/integration/loadcsv.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

describe('LOAD CSV', () => {
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
cy.connect('neo4j', password)
const password = Cypress.config.password
cy.connect(
'neo4j',
password
)
})
it('imports without periodic commit', () => {
if (!Cypress.config.includeImportTests) {
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/integration/multistatements.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Multi statements', () => {
cy.get('[data-test-id="drawerSettings"]').click()
})
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/integration/params.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function runTests () {
let setParamQ
let getParamQ
// it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/integration/plan.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

describe('Plan output', () => {
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
19 changes: 9 additions & 10 deletions e2e_tests/integration/style.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

describe(':style', () => {
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
cy.connect('neo4j', password)
const password = Cypress.config.password
cy.connect(
'neo4j',
password
)
})
it('print the current style', () => {
cy.executeCommand(':clear')
Expand All @@ -33,12 +36,10 @@ describe(':style', () => {

const query = ':style'
cy.executeCommand(query)
cy
.get('[data-test-id="frameCommand"]', { timeout: 10000 })
cy.get('[data-test-id="frameCommand"]', { timeout: 10000 })
.first()
.should('contain', query)
cy
.get('[data-test-id="frameContents"]', { timeout: 10000 })
cy.get('[data-test-id="frameContents"]', { timeout: 10000 })
.first()
.should('contain', 'node {')
.should('contain', 'relationship {')
Expand All @@ -48,12 +49,10 @@ describe(':style', () => {
cy.executeCommand(':clear')
cy.executeCommand(':style')
cy.get('[data-test-id="exportGrassButton"]', { timeout: 10000 })
cy
.get('[data-test-id="styleResetButton"]', { timeout: 10000 })
cy.get('[data-test-id="styleResetButton"]', { timeout: 10000 })
.first()
.click()
cy
.get('[data-test-id="frameContents"]', { timeout: 10000 })
cy.get('[data-test-id="frameContents"]', { timeout: 10000 })
.first()
.should('contain', 'No style generated or set yet')
})
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/integration/types.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

describe('Types in Browser', () => {
it('can connect', () => {
const password = Cypress.env('browser-password') || 'newpassword'
const password = Cypress.config.password
cy.connect(
'neo4j',
password
Expand Down
2 changes: 2 additions & 0 deletions e2e_tests/support/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

Cypress.config.serverVersion = parseFloat(Cypress.env('server')) || 3.4
Cypress.config.includeImportTests = Cypress.env('include-import-tests') || false
Cypress.config.url = Cypress.env('BROWSER_URL') || 'http://localhost:8080'
Cypress.config.password = Cypress.env('browser-password') || 'newpassword'
3 changes: 1 addition & 2 deletions e2e_tests/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import './defaults'
/* global Cypress, cy, before */

before(function () {
cy
.visit(Cypress.env('BROWSER_URL') || 'http://localhost:8080')
cy.visit(Cypress.config.url)
.title()
.should('include', 'Neo4j Browser')
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"coffee-script": "^1.12.7",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.7",
"cypress": "^3.0.1",
"cypress": "^3.1.0",
"eslint": "^4.6.1",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-jsx": "^4.0.1",
Expand Down
Loading

0 comments on commit c13ab40

Please sign in to comment.