fix integration test
This commit is contained in:
parent
4609ac5681
commit
c7e16b8345
|
@ -16,20 +16,16 @@ context("Skynet website", () => {
|
||||||
it("should be able to upload a file", () => {
|
it("should be able to upload a file", () => {
|
||||||
cy.intercept("POST", "/skynet/skyfile").as("upload");
|
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.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);
|
cy.get(".home-uploaded-files").children().should("have.length", 1);
|
||||||
|
|
||||||
// wait max 2 minutes, the portal might be slow at times
|
// wait max 2 minutes, the portal might be slow at times
|
||||||
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
|
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
|
||||||
|
|
||||||
cy.contains(".upload-file", fileName).within(() => {
|
cy.contains(".upload-file", "example.json").within(() => {
|
||||||
cy.get("a")
|
cy.get("a").invoke("text").should("include", "AADXKUI_ddg_CEkQ747MzMVndJDbCma5jtkgmAzFbl9-Iw");
|
||||||
.invoke("text")
|
|
||||||
.should("match", /\/[a-zA-Z0-9-_]{46}/);
|
|
||||||
|
|
||||||
cy.contains("Copy").click();
|
cy.contains("Copy").click();
|
||||||
cy.contains("Copied").should("be.visible");
|
cy.contains("Copied").should("be.visible");
|
||||||
|
|
|
@ -23,5 +23,3 @@
|
||||||
//
|
//
|
||||||
// -- This will overwrite an existing command --
|
// -- This will overwrite an existing command --
|
||||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
import "cypress-file-upload";
|
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
"autoprefixer": "10.4.2",
|
"autoprefixer": "10.4.2",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cypress": "9.5.1",
|
"cypress": "9.5.1",
|
||||||
"cypress-file-upload": "5.0.8",
|
|
||||||
"prettier": "2.5.1",
|
"prettier": "2.5.1",
|
||||||
"tailwindcss": "3.0.23"
|
"tailwindcss": "3.0.23"
|
||||||
},
|
},
|
||||||
|
|
|
@ -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"
|
resolved "https://registry.yarnpkg.com/custom-error-instance/-/custom-error-instance-2.1.1.tgz#3cf6391487a6629a6247eb0ca0ce00081b7e361a"
|
||||||
integrity sha1-PPY5FIemYppiR+sMoM4ACBt+Nho=
|
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:
|
cypress@9.5.1:
|
||||||
version "9.5.1"
|
version "9.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.1.tgz#51162f3688cedf5ffce311b914ef49a7c1ece076"
|
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.1.tgz#51162f3688cedf5ffce311b914ef49a7c1ece076"
|
||||||
|
|
Reference in New Issue