From b501fd182bce0fc59f44cba9c1fb1bd29e21bb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 20 Sep 2021 16:32:49 +0200 Subject: [PATCH 01/46] Create workflow This is a simple workflow just to test if you can trigger a workflow on a change of deployment status --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..db6a50e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,13 @@ +name: postdeploy + +on: deployment_status + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run a one-line script + run: echo Hello, world! From 5c3a501c9af4e0483ff6aa4a73834ccb2c58a47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 20 Sep 2021 16:36:39 +0200 Subject: [PATCH 02/46] Remove faulty line --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db6a50e..3dece3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,6 @@ name: postdeploy on: deployment_status - workflow_dispatch: jobs: build: From c4f08bdb407311f16ac22627b8c0be3e4e3fd6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 20 Sep 2021 16:37:59 +0200 Subject: [PATCH 03/46] Delete whitespace --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3dece3d..0a1daba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,11 @@ name: postdeploy on: deployment_status - + jobs: build: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v2 - name: Run a one-line script From e2e3a06f71b7e7bebb4dec0e9fa38e883d1410ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 20 Sep 2021 16:40:40 +0200 Subject: [PATCH 04/46] Add workflow dispatch --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a1daba..965cb2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,9 @@ name: postdeploy -on: deployment_status + +on: + deployment_status: + workflow_dispatch: jobs: build: From 5359a840881869e424c375fe1ea1453788b011ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 20 Sep 2021 16:50:35 +0200 Subject: [PATCH 05/46] Fix formatting --- .github/workflows/main.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 965cb2f..9e2d50a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,14 @@ -name: postdeploy - - -on: - deployment_status: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Run a one-line script - run: echo Hello, world! +name: postdeploy + +on: + deployment_status: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run a one-line script + run: echo Hello, world! From dd04e659f80997830ce7648b8bb40e6459e5e477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 15:42:00 +0200 Subject: [PATCH 06/46] Change syntax --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e2d50a..9fa35ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,6 @@ name: postdeploy -on: - deployment_status: - workflow_dispatch: +on: [deployment_status, workflow_dispatch] jobs: build: From f98916e09d5ab6147a69f3b730651845dd4c6a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 15:43:28 +0200 Subject: [PATCH 07/46] add push event --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fa35ec..be02fcd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: postdeploy -on: [deployment_status, workflow_dispatch] +on: [push, deployment_status, workflow_dispatch] jobs: build: From 4b78d4853bbb3af659a831c826cf2941db688369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 16:15:58 +0200 Subject: [PATCH 08/46] Add condition --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be02fcd..ff0131a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,10 @@ name: postdeploy -on: [push, deployment_status, workflow_dispatch] +on: [deployment_status] jobs: - build: + e2e: + if: github.event.deployment_status.state == 'success' runs-on: ubuntu-latest steps: From 0f947e6cee952ff58c912de9f3a27d9defe2d833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 16:32:24 +0200 Subject: [PATCH 09/46] add Cypress --- .github/workflows/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff0131a..7b02357 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,22 @@ name: postdeploy -on: [deployment_status] +on: [push, deployment_status, workflow_dispatch] jobs: e2e: - if: github.event.deployment_status.state == 'success' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Run a one-line script - run: echo Hello, world! + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2-beta + with: + node-version: 16 + + - name: Install modules + run: yarn + + - name: Run Cypress + uses: cypress-io/github-action@v2 From 32d3c727c20624c59c74a3039e025fa2733a2d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 16:48:44 +0200 Subject: [PATCH 10/46] Fix Cypress flow --- .gitignore | 6 ++++++ cypress/plugins/index.ts | 2 +- package.json | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f404a01..89aea86 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,9 @@ yarn-error.log* ### Output of 'npm pack' ### *.tgz + +### Cypress ### +cypress/results/* +cypress/reports/* +cypress/screenshots/* +cypress/videos/* diff --git a/cypress/plugins/index.ts b/cypress/plugins/index.ts index 298ca61..0205d9c 100644 --- a/cypress/plugins/index.ts +++ b/cypress/plugins/index.ts @@ -21,7 +21,7 @@ module.exports = (on, config) => { // `config` is the resolved Cypress config // copy any needed variables from process.env to config.env - config.env.JS_APP_URL = 'http://localhost:3000/'; + config.env.JS_APP_URL = process.env.JS_APP_URL; // do not forget to return the changed config object! return config; diff --git a/package.json b/package.json index cc6991e..588121b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "dev": "vite", "build": "tsc && vite build", "serve": "vite preview", - "e2e": "cypress open" + "e2e:local": "cypress open --env JS_APP_URL=https://localhost:3000/", + "e2e:ci": "cypress run --env JS_APP_URL=https://e2e.usebool.com/" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From fb98b1e9d73f831f797c26fe82a39589633c833e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 16:54:22 +0200 Subject: [PATCH 11/46] use correct Cypress command --- .github/workflows/main.yml | 11 ++++++++++- package.json | 3 +-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b02357..e8df12f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,4 +19,13 @@ jobs: run: yarn - name: Run Cypress - uses: cypress-io/github-action@v2 + uses: yarn e2e:ci + + + + + + uses: cypress-io/github-action@v2.9.7 + with: + env: + JS_APP_URL: https://e2e.usebool.com/ diff --git a/package.json b/package.json index 588121b..c3990ca 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "dev": "vite", "build": "tsc && vite build", "serve": "vite preview", - "e2e:local": "cypress open --env JS_APP_URL=https://localhost:3000/", - "e2e:ci": "cypress run --env JS_APP_URL=https://e2e.usebool.com/" + "e2e:local": "cypress open --env JS_APP_URL=https://localhost:3000/" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 93131587b2ff45c3c1d5486702f8ee14274a03d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 16:59:56 +0200 Subject: [PATCH 12/46] fix YAML syntax --- .github/workflows/main.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8df12f..42b8052 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,13 +19,7 @@ jobs: run: yarn - name: Run Cypress - uses: yarn e2e:ci - - - - - - uses: cypress-io/github-action@v2.9.7 - with: - env: - JS_APP_URL: https://e2e.usebool.com/ + uses: cypress-io/github-action@v2 + with: + env: + JS_APP_URL: https://e2e.usebool.com/ From 5adb1829b8500d8ce511b140857d50559bb83732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 17:01:31 +0200 Subject: [PATCH 13/46] fix YAML syntax --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42b8052..dadb80b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,5 +21,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: - JS_APP_URL: https://e2e.usebool.com/ + env: JS_APP_URL=https://e2e.usebool.com/ From ebce11a466a3a4e3cba23ee85947d7da1ecf9da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 17:04:47 +0200 Subject: [PATCH 14/46] Fix URL --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dadb80b..2fcf7f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,7 @@ jobs: with: node-version: 16 - - name: Install modules - run: yarn - - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://e2e.usebool.com/ + env: JS_APP_URL=https://e2e.usebool.com From fd59536fc216b69a37ee3ba57680224ad17d62dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 26 Sep 2021 17:07:11 +0200 Subject: [PATCH 15/46] Remove protocol --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fcf7f6..4af5098 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://e2e.usebool.com + env: JS_APP_URL=e2e.usebool.com From cd522994c704826ceabc49cbd3e8afa3d26b74a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 27 Sep 2021 08:44:09 +0200 Subject: [PATCH 16/46] Readd protocol --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4af5098..2fcf7f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=e2e.usebool.com + env: JS_APP_URL=https://e2e.usebool.com From 420fa2ebf77d61aa246225d4e42373fafe1c16a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:02:13 +0200 Subject: [PATCH 17/46] Use HTTP domain --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fcf7f6..369d6a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://e2e.usebool.com + env: JS_APP_URL=http://go.com From e9749296d0e1029d170ed1ee8fd4b968d460342c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:05:18 +0200 Subject: [PATCH 18/46] Try different HTTPS URI --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 369d6a3..37fdd5d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=http://go.com + env: JS_APP_URL=https://tinybits.dk From 46112ba0939dc758018d5fadb1116d7802dba87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:09:09 +0200 Subject: [PATCH 19/46] Run E2E against main domain --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37fdd5d..eecd142 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://tinybits.dk + env: JS_APP_URL=https://usebool.com From 8ca26890627c8ab89e35de6071b6da96d2e821c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:11:19 +0200 Subject: [PATCH 20/46] Run E2E against app subdomain --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eecd142..42a15f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://usebool.com + env: JS_APP_URL=https://app.usebool.com From 75149edfb0b9a5e3427689a493ec2f4aa932f48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:21:24 +0200 Subject: [PATCH 21/46] Try different subdomain --- .github/workflows/main.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42a15f0..e603ea3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://app.usebool.com + env: JS_APP_URL=https://app.roll20.net diff --git a/package.json b/package.json index c3990ca..ce90999 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dev": "vite", "build": "tsc && vite build", "serve": "vite preview", - "e2e:local": "cypress open --env JS_APP_URL=https://localhost:3000/" + "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From df42c7d3f2cb553e44768577c99a2c7cc9a39743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Tue, 28 Sep 2021 19:25:48 +0200 Subject: [PATCH 22/46] Run e2e against underlying Render URL --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e603ea3..c8e5f56 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://app.roll20.net + env: JS_APP_URL=https://bool-test-apps.onrender.com From c446f093edceba46585e264eaee8d163b8602ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 4 Oct 2021 16:18:06 +0200 Subject: [PATCH 23/46] Run Cypress as regular npm script --- .github/workflows/main.yml | 6 +----- package.json | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8e5f56..00443fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,4 @@ jobs: uses: actions/setup-node@v2-beta with: node-version: 16 - - - name: Run Cypress - uses: cypress-io/github-action@v2 - with: - env: JS_APP_URL=https://bool-test-apps.onrender.com + - run: npm run e2e:ci diff --git a/package.json b/package.json index ce90999..a08c571 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "dev": "vite", "build": "tsc && vite build", "serve": "vite preview", - "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com" + "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", + "e2e:ci": "cypress run --ci --env JS_APP_URL=https://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From e471d68022900b9bcb779b2b01e6fe08898c4a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 4 Oct 2021 16:21:54 +0200 Subject: [PATCH 24/46] run install script --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00443fc..05e4923 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,4 +14,5 @@ jobs: uses: actions/setup-node@v2-beta with: node-version: 16 + - run: npm install - run: npm run e2e:ci From 0ba3de9edd11056935107f85f62c6f8ee8dcc2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 4 Oct 2021 16:24:24 +0200 Subject: [PATCH 25/46] Remove unsupported ci flag --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a08c571..386c716 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --ci --env JS_APP_URL=https://e2e.usebool.com" + "e2e:ci": "cypress run --env JS_APP_URL=https://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 8805340abfdf82d381fe7ca19ee3aa8828fb25d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 4 Oct 2021 17:58:36 +0200 Subject: [PATCH 26/46] Attempt to run headed --- .github/workflows/main.yml | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05e4923..2fcf7f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,5 +14,8 @@ jobs: uses: actions/setup-node@v2-beta with: node-version: 16 - - run: npm install - - run: npm run e2e:ci + + - name: Run Cypress + uses: cypress-io/github-action@v2 + with: + env: JS_APP_URL=https://e2e.usebool.com diff --git a/package.json b/package.json index 386c716..1a7bc6a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --env JS_APP_URL=https://e2e.usebool.com" + "e2e:ci": "cypress run --headed --env JS_APP_URL=https://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 4f7a02f7e27b608e1e37d7451c36f1cd8ac64803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 17 Oct 2021 10:08:04 +0200 Subject: [PATCH 27/46] Run e2e against underlying URL --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1a7bc6a..f4e0b35 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --headed --env JS_APP_URL=https://e2e.usebool.com" + "e2e:ci": "cypress run --env JS_APP_URL=https://bool-test-apps.onrender.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 3ed3cd06b18952223772226ae8481c2fed7b4233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 17 Oct 2021 10:14:02 +0200 Subject: [PATCH 28/46] use config in action --- .github/workflows/main.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fcf7f6..c8e5f56 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: - env: JS_APP_URL=https://e2e.usebool.com + env: JS_APP_URL=https://bool-test-apps.onrender.com diff --git a/package.json b/package.json index f4e0b35..9173d01 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --env JS_APP_URL=https://bool-test-apps.onrender.com" + "e2e:ci": "cypress run" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 8bb100dad1a5f0b013617fba345b75938567f357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 17 Oct 2021 10:23:07 +0200 Subject: [PATCH 29/46] disable media --- .github/workflows/main.yml | 1 + cypress/integration/app.spec.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8e5f56..cbedd77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,3 +19,4 @@ jobs: uses: cypress-io/github-action@v2 with: env: JS_APP_URL=https://bool-test-apps.onrender.com + config: video=false,screenshotOnRunFailure=false diff --git a/cypress/integration/app.spec.ts b/cypress/integration/app.spec.ts index d37002f..840f24b 100644 --- a/cypress/integration/app.spec.ts +++ b/cypress/integration/app.spec.ts @@ -10,7 +10,7 @@ const DATA_EXAMPLE = { }; describe('Core JS app', () => { - beforeEach(() => { + before(() => { cy.visit(Cypress.env('JS_APP_URL')); }); From 2d0dca4400a89ed872a9012596a09ca57cf8c983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 17 Oct 2021 10:27:12 +0200 Subject: [PATCH 30/46] Add wait --- cypress/integration/app.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/integration/app.spec.ts b/cypress/integration/app.spec.ts index 840f24b..9bbbdf4 100644 --- a/cypress/integration/app.spec.ts +++ b/cypress/integration/app.spec.ts @@ -12,6 +12,7 @@ const DATA_EXAMPLE = { describe('Core JS app', () => { before(() => { cy.visit(Cypress.env('JS_APP_URL')); + cy.wait(4000); }); describe('getFeatures', () => { From c657b19e94d56d73a934c79caca98ab23f7b810c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 17 Oct 2021 10:31:05 +0200 Subject: [PATCH 31/46] Use normal node script --- .github/workflows/main.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbedd77..d27c830 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,5 +18,6 @@ jobs: - name: Run Cypress uses: cypress-io/github-action@v2 with: + command: yarn e2e:ci env: JS_APP_URL=https://bool-test-apps.onrender.com config: video=false,screenshotOnRunFailure=false diff --git a/package.json b/package.json index 9173d01..f4e0b35 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run" + "e2e:ci": "cypress run --env JS_APP_URL=https://bool-test-apps.onrender.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 785b372ef78eaf5f258746443576b5e1297581f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Mon, 18 Oct 2021 18:07:21 +0200 Subject: [PATCH 32/46] Add Cypress media artifacts --- .github/workflows/main.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d27c830..dff5106 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,4 +20,18 @@ jobs: with: command: yarn e2e:ci env: JS_APP_URL=https://bool-test-apps.onrender.com - config: video=false,screenshotOnRunFailure=false + config: video=true,screenshotOnRunFailure=true + + - name: Archive test screenshots + uses: actions/upload-artifact@v1 + with: + name: screenshots + path: cypress/screenshots + if: ${{ failure() }} + + - name: Archive test videos + uses: actions/upload-artifact@v1 + with: + name: videos + path: cypress/videos + if: ${{ failure() }} From 5feed2e4a1f6bc9b36a2322538376de4d719e2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 13:43:49 +0200 Subject: [PATCH 33/46] Add Circle CI config --- .circleci/config.yml | 25 +++++++++++++++++++++++++ src/main.ts | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2ae6f78 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +# This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' +version: 2.1 + +# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. +# See: https://circleci.com/docs/2.0/orb-intro/ +orbs: + node: circleci/node@4.7 + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + sample: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - node/test: + # This is the node version to use for the `cimg/node` tag + # Relevant tags can be found on the CircleCI Developer Hub + # https://circleci.com/developer/images/image/cimg/node + version: '16.10' + # If you are using yarn, change the line below from "npm" to "yarn" + pkg-manager: yarn + steps: + - checkout # check out the code in the project directory + - run: echo "hello world" # run the `echo` command + - run: yarn && yarn e2e:ci diff --git a/src/main.ts b/src/main.ts index 1db791f..8a5b61f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -36,6 +36,8 @@ const composeSingularFeatures = async () => { const featureTwo = await featureFlags.hasFeature(keys[1].key); const featureThree = await featureFlags.hasFeature(keys[2].key); + console.log(JSON.stringify(featureOne)); + return [featureOne, featureTwo, featureThree] .map((actualValue, i) => SingleItem({ ...keys[i], actualValue })) .join(''); From 94ac0a7796a4863c016ee0bf4cc648481540ae8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 13:48:47 +0200 Subject: [PATCH 34/46] Updated config.yml --- .circleci/config.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ae6f78..f715d38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,7 @@ version: 2.1 # See: https://circleci.com/docs/2.0/orb-intro/ orbs: node: circleci/node@4.7 + cypress: cypress-io/cypress@1.29.0 # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows @@ -18,8 +19,9 @@ workflows: # https://circleci.com/developer/images/image/cimg/node version: '16.10' # If you are using yarn, change the line below from "npm" to "yarn" - pkg-manager: yarn - steps: - - checkout # check out the code in the project directory - - run: echo "hello world" # run the `echo` command - - run: yarn && yarn e2e:ci + pkg-manager: yarn + - cypress/install: + yarn: true + + - cypress/run: + env: JS_APP_URL=https://bool-test-apps.onrender.com From f9f4b152a1b0e54acf82234fbe0da549853a71c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 13:52:06 +0200 Subject: [PATCH 35/46] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f715d38..1fa9e06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,4 +24,4 @@ workflows: yarn: true - cypress/run: - env: JS_APP_URL=https://bool-test-apps.onrender.com + env: JS_APP_URL=https://bool-test-apps.onrender.com From 2a8175293c77a0cff8f42e5b438b552d8d610caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 13:55:39 +0200 Subject: [PATCH 36/46] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1fa9e06..afd97e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ orbs: # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. + sample: # This is the name of the workflow, feel free to change it to better match your workflow.k # Inside the workflow, you define the jobs you want to run. jobs: - node/test: From 8b979e3fb4c3a45d19a119eb46afd7ed5b29918e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 13:57:32 +0200 Subject: [PATCH 37/46] Updated config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index afd97e9..57a0e45 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,9 +19,9 @@ workflows: # https://circleci.com/developer/images/image/cimg/node version: '16.10' # If you are using yarn, change the line below from "npm" to "yarn" - pkg-manager: yarn + pkg-manager: npm - cypress/install: - yarn: true + yarn: false - cypress/run: env: JS_APP_URL=https://bool-test-apps.onrender.com From 5b6c4aa71781f957738f63585dccde89d045a4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:04:19 +0200 Subject: [PATCH 38/46] Updated config.yml --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57a0e45..f561299 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,9 +19,14 @@ workflows: # https://circleci.com/developer/images/image/cimg/node version: '16.10' # If you are using yarn, change the line below from "npm" to "yarn" - pkg-manager: npm + pkg-manager: yarn + + - node/install-packages: + pkg-manager: yarn + with-cache: false + - cypress/install: - yarn: false + yarn: true - cypress/run: env: JS_APP_URL=https://bool-test-apps.onrender.com From 3160e382cec4b7d5b330dc58ba9296e754b5a96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:14:04 +0200 Subject: [PATCH 39/46] Updated config.yml --- .circleci/config.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f561299..7d5422b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,14 @@ orbs: node: circleci/node@4.7 cypress: cypress-io/cypress@1.29.0 +jobs: + example-job: + docker: + # replace with your preferred image + - image: cimg/base:stable + steps: + - node/install-packages + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: @@ -21,9 +29,7 @@ workflows: # If you are using yarn, change the line below from "npm" to "yarn" pkg-manager: yarn - - node/install-packages: - pkg-manager: yarn - with-cache: false + - example-job - cypress/install: yarn: true From 92505cf1167af79d351d3e420d03d81db7c1ff96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:29:11 +0200 Subject: [PATCH 40/46] Updated config.yml --- .circleci/config.yml | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d5422b..f3d7cf9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,38 +1,18 @@ # This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' version: 2.1 -# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. -# See: https://circleci.com/docs/2.0/orb-intro/ -orbs: - node: circleci/node@4.7 - cypress: cypress-io/cypress@1.29.0 - jobs: - example-job: - docker: - # replace with your preferred image - - image: cimg/base:stable + build: + machine: true steps: - - node/install-packages - -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows -workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow.k - # Inside the workflow, you define the jobs you want to run. - jobs: - - node/test: - # This is the node version to use for the `cimg/node` tag - # Relevant tags can be found on the CircleCI Developer Hub - # https://circleci.com/developer/images/image/cimg/node - version: '16.10' - # If you are using yarn, change the line below from "npm" to "yarn" - pkg-manager: yarn - - - example-job - - - cypress/install: - yarn: true + - checkout + - run: + name: Install npm + command: npm install + - run: + name: Install Cypress + command: npx cypress install + - run: + name: Run cypress ffs + command: npm e2e:ci - - cypress/run: - env: JS_APP_URL=https://bool-test-apps.onrender.com From 2d6e069ed5e220f51da7745dcf019b57fcaf007f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:36:32 +0200 Subject: [PATCH 41/46] Updated config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3d7cf9..047f542 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,12 +7,12 @@ jobs: steps: - checkout - run: - name: Install npm - command: npm install + name: Install yarn + command: yarn install - run: name: Install Cypress command: npx cypress install - run: name: Run cypress ffs - command: npm e2e:ci + command: yarn e2e:ci From 5fc4908ac795f76068453972bd11112001ecb111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:45:37 +0200 Subject: [PATCH 42/46] Updated config.yml --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 047f542..016ea3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,8 @@ version: 2.1 jobs: build: - machine: true + docker: + - image: circleci/node steps: - checkout - run: From 046157f8a1d80735d9a4f45839da207c5c5381ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:51:07 +0200 Subject: [PATCH 43/46] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 016ea3f..e510da3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2.1 jobs: build: docker: - - image: circleci/node + - image: cypress/base:14.16.0 steps: - checkout - run: From 05977690b32d13296c52a3320effaa6cf6151758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sat, 30 Oct 2021 14:55:08 +0200 Subject: [PATCH 44/46] Updated config.yml --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e510da3..0eab328 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,16 +4,19 @@ version: 2.1 jobs: build: docker: - - image: cypress/base:14.16.0 + - image: cypress/base:8 + environment: + ## this enables colors in the output + TERM: xterm steps: - checkout - run: - name: Install yarn - command: yarn install + name: Install npm + command: npm install - run: name: Install Cypress command: npx cypress install - run: name: Run cypress ffs - command: yarn e2e:ci + command: npm run e2e:ci From e2e07480a3a6fe57817fb598353c001095df51d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Sun, 7 Nov 2021 11:23:12 +0100 Subject: [PATCH 45/46] Use HTTP for Netlify --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f4e0b35..ecd32b8 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --env JS_APP_URL=https://bool-test-apps.onrender.com" + "e2e:ci": "cypress run --env JS_APP_URL=http://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5" From 5e4e6561d3874b10f746651ffb86421ba50e96bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikki=20Str=C3=B8msnes?= Date: Thu, 18 Nov 2021 09:42:13 +0100 Subject: [PATCH 46/46] Use HTTPS --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ecd32b8..386c716 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "tsc && vite build", "serve": "vite preview", "e2e:local": "cypress open --env JS_APP_URL=https://e2e.usebool.com", - "e2e:ci": "cypress run --env JS_APP_URL=http://e2e.usebool.com" + "e2e:ci": "cypress run --env JS_APP_URL=https://e2e.usebool.com" }, "dependencies": { "@usebool/sdk-js": "^0.1.5"