This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/website/cypress/integration/intergration.spec.js

35 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2021-04-13 10:32:03 +00:00
/// <reference types="cypress" />
context("Skynet website", () => {
2022-03-03 13:55:28 +00:00
Cypress.on("uncaught:exception", (err, runnable) => {
return false; // returning false here prevents Cypress from failing the test
});
2021-04-13 10:32:03 +00:00
beforeEach(() => {
cy.visit("");
});
it("should render page title", () => {
cy.contains("Decentralized Internet");
});
2022-02-04 14:14:37 +00:00
it("should be able to upload a file", () => {
cy.intercept("POST", "/skynet/skyfile").as("upload");
2021-04-13 10:32:03 +00:00
2022-02-04 14:14:37 +00:00
cy.wait(1000); // delay for drag-and-drop to work properly every time
2022-03-04 15:15:27 +00:00
cy.get('.home-upload-dropzone input[type="file"]').selectFile("cypress/fixtures/example.json", { force: true });
2021-04-13 10:32:03 +00:00
2022-02-04 14:14:37 +00:00
cy.get(".home-uploaded-files").children().should("have.length", 1);
2021-04-13 10:32:03 +00:00
2022-02-04 14:14:37 +00:00
// wait max 2 minutes, the portal might be slow at times
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
2021-04-13 10:32:03 +00:00
2022-03-04 15:15:27 +00:00
cy.contains(".upload-file", "example.json").within(() => {
cy.get("a").invoke("text").should("include", "AADXKUI_ddg_CEkQ747MzMVndJDbCma5jtkgmAzFbl9-Iw");
2021-04-13 10:32:03 +00:00
2022-02-04 14:14:37 +00:00
cy.contains("Copy").click();
cy.contains("Copied").should("be.visible");
});
});
2021-04-13 10:32:03 +00:00
});