Skip to content

Commit ea79af2

Browse files
committed
Added test for templated queries
1 parent 7ab0fd7 commit ea79af2

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

cypress.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { defineConfig } from "cypress";
22

33
export default defineConfig({
44
e2e: {
5+
defaultCommandTimeout: 10000, /* is OK for very slow computers */
56
baseUrl: 'http://localhost:5173',
67
supportFile: false,
78
video: false
89
},
9-
});
10+
});

cypress/e2e/spec.cy.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("Web app", () => {
66
it("Custom icon per query is displayed", () => {
77
cy.visit("/");
88

9-
cy.get('[data-testid="BiotechIcon"]').should("exist");
9+
cy.get('[data-testid="PhotoIcon"]').should("exist");
1010
cy.get('[data-testid="BrushIcon"]').should("exist");
1111
})
1212

@@ -30,6 +30,26 @@ describe("Web app", () => {
3030
cy.get('[aria-label="Query was succesful"]').should("exist");
3131
});
3232

33+
it("Fetch status source info on templated query success", () => {
34+
cy.visit("/");
35+
36+
cy.contains("Templated query #2 about my favourite musicians").click();
37+
38+
cy.get('form').within(() => {
39+
cy.get('#genre').click();
40+
});
41+
cy.get('li').contains('Classical').click();
42+
cy.get('form').within(() => {
43+
cy.get('#sameAsUrl').click();
44+
});
45+
cy.get('li').contains('Mozart').click();
46+
47+
cy.get('button').contains('Query').click();
48+
cy.contains("Finished in:");
49+
cy.get('[aria-label="Sources info"]').click();
50+
cy.get('[aria-label="Query was succesful"]').should("exist");
51+
});
52+
3353
it("Authentication needed source info for query on public data", () => {
3454
cy.visit("/");
3555

@@ -186,7 +206,7 @@ describe("Web app", () => {
186206
it("Querying variable ending on _img should return an image as result", () => {
187207
cy.visit("/");
188208

189-
cy.contains("A Test For Images").click();
209+
cy.contains("A test for images").click();
190210
cy.contains("Finished in:");
191211
cy.get("td").find("img");
192212
});

src/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
{
2727
"queryLocation": "images_test.rq",
28-
"name": "A Test For Images",
28+
"name": "A test for images",
2929
"description": "A small test to test the functionality of the Web app concerning images",
3030
"icon": "PhotoIcon",
3131
"id": "2000",

0 commit comments

Comments
 (0)