@@ -20,8 +20,10 @@ describe('Autocomplete mapping', () => {
20
20
MappingSteps . getTriples ( ) . should ( 'have.length' , 1 ) ;
21
21
MappingSteps . completeTriple ( 0 , 's' , 'p' , undefined ) ;
22
22
MappingSteps . type ( 'w' , ( ) => MappingSteps . getTripleObjectValue ( 0 ) ) ;
23
- MappingSteps . getSuggestions ( 0 ) . should ( 'have.length' , 5 ) ;
24
- MappingSteps . getSuggestions ( 0 ) . first ( ) . should ( 'contain' , 'wgs:' ) . click ( ) ;
23
+ MappingSteps . getSuggestions ( ) . should ( 'have.length' , 5 ) ;
24
+ MappingSteps . getSuggestions ( ) . first ( ) . should ( 'contain' , 'wgs:' ) . then ( ( option ) => {
25
+ option [ 0 ] . click ( ) ;
26
+ } ) ;
25
27
MappingSteps . type ( 'test' , ( ) => MappingSteps . getTripleObjectValue ( 0 ) ) ;
26
28
MappingSteps . getTripleObjectValue ( 0 ) . blur ( ) ;
27
29
MappingSteps . getTripleObjectPropertyTransformation ( 0 ) . should ( 'have.text' , 'wgs:' ) ;
@@ -32,15 +34,19 @@ describe('Autocomplete mapping', () => {
32
34
MappingSteps . getTriples ( ) . should ( 'have.length' , 1 ) ;
33
35
MappingSteps . completeTriple ( 0 , 's' , 'p' , undefined ) ;
34
36
MappingSteps . type ( 'rdf:@' , ( ) => MappingSteps . getTripleObjectValue ( 0 ) ) ;
35
- MappingSteps . getSuggestions ( 0 ) . should ( 'have.length' , 28 ) ;
36
- MappingSteps . getSuggestions ( 0 ) . first ( ) . should ( 'contain' , 'color' ) . click ( ) ;
37
+ MappingSteps . getSuggestions ( ) . should ( 'have.length' , 28 ) ;
38
+ MappingSteps . getSuggestions ( ) . first ( ) . should ( 'contain' , 'color' ) . then ( ( option ) => {
39
+ option [ 0 ] . click ( ) ;
40
+ } ) ;
37
41
MappingSteps . getTripleObjectPropertyTransformation ( 0 ) . should ( 'have.text' , 'rdf:' ) ;
38
42
MappingSteps . getTripleObjectSource ( 0 ) . should ( 'have.text' , ' @ color ' ) ;
39
43
// When I type on the subject position an extended prefix plus column beginning
40
44
MappingSteps . type ( 'rdf:ext@du' , ( ) => MappingSteps . getTripleSubjectValue ( 1 ) ) ;
41
- MappingSteps . getSuggestions ( 0 ) . should ( 'have.length' , 1 ) ;
45
+ MappingSteps . getSuggestions ( ) . should ( 'have.length' , 1 ) ;
42
46
// And I select the column from the suggestion
43
- MappingSteps . getSuggestions ( 0 ) . first ( ) . should ( 'contain' , 'duration' ) . click ( ) ;
47
+ MappingSteps . getSuggestions ( ) . first ( ) . should ( 'contain' , 'duration' ) . then ( ( option ) => {
48
+ option [ 0 ] . click ( ) ;
49
+ } ) ;
44
50
// Then I expect that the extended prefix is properly populated in the cell
45
51
// And The column and type are properly set
46
52
MappingSteps . getTripleSubjectPropertyTransformation ( 1 ) . should ( 'have.text' , 'rdf:ext' ) ;
@@ -50,7 +56,9 @@ describe('Autocomplete mapping', () => {
50
56
MappingSteps . type ( 'p' , ( ) => MappingSteps . getTriplePredicateValue ( 1 ) ) ;
51
57
MappingSteps . type ( 'rdf:ext@co' , ( ) => MappingSteps . getTripleObjectValue ( 1 ) ) ;
52
58
// And I select the columns from the suggestion
53
- MappingSteps . getSuggestions ( 0 ) . first ( ) . should ( 'contain' , 'color' ) . click ( ) ;
59
+ MappingSteps . getSuggestions ( ) . first ( ) . should ( 'contain' , 'color' ) . then ( ( option ) => {
60
+ option [ 0 ] . click ( ) ;
61
+ } ) ;
54
62
// Then I expect that the prefix, column and tpe are properly populated in the cell
55
63
MappingSteps . getTripleObjectPropertyTransformation ( 1 ) . should ( 'have.text' , 'rdf:ext' ) ;
56
64
MappingSteps . getTripleObjectSource ( 1 ) . should ( 'have.text' , ' @ color ' ) ;
@@ -64,7 +72,7 @@ describe('Autocomplete mapping', () => {
64
72
// Call POST again to load tooltips
65
73
cy . route ( 'POST' , '/repositories/Movies' , 'fixture:autocomplete/autocomplete-iri-description-response.json' ) . as ( 'loadDescr' ) ;
66
74
// When I hover an autocomplete
67
- MappingSteps . getSuggestions ( 0 ) . first ( ) . trigger ( 'mouseover' ) ;
75
+ MappingSteps . getSuggestions ( ) . first ( ) . trigger ( 'mouseover' ) ;
68
76
// I expect tho see an IRI description
69
77
MappingSteps . getTooltip ( ) . contains ( 'IRI Description' ) ;
70
78
} ) ;
0 commit comments