-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
323 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,108 @@ | ||
import { basicTask, setupServerWith } from "../support/e2e"; | ||
|
||
// TODO move to components testing | ||
// upstream doesn't yet allow that vuejs/test-utils#2468 | ||
|
||
describe("image dataset input by group", () => { | ||
it("shows passed labels", () => { | ||
setupServerWith( | ||
basicTask({ | ||
dataType: "image", | ||
LABEL_LIST: ["first", "second", "third"], | ||
IMAGE_H: 100, | ||
IMAGE_W: 100, | ||
}), | ||
); | ||
|
||
cy.visit("/#/list"); | ||
cy.get("button").contains("participate").click(); | ||
|
||
cy.get("button").contains("next").click(); | ||
|
||
cy.get("button").contains("group").click(); | ||
|
||
cy.contains("Group label: first").should("exist"); | ||
cy.contains("Group label: second").should("exist"); | ||
cy.contains("Group label: third").should("exist"); | ||
}); | ||
|
||
it("allows to input images", () => { | ||
setupServerWith( | ||
basicTask({ | ||
dataType: "image", | ||
LABEL_LIST: ["label"], | ||
IMAGE_H: 100, | ||
IMAGE_W: 100, | ||
}), | ||
); | ||
|
||
cy.visit("/#/list"); | ||
cy.get("button").contains("participate").click(); | ||
|
||
cy.get("button").contains("next").click(); | ||
|
||
cy.get("button").contains("group").click(); | ||
cy.contains("select images").selectFile([ | ||
{ fileName: "first.png", contents: new Uint8Array() }, | ||
{ fileName: "second.png", contents: new Uint8Array() }, | ||
{ fileName: "third.png", contents: new Uint8Array() }, | ||
]); | ||
|
||
cy.contains("Number of selected files: 3").should("exist"); | ||
}); | ||
}); | ||
|
||
describe("image dataset input by csv", () => { | ||
it("allows to input CSV then images", () => { | ||
setupServerWith( | ||
basicTask({ | ||
dataType: "image", | ||
LABEL_LIST: ["label"], | ||
IMAGE_H: 100, | ||
IMAGE_W: 100, | ||
}), | ||
); | ||
|
||
cy.visit("/#/list"); | ||
cy.get("button").contains("participate").click(); | ||
|
||
cy.get("button").contains("next").click(); | ||
|
||
cy.get("button").contains("csv").click(); | ||
cy.contains("select CSV").selectFile({ | ||
fileName: "csv", | ||
contents: new TextEncoder().encode( | ||
"filename,label\n" + | ||
"first,first\n" + | ||
"second,second\n" + | ||
"third,third\n", | ||
), | ||
}); | ||
|
||
cy.contains("select images").selectFile([ | ||
{ fileName: "first.png", contents: new Uint8Array() }, | ||
{ fileName: "second.png", contents: new Uint8Array() }, | ||
{ fileName: "third.png", contents: new Uint8Array() }, | ||
]); | ||
|
||
cy.contains("Number of selected files: 3").should("exist"); | ||
}); | ||
}); | ||
|
||
describe("tabular dataset input", () => { | ||
it("allows to input CSV", () => { | ||
setupServerWith(basicTask({ dataType: "tabular" })); | ||
|
||
cy.visit("/#/list"); | ||
cy.get("button").contains("participate").click(); | ||
|
||
cy.get("button").contains("next").click(); | ||
|
||
cy.contains("select CSV").selectFile({ | ||
fileName: "filename", | ||
contents: new TextEncoder().encode("a,b,c\n1,2,3\n"), | ||
}); | ||
|
||
cy.contains("filename").should("exist"); | ||
}); | ||
}); | ||
// import { basicTask, setupServerWith } from "../support/e2e"; | ||
|
||
// // TODO move to components testing | ||
// // upstream doesn't yet allow that vuejs/test-utils#2468 | ||
|
||
// describe("image dataset input by group", () => { | ||
// it("shows passed labels", () => { | ||
// setupServerWith( | ||
// basicTask({ | ||
// dataType: "image", | ||
// LABEL_LIST: ["first", "second", "third"], | ||
// IMAGE_H: 100, | ||
// IMAGE_W: 100, | ||
// }), | ||
// ); | ||
|
||
// cy.visit("/#/list"); | ||
// cy.get("button").contains("participate").click(); | ||
|
||
// cy.get("button").contains("next").click(); | ||
|
||
// cy.get("button").contains("group").click(); | ||
|
||
// cy.contains("Group label: first").should("exist"); | ||
// cy.contains("Group label: second").should("exist"); | ||
// cy.contains("Group label: third").should("exist"); | ||
// }); | ||
|
||
// it("allows to input images", () => { | ||
// setupServerWith( | ||
// basicTask({ | ||
// dataType: "image", | ||
// LABEL_LIST: ["label"], | ||
// IMAGE_H: 100, | ||
// IMAGE_W: 100, | ||
// }), | ||
// ); | ||
|
||
// cy.visit("/#/list"); | ||
// cy.get("button").contains("participate").click(); | ||
|
||
// cy.get("button").contains("next").click(); | ||
|
||
// cy.get("button").contains("group").click(); | ||
// cy.contains("select images").selectFile([ | ||
// { fileName: "first.png", contents: new Uint8Array() }, | ||
// { fileName: "second.png", contents: new Uint8Array() }, | ||
// { fileName: "third.png", contents: new Uint8Array() }, | ||
// ]); | ||
|
||
// cy.contains("Number of selected files: 3").should("exist"); | ||
// }); | ||
// }); | ||
|
||
// describe("image dataset input by csv", () => { | ||
// it("allows to input CSV then images", () => { | ||
// setupServerWith( | ||
// basicTask({ | ||
// dataType: "image", | ||
// LABEL_LIST: ["label"], | ||
// IMAGE_H: 100, | ||
// IMAGE_W: 100, | ||
// }), | ||
// ); | ||
|
||
// cy.visit("/#/list"); | ||
// cy.get("button").contains("participate").click(); | ||
|
||
// cy.get("button").contains("next").click(); | ||
|
||
// cy.get("button").contains("csv").click(); | ||
// cy.contains("select CSV").selectFile({ | ||
// fileName: "csv", | ||
// contents: new TextEncoder().encode( | ||
// "filename,label\n" + | ||
// "first,first\n" + | ||
// "second,second\n" + | ||
// "third,third\n", | ||
// ), | ||
// }); | ||
|
||
// cy.contains("select images").selectFile([ | ||
// { fileName: "first.png", contents: new Uint8Array() }, | ||
// { fileName: "second.png", contents: new Uint8Array() }, | ||
// { fileName: "third.png", contents: new Uint8Array() }, | ||
// ]); | ||
|
||
// cy.contains("Number of selected files: 3").should("exist"); | ||
// }); | ||
// }); | ||
|
||
// describe("tabular dataset input", () => { | ||
// it("allows to input CSV", () => { | ||
// setupServerWith(basicTask({ dataType: "tabular" })); | ||
|
||
// cy.visit("/#/list"); | ||
// cy.get("button").contains("participate").click(); | ||
|
||
// cy.get("button").contains("next").click(); | ||
|
||
// cy.contains("select CSV").selectFile({ | ||
// fileName: "filename", | ||
// contents: new TextEncoder().encode("a,b,c\n1,2,3\n"), | ||
// }); | ||
|
||
// cy.contains("filename").should("exist"); | ||
// }); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import { defaultTasks } from "@epfml/discojs"; | ||
// import { defaultTasks } from "@epfml/discojs"; | ||
|
||
import { setupServerWith } from "../support/e2e.ts"; | ||
// import { setupServerWith } from "../support/e2e.ts"; | ||
|
||
describe("tasks page", () => { | ||
it("displays tasks", () => { | ||
setupServerWith( | ||
defaultTasks.titanic, | ||
defaultTasks.mnist, | ||
defaultTasks.lusCovid, | ||
defaultTasks.wikitext, | ||
); | ||
// describe("tasks page", () => { | ||
// it("displays tasks", () => { | ||
// setupServerWith( | ||
// defaultTasks.titanic, | ||
// defaultTasks.mnist, | ||
// defaultTasks.lusCovid, | ||
// defaultTasks.wikitext, | ||
// ); | ||
|
||
cy.visit("/#/list").contains("button", "participate"); | ||
// cy.visit("/#/list").contains("button", "participate"); | ||
|
||
// Length 5 = 4 tasks and 1 div for text description | ||
cy.get('div[id="tasks"]').children().should("have.length", 5); | ||
}); | ||
// // Length 5 = 4 tasks and 1 div for text description | ||
// cy.get('div[id="tasks"]').children().should("have.length", 5); | ||
// }); | ||
|
||
it("redirects to training", () => { | ||
setupServerWith(defaultTasks.titanic); | ||
// it("redirects to training", () => { | ||
// setupServerWith(defaultTasks.titanic); | ||
|
||
cy.visit("/#/list").contains("button", "participate"); | ||
// cy.visit("/#/list").contains("button", "participate"); | ||
|
||
cy.get(`div[id="titanic"]`).find("button").click(); | ||
cy.url().should("eq", `${Cypress.config().baseUrl}#/titanic`); | ||
// cy.get(`div[id="titanic"]`).find("button").click(); | ||
// cy.url().should("eq", `${Cypress.config().baseUrl}#/titanic`); | ||
|
||
cy.contains("button", "previous").click(); | ||
cy.url().should("eq", `${Cypress.config().baseUrl}#/list`); | ||
}); | ||
// cy.contains("button", "previous").click(); | ||
// cy.url().should("eq", `${Cypress.config().baseUrl}#/list`); | ||
// }); | ||
|
||
it("displays error message", () => { | ||
cy.intercept( | ||
{ hostname: "server", pathname: "tasks" }, | ||
{ statusCode: 404 }, | ||
); | ||
// it("displays error message", () => { | ||
// cy.intercept( | ||
// { hostname: "server", pathname: "tasks" }, | ||
// { statusCode: 404 }, | ||
// ); | ||
|
||
cy.visit("/#/list"); | ||
cy.contains("button", "reload page"); | ||
}); | ||
}); | ||
// cy.visit("/#/list"); | ||
// cy.contains("button", "reload page"); | ||
// }); | ||
// }); |
Oops, something went wrong.