1- import {
2- tableCypherQuery
3- } from '../fixtures/cypher_queries' ;
4-
5- const WAITING_TIME = 20000 ;
6- // Ignore warnings that may appear when using the Cypress dev server
7- Cypress . on ( 'uncaught:exception' , ( err , runnable ) => {
8- console . log ( err , runnable ) ;
9- return false ;
10- } ) ;
11-
12- describe ( 'Testing table' , ( ) => {
13- beforeEach ( 'open neodash' , ( ) => {
14- cy . viewport ( 1920 , 1080 ) ;
15- cy . visit ( '/' , {
16- onBeforeLoad ( win ) {
17- win . localStorage . clear ( ) ;
18- } ,
19- } ) ;
20-
21- cy . get ( '#form-dialog-title' , { timeout : 20000 } ) . should ( 'contain' , 'NeoDash - Neo4j Dashboard Builder' ) . click ( ) ;
22-
23- cy . get ( '#form-dialog-title' ) . then ( ( $div ) => {
24- const text = $div . text ( ) ;
25- if ( text == 'NeoDash - Neo4j Dashboard Builder' ) {
26- cy . wait ( 500 ) ;
27- // Create new dashboard
28- cy . contains ( 'New Dashboard' ) . click ( ) ;
29- }
30- } ) ;
31-
32- cy . get ( '#form-dialog-title' , { timeout : 20000 } ) . should ( 'contain' , 'Connect to Neo4j' ) ;
33-
34- cy . get ( '#url' ) . clear ( ) . type ( 'localhost' ) ;
35- cy . get ( '#dbusername' ) . clear ( ) . type ( 'neo4j' ) ;
36- cy . get ( '#dbpassword' ) . type ( 'test1234' ) ;
37- cy . get ( 'button' ) . contains ( 'Connect' ) . click ( ) ;
38- cy . wait ( 100 ) ;
1+ import { tableCypherQuery } from '../fixtures/cypher_queries' ;
2+
3+ const WAITING_TIME = 20000 ;
4+ // Ignore warnings that may appear when using the Cypress dev server
5+ Cypress . on ( 'uncaught:exception' , ( err , runnable ) => {
6+ console . log ( err , runnable ) ;
7+ return false ;
8+ } ) ;
9+
10+ describe ( 'Testing table' , ( ) => {
11+ beforeEach ( 'open neodash' , ( ) => {
12+ cy . viewport ( 1920 , 1080 ) ;
13+ cy . visit ( '/' , {
14+ onBeforeLoad ( win ) {
15+ win . localStorage . clear ( ) ;
16+ } ,
3917 } ) ;
40-
41-
42- it ( 'create a table' , ( ) => {
43- //Opens the div containing all report cards
44- cy . get ( '.react-grid-layout:eq(0)' )
45- . first ( ) . within ( ( ) => {
18+
19+ cy . get ( '#form-dialog-title' , { timeout : 20000 } ) . should ( 'contain' , 'NeoDash - Neo4j Dashboard Builder' ) . click ( ) ;
20+
21+ cy . get ( '#form-dialog-title' ) . then ( ( $div ) => {
22+ const text = $div . text ( ) ;
23+ if ( text == 'NeoDash - Neo4j Dashboard Builder' ) {
24+ cy . wait ( 500 ) ;
25+ // Create new dashboard
26+ cy . contains ( 'New Dashboard' ) . click ( ) ;
27+ }
28+ } ) ;
29+
30+ cy . get ( '#form-dialog-title' , { timeout : 20000 } ) . should ( 'contain' , 'Connect to Neo4j' ) ;
31+
32+ cy . get ( '#url' ) . clear ( ) . type ( 'localhost' ) ;
33+ cy . get ( '#dbusername' ) . clear ( ) . type ( 'neo4j' ) ;
34+ cy . get ( '#dbpassword' ) . type ( 'test1234' ) ;
35+ cy . get ( 'button' ) . contains ( 'Connect' ) . click ( ) ;
36+ cy . wait ( 100 ) ;
37+ } ) ;
38+
39+ it . skip ( 'create a table' , ( ) => {
40+ //Opens the div containing all report cards
41+ cy . get ( '.react-grid-layout:eq(0)' )
42+ . first ( )
43+ . within ( ( ) => {
4644 //Finds the 2nd card
47- cy . get ( '.MuiGrid-root' ) . eq ( 1 ) . within ( ( ) => {
48- //Clicks the 2nd button (opens settings)
49- cy . get ( "button" ) . eq ( 1 ) . click ( )
50- // cy.get('div[role="textbox"')
51- } )
52- } )
53- cy . get ( '.react-grid-layout' ) . first ( ) . within ( ( ) => {
45+ cy . get ( '.MuiGrid-root' )
46+ . eq ( 1 )
47+ . within ( ( ) => {
48+ //Clicks the 2nd button (opens settings)
49+ cy . get ( 'button' ) . eq ( 1 ) . click ( ) ;
50+ // cy.get('div[role="textbox"')
51+ } ) ;
52+ } ) ;
53+ cy . get ( '.react-grid-layout' )
54+ . first ( )
55+ . within ( ( ) => {
5456 //Finds the 2nd card
55- cy . get ( '.MuiGrid-root' ) . eq ( 1 ) . within ( ( ) => {
56- //Opens the drop down
57- cy . getDataTest ( 'type-dropdown' ) . click ( )
58- } )
59- } )
60- // Selects the Table option
61- cy . get ( '[id^="react-select-5-option"]' ) . contains ( / T a b l e / ) . should ( 'be.visible' ) . click ( { force : true } )
62- cy . get ( '.react-grid-layout .MuiGrid-root:eq(1) #type input[name="Type"]' ) . should ( 'have.value' , 'Table' ) ;
63-
64- //Removes text in cypher editor and types new query
65- cy . get ( '.react-grid-layout' ) . first ( ) . within ( ( ) => {
57+ cy . get ( '.MuiGrid-root' )
58+ . eq ( 1 )
59+ . within ( ( ) => {
60+ //Opens the drop down
61+ cy . getDataTest ( 'type-dropdown' ) . click ( ) ;
62+ } ) ;
63+ } ) ;
64+ // Selects the Table option
65+ cy . get ( '[id^="react-select-5-option"]' ) . contains ( / T a b l e / ) . should ( 'be.visible' ) . click ( { force : true } ) ;
66+ cy . get ( '.react-grid-layout .MuiGrid-root:eq(1) #type input[name="Type"]' ) . should ( 'have.value' , 'Table' ) ;
67+
68+ //Removes text in cypher editor and types new query
69+ cy . get ( '.react-grid-layout' )
70+ . first ( )
71+ . within ( ( ) => {
6672 //Finds the 2nd card
67- cy . get ( '.MuiGrid-root' ) . eq ( 1 ) . within ( ( ) => {
68- //Replaces default query with new query
69- cy . get ( '.ndl-cypher-editor div[role="textbox"]' ) . clear ( ) . type ( tableCypherQuery )
70- cy . get ( 'button[aria-label="run"]' ) . click ( )
71- } )
72- } )
73- } ) ;
74- } ) ;
73+ cy . get ( '.MuiGrid-root' )
74+ . eq ( 1 )
75+ . within ( ( ) => {
76+ //Replaces default query with new query
77+ cy . get ( '.ndl-cypher-editor div[role="textbox"]' ) . clear ( ) . type ( tableCypherQuery ) ;
78+ cy . get ( 'button[aria-label="run"]' ) . click ( ) ;
79+ } ) ;
80+ } ) ;
81+ } ) ;
82+ } ) ;
0 commit comments