improve integration test reliability

This commit is contained in:
Karol Wypchlo 2020-03-11 10:47:25 +01:00
parent 22c1d6b0b9
commit 43f20ef463
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,9 @@ context("Skynet", () => {
}); });
it("should be able to upload a file", () => { it("should be able to upload a file", () => {
cy.server();
cy.route("POST", "/skynet/skyfile").as("upload");
const fileName = "check.json"; const fileName = "check.json";
cy.fixture(fileName).then((fileContent) => { cy.fixture(fileName).then((fileContent) => {
@ -21,6 +24,9 @@ context("Skynet", () => {
cy.get(".home-uploaded-files") cy.get(".home-uploaded-files")
.children() .children()
.should("have.length", 1); .should("have.length", 1);
cy.wait("@upload");
cy.contains(".upload-file", fileName).within(() => { cy.contains(".upload-file", fileName).within(() => {
cy.get(".url") cy.get(".url")
.invoke("text") .invoke("text")