fix integration test

This commit is contained in:
Karol Wypchlo 2022-03-04 16:15:27 +01:00
parent 4609ac5681
commit c7e16b8345
No known key found for this signature in database
GPG Key ID: B515DE9EEBE241E1
4 changed files with 3 additions and 15 deletions

View File

@ -16,20 +16,16 @@ context("Skynet website", () => {
it("should be able to upload a file", () => {
cy.intercept("POST", "/skynet/skyfile").as("upload");
const fileName = "example.json";
cy.wait(1000); // delay for drag-and-drop to work properly every time
cy.get('.home-upload-dropzone input[type="file"]').attachFile(fileName, { force: true });
cy.get('.home-upload-dropzone input[type="file"]').selectFile("cypress/fixtures/example.json", { force: true });
cy.get(".home-uploaded-files").children().should("have.length", 1);
// wait max 2 minutes, the portal might be slow at times
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
cy.contains(".upload-file", fileName).within(() => {
cy.get("a")
.invoke("text")
.should("match", /\/[a-zA-Z0-9-_]{46}/);
cy.contains(".upload-file", "example.json").within(() => {
cy.get("a").invoke("text").should("include", "AADXKUI_ddg_CEkQ747MzMVndJDbCma5jtkgmAzFbl9-Iw");
cy.contains("Copy").click();
cy.contains("Copied").should("be.visible");

View File

@ -23,5 +23,3 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
import "cypress-file-upload";

View File

@ -50,7 +50,6 @@
"autoprefixer": "10.4.2",
"cross-env": "7.0.3",
"cypress": "9.5.1",
"cypress-file-upload": "5.0.8",
"prettier": "2.5.1",
"tailwindcss": "3.0.23"
},

View File

@ -4593,11 +4593,6 @@ custom-error-instance@2.1.1:
resolved "https://registry.yarnpkg.com/custom-error-instance/-/custom-error-instance-2.1.1.tgz#3cf6391487a6629a6247eb0ca0ce00081b7e361a"
integrity sha1-PPY5FIemYppiR+sMoM4ACBt+Nho=
cypress-file-upload@5.0.8:
version "5.0.8"
resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz#d8824cbeaab798e44be8009769f9a6c9daa1b4a1"
integrity sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g==
cypress@9.5.1:
version "9.5.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.1.tgz#51162f3688cedf5ffce311b914ef49a7c1ece076"