Merge pull request #1660 from SkynetLabs/reenable-end-to-end-upload-test
reenable end to end uploader test
This commit is contained in:
commit
2715de1ef3
|
@ -36,8 +36,10 @@ jobs:
|
||||||
working-directory: packages/website
|
working-directory: packages/website
|
||||||
install: false
|
install: false
|
||||||
record: true
|
record: true
|
||||||
start: yarn serve
|
start: yarn develop
|
||||||
wait-on: "http://127.0.0.1:9000"
|
wait-on: http://localhost:8000
|
||||||
|
wait-on-timeout: 120
|
||||||
|
config: baseUrl=http://localhost:8000
|
||||||
|
|
||||||
- name: "Deploy to Skynet"
|
- name: "Deploy to Skynet"
|
||||||
uses: skynetlabs/deploy-to-skynet-action@v2
|
uses: skynetlabs/deploy-to-skynet-action@v2
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"baseUrl": "http://127.0.0.1:9000",
|
"baseUrl": "http://localhost:8000",
|
||||||
"projectId": "gey76p",
|
"projectId": "gey76p",
|
||||||
"videoUploadOnPasses": false
|
"videoUploadOnPasses": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,27 +13,22 @@ context("Skynet website", () => {
|
||||||
cy.contains("Decentralized Internet");
|
cy.contains("Decentralized Internet");
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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 = "check.json";
|
cy.wait(1000); // delay for drag-and-drop to work properly every time
|
||||||
|
cy.get('.home-upload-dropzone input[type="file"]').selectFile("cypress/fixtures/example.json", { force: true });
|
||||||
|
|
||||||
// cy.wait(1000); // delay for drag-and-drop to work properly every time
|
cy.get(".home-uploaded-files").children().should("have.length", 1);
|
||||||
// cy.get('.home-upload input[type="file"]').attachFile(fileName, { subjectType: "drag-n-drop" });
|
|
||||||
|
|
||||||
// cy.get(".home-upload").scrollIntoView();
|
// wait max 2 minutes, the portal might be slow at times
|
||||||
// cy.get(".home-uploaded-files").children().should("have.length", 1);
|
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
|
||||||
|
|
||||||
// // wait max 2 minutes, the portal might be slow at times
|
cy.contains(".upload-file", "example.json").within(() => {
|
||||||
// cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
|
cy.get("a").invoke("text").should("include", "AADXKUI_ddg_CEkQ747MzMVndJDbCma5jtkgmAzFbl9-Iw");
|
||||||
|
|
||||||
// cy.contains(".upload-file", fileName).within(() => {
|
cy.contains("Copy").click();
|
||||||
// cy.get(".url")
|
cy.contains("Copied").should("be.visible");
|
||||||
// .invoke("text")
|
});
|
||||||
// .should("match", /\/[a-zA-Z0-9-_]{46}/);
|
});
|
||||||
|
|
||||||
// cy.contains("Copy Link").click();
|
|
||||||
// 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"
|
||||||
},
|
},
|
||||||
|
|
|
@ -167,9 +167,11 @@ const Uploader = () => {
|
||||||
|
|
||||||
{uploads.length > 0 && (
|
{uploads.length > 0 && (
|
||||||
<div className="flex flex-col space-y-5 px-4 py-10 desktop:p-14">
|
<div className="flex flex-col space-y-5 px-4 py-10 desktop:p-14">
|
||||||
|
<div className="home-uploaded-files">
|
||||||
{uploads.map((upload) => (
|
{uploads.map((upload) => (
|
||||||
<UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} />
|
<UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} />
|
||||||
))}
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
{showAccountFeatures && (
|
{showAccountFeatures && (
|
||||||
<div className="z-0 relative flex flex-col items-center space-y-1 pt-8">
|
<div className="z-0 relative flex flex-col items-center space-y-1 pt-8">
|
||||||
|
|
|
@ -110,7 +110,7 @@ export default function UploaderElement({ onUploadStateChange, upload }) {
|
||||||
}, [onUploadStateChange, upload, retryTimeout]);
|
}, [onUploadStateChange, upload, retryTimeout]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="upload-file">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
{upload.status === "enqueued" && <ArrowUpCircle className="flex-shrink-0 fill-current text-palette-300" />}
|
{upload.status === "enqueued" && <ArrowUpCircle className="flex-shrink-0 fill-current text-palette-300" />}
|
||||||
{upload.status === "retrying" && <ArrowUpCircle className="flex-shrink-0" />}
|
{upload.status === "retrying" && <ArrowUpCircle className="flex-shrink-0" />}
|
||||||
|
|
|
@ -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