fix cypress test

This commit is contained in:
Karol Wypchlo 2021-01-27 13:01:20 +01:00
parent 2f1ec00e29
commit a4fe1eb4dd
1 changed files with 3 additions and 4 deletions

View File

@ -12,12 +12,12 @@ context("Skynet", () => {
}); });
it("should be able to upload a file", () => { it("should be able to upload a file", () => {
cy.server(); cy.intercept("POST", "/skynet/skyfile").as("upload");
cy.route("POST", "/skynet/skyfile").as("upload");
const fileName = "check.json"; const fileName = "check.json";
cy.get('.home-upload input[type="file"]').attachFile(fileName); cy.wait(1000); // delay for drag-and-drop to work properly every time
cy.get('.home-upload input[type="file"]').attachFile(fileName, { subjectType: 'drag-n-drop' });
cy.get(".home-upload").scrollIntoView(); cy.get(".home-upload").scrollIntoView();
cy.get(".home-uploaded-files").children().should("have.length", 1); cy.get(".home-uploaded-files").children().should("have.length", 1);
@ -32,7 +32,6 @@ context("Skynet", () => {
cy.contains("Copy Link").click(); cy.contains("Copy Link").click();
cy.contains("Copied!").should("be.visible"); cy.contains("Copied!").should("be.visible");
cy.contains("Copied!").should("not.be.visible");
}); });
}); });
}); });