diff --git a/.github/workflows/cypress-nightly.yml b/.github/workflows/cypress-nightly.yml index e67067169..abee0a225 100644 --- a/.github/workflows/cypress-nightly.yml +++ b/.github/workflows/cypress-nightly.yml @@ -45,6 +45,7 @@ jobs: python -m goth create-assets ../goth/assets sed -Ezi 's/(use\-proxy:\s)(True)/\1False/mg' ../goth/assets/goth-config.yml sed -Ezi 's/(use\-prerelease:\s)(false)/\1true\n release-tag: "0.13.0-rc10"/mg' ../goth/assets/goth-config.yml + sed -i '/^ENTRYPOINT/i ENV YAGNA_AUTOCONF_APPKEY=try_golem' ../goth/assets/docker/yagna-goth-deb.Dockerfile - name: Disconnect Docker containers from default network continue-on-error: true diff --git a/examples/web/app.mjs b/examples/web/app.mjs index cba7a3e46..138b90cc9 100644 --- a/examples/web/app.mjs +++ b/examples/web/app.mjs @@ -13,6 +13,20 @@ const server = http.createServer((req, res) => { } else if (req.url === "/image") { res.writeHead(200, { "content-type": "text/html" }); fs.createReadStream(`${__dirname}/image.html`).pipe(res); + } else if (req.url === "/docs-example-transfer-data") { + res.writeHead(200, { "content-type": "text/html" }); + fs.createReadStream(`${__dirname}/../docs-examples/examples/transferring-data/transferDatainBrowser.html`).pipe( + res, + ); + } else if (req.url === "/docs-example-transfer-json") { + res.writeHead(200, { "content-type": "text/html" }); + fs.createReadStream(`${__dirname}/../docs-examples/examples/transferring-data/uploadHSONinBrowser.html`).pipe(res); + } else if (req.url === "/docs-tutorial") { + res.writeHead(200, { "content-type": "text/html" }); + fs.createReadStream(`${__dirname}/../docs-examples/tutorials/running-from-browser/index.html`).pipe(res); + } else if (req.url === "/docs-quickstart") { + res.writeHead(200, { "content-type": "text/html" }); + fs.createReadStream(`${__dirname}/../docs-examples/quickstarts/web-quickstart/index.html`).pipe(res); } else if (req.url === "/golem-js.min.js") { res.writeHead(200, { "content-type": "text/javascript" }); fs.createReadStream(`${__dirname}/../../dist/golem-js.min.js`).pipe(res); diff --git a/tests/cypress/ui/docs-example-transfer-data.cy.ts b/tests/cypress/ui/docs-example-transfer-data.cy.ts new file mode 100644 index 000000000..43c32fdb9 --- /dev/null +++ b/tests/cypress/ui/docs-example-transfer-data.cy.ts @@ -0,0 +1,11 @@ +describe("Docs Examples Transfer Data", () => { + it("should transfer image file to provider", () => { + cy.visit("/docs-example-transfer-data"); + cy.fixture("golem.png", { encoding: null }).as("imageFile"); + cy.get("#MEME_IMG").selectFile("@imageFile"); + cy.get("#RUN").click(); + cy.get("#RESULT_MEME").should("have.attr", "src").and("contain", "blob:http://localhost:3000", { timeout: 60000 }); + cy.get("#logs").contains("computed by provider"); + cy.get("#logs").contains("Task Executor has shut down"); + }); +}); diff --git a/tests/cypress/ui/docs-example-transfer-json.cy.ts b/tests/cypress/ui/docs-example-transfer-json.cy.ts new file mode 100644 index 000000000..69b2ed9bc --- /dev/null +++ b/tests/cypress/ui/docs-example-transfer-json.cy.ts @@ -0,0 +1,9 @@ +describe("Docs Examples Transfer JSON", () => { + it("should transfer json to provider", () => { + cy.visit("/docs-example-transfer-json"); + cy.get("#echo").click(); + cy.get("#results").should("include.text", "TODO", { timeout: 60000 }); + cy.get("#logs").contains("computed by provider"); + cy.get("#logs").contains("Task Executor has shut down"); + }); +}); diff --git a/tests/cypress/ui/docs-quickstart.cy.ts b/tests/cypress/ui/docs-quickstart.cy.ts new file mode 100644 index 000000000..439f5e5a5 --- /dev/null +++ b/tests/cypress/ui/docs-quickstart.cy.ts @@ -0,0 +1,8 @@ +describe("Docs Examples Quickstart", () => { + it("should print hello world", () => { + cy.visit("/docs-example-quickstart"); + cy.get("#echo").click(); + cy.get("#results").should("include.text", "Hello World", { timeout: 60000 }); + cy.get("#logs").contains("Task Executor has shut down"); + }); +}); diff --git a/tests/cypress/ui/docs-tutorial.cy.ts b/tests/cypress/ui/docs-tutorial.cy.ts new file mode 100644 index 000000000..bd2719420 --- /dev/null +++ b/tests/cypress/ui/docs-tutorial.cy.ts @@ -0,0 +1,8 @@ +describe("Docs Examples Tutorial", () => { + it("should print hello world", () => { + cy.visit("/docs-example-tutorial"); + cy.get("#echo").click(); + cy.get("#results").should("include.text", "Hello World", { timeout: 60000 }); + cy.get("#logs").contains("Task Executor has shut down"); + }); +}); diff --git a/tests/cypress/ui/hello_world.cy.ts b/tests/cypress/ui/hello-world.cy.ts similarity index 100% rename from tests/cypress/ui/hello_world.cy.ts rename to tests/cypress/ui/hello-world.cy.ts