Skip to content

Commit 56117ea

Browse files
committed
test fixes
1 parent 92de0dd commit 56117ea

File tree

1 file changed

+54
-57
lines changed

1 file changed

+54
-57
lines changed

cypress/e2e/custom-query-editor.cy.js

Lines changed: 54 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
describe("Simple Custom Query Editor tests", () => {
2+
describe("Custom Query Editor tests", () => {
33

44
it("Create a new query", () => {
55

@@ -116,16 +116,15 @@ ORDER BY ?componentName
116116

117117
cy.get('textarea[name="queryString"]').clear();
118118
cy.get('textarea[name="queryString"]').type(`PREFIX schema: <http://schema.org/>
119-
120-
SELECT * WHERE {
121-
?list schema:name ?listTitle;
122-
schema:itemListElement [
123-
schema:name ?bookTitle;
124-
schema:creator [
125-
schema:name ?authorName
126-
]
127-
].
128-
}`);
119+
SELECT * WHERE {
120+
?list schema:name ?listTitle;
121+
schema:itemListElement [
122+
schema:name ?bookTitle;
123+
schema:creator [
124+
schema:name ?authorName
125+
]
126+
].
127+
}`);
129128

130129
// Submit the correct query
131130
cy.get('button[type="submit"]').click();
@@ -148,7 +147,6 @@ ORDER BY ?componentName
148147

149148
cy.get('textarea[name="queryString"]').clear();
150149
cy.get('textarea[name="queryString"]').type(`PREFIX schema: <http://schema.org/>
151-
152150
SELECT * WHERE {
153151
?list schema:name ?listTitle;
154152
schema:itemListElement [
@@ -164,8 +162,9 @@ SELECT * WHERE {
164162
cy.get('button').contains("Save Query").click();
165163

166164
cy.get('textarea[name="queryURL"]').invoke('val').then((val) => {
167-
expect(val).to.include('?name=new+query&description=new+description&queryString=PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E+%0A%0ASELECT+*+WHERE+%7B%0A++++%3Flist+schema%3Aname+%3FlistTitle%3B%0A++++++schema%3AitemListElement+%5B%0A++++++schema%3Aname+%3FbookTitle%3B%0A++++++schema%3Acreator+%5B%0A++++++++schema%3Aname+%3FauthorName%0A++++++%5D%0A++++%5D.%0A%7D&source=http%3A%2F%2Flocalhost%3A8080%2Fexample%2Fwish-list');
165+
expect(val).to.include('?name=new+query&description=new+description&queryString=PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E+%0ASELECT+*+WHERE+%7B%0A++++%3Flist+schema%3Aname+%3FlistTitle%3B%0A++++++schema%3AitemListElement+%5B%0A++++++schema%3Aname+%3FbookTitle%3B%0A++++++schema%3Acreator+%5B%0A++++++++schema%3Aname+%3FauthorName%0A++++++%5D%0A++++%5D.%0A%7D&source=http%3A%2F%2Flocalhost%3A8080%2Fexample%2Fwish-list');
168166
});
167+
169168

170169
})
171170

@@ -179,13 +178,13 @@ SELECT * WHERE {
179178
// Query handling a variable
180179
cy.get('textarea[name="queryString"]').clear();
181180
cy.get('textarea[name="queryString"]').type(`PREFIX schema: <http://schema.org/>
182-
SELECT ?name ?sameAs_url WHERE {
183-
?list schema:name ?listTitle;
184-
schema:name ?name;
185-
schema:genre $genre;
186-
schema:sameAs ?sameAs_url;
187-
}`
188-
);
181+
SELECT ?name ?sameAs_url WHERE {
182+
?list schema:name ?listTitle;
183+
schema:name ?name;
184+
schema:genre $genre;
185+
schema:sameAs ?sameAs_url;
186+
}`
187+
);
189188

190189
cy.get('input[name="source"]').type("http://localhost:8080/example/favourite-musicians");
191190
cy.get('input[name="templatedQueryCheck"]').click()
@@ -223,33 +222,32 @@ SELECT * WHERE {
223222

224223
// Query handling a variable
225224
cy.get('textarea[name="queryString"]').clear();
226-
cy.get('textarea[name="queryString"]').type(`
227-
# Query Texon's components and their materials
228-
# Datasources: https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/components.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/boms.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/materials.ttl
229-
230-
PREFIX oo: <http://purl.org/openorg/>
231-
PREFIX ao: <http://purl.org/ontology/ao/core#>
232-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
233-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
234-
PREFIX d: <http://www/example.com/data/>
235-
PREFIX o: <http://www/example.com/ont/>
236-
237-
SELECT ?component ?componentName ?material ?materialName ?percentage
238-
WHERE {
239-
?component
240-
a o:Component ;
241-
o:name ?componentName ;
242-
o:has-component-bom [
243-
o:has-component-material-assoc [
244-
o:percentage ?percentage ;
245-
o:has-material ?material ;
246-
];
247-
];
248-
.
249-
?material o:name ?materialName ;
250-
}
251-
ORDER BY ?componentName`
252-
);
225+
cy.get('textarea[name="queryString"]').type(`# Query Texon's components and their materials
226+
# Datasources: https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/components.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/boms.ttl https://css5.onto-deside.ilabt.imec.be/texon/data/dt/out/materials.ttl
227+
228+
PREFIX oo: <http://purl.org/openorg/>
229+
PREFIX ao: <http://purl.org/ontology/ao/core#>
230+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
231+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
232+
PREFIX d: <http://www/example.com/data/>
233+
PREFIX o: <http://www/example.com/ont/>
234+
235+
SELECT ?component ?componentName ?material ?materialName ?percentage
236+
WHERE {
237+
?component
238+
a o:Component ;
239+
o:name ?componentName ;
240+
o:has-component-bom [
241+
o:has-component-material-assoc [
242+
o:percentage ?percentage ;
243+
o:has-material ?material ;
244+
];
245+
];
246+
.
247+
?material o:name ?materialName ;
248+
}
249+
ORDER BY ?componentName`
250+
);
253251

254252
// No Comunica Sources Required
255253

@@ -258,16 +256,15 @@ SELECT * WHERE {
258256
cy.get('input[name="indexSourceUrl"]').type("http://localhost:8080/example/index-example-texon-only")
259257

260258
cy.get('textarea[name="indexSourceQuery"]').clear();
261-
cy.get('textarea[name="indexSourceQuery"]').type(`
262-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
263-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
264-
PREFIX example: <http://localhost:8080/example/index-example-texon-only#>
265-
266-
SELECT ?object
267-
WHERE {
268-
example:index-example rdfs:seeAlso ?object .
269-
}`
270-
)
259+
cy.get('textarea[name="indexSourceQuery"]').type(`PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
260+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
261+
PREFIX example: <http://localhost:8080/example/index-example-texon-only#>
262+
263+
SELECT ?object
264+
WHERE {
265+
example:index-example rdfs:seeAlso ?object .
266+
}`
267+
)
271268
cy.get('button[type="submit"]').click();
272269

273270
cy.contains("http://www/example.com/data/component-c01").should('exist');

0 commit comments

Comments
 (0)