From 4841e9434a319487b368669e43deda3782914cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Emarianfoo=E2=80=9C?= <13335743+marianfoo@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:17:37 +0100 Subject: [PATCH] chore: setup gh test for cert auth --- .github/workflows/wdi5-tests_auth.yml | 11 +++++++++++ examples/ui5-ts-app/.gitignore | 5 ++++- examples/ui5-ts-app/wdio-ui5.conf.ts | 5 +++-- package.json | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wdi5-tests_auth.yml b/.github/workflows/wdi5-tests_auth.yml index 683f0f31..267026eb 100644 --- a/.github/workflows/wdi5-tests_auth.yml +++ b/.github/workflows/wdi5-tests_auth.yml @@ -28,6 +28,8 @@ env: BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}} SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}} SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}} + SAPPFX_BASE64: ${{secrets.SAPPFX_BASE64}} + SAPPFX_PASSPHRASE: ${{secrets.SAPPFX_PASSPHRASE}} jobs: authorize: @@ -64,10 +66,19 @@ jobs: npm pkg delete scripts.prepare npm ci + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + # build things - name: build run: npm run build + - name: Create PFX file from secret + env: + SAPPFX_BASE64: ${{ secrets.SAPPFX_BASE64 }} + run: | + echo "$SAPPFX_BASE64" | base64 -d > examples/ui5-ts-app/sap.pfx + # this against the submodule cloned from https://github.com/SAP-samples/cap-bookshop-wdi5 - name: local CAP authentication run: npm run test:capAuth diff --git a/examples/ui5-ts-app/.gitignore b/examples/ui5-ts-app/.gitignore index fc218431..50323d21 100644 --- a/examples/ui5-ts-app/.gitignore +++ b/examples/ui5-ts-app/.gitignore @@ -15,4 +15,7 @@ node_modules/ # do not add dependency lock files to this repo because it should remain independent from specific dependency managers package-lock.json -yarn.lock \ No newline at end of file +yarn.lock + +# PFX file +sap.pfx diff --git a/examples/ui5-ts-app/wdio-ui5.conf.ts b/examples/ui5-ts-app/wdio-ui5.conf.ts index 28106e7b..d07895ea 100644 --- a/examples/ui5-ts-app/wdio-ui5.conf.ts +++ b/examples/ui5-ts-app/wdio-ui5.conf.ts @@ -16,6 +16,7 @@ export const config: wdi5Config = { "./test/e2e/multiremote.test.ts", "./test/e2e/BasicMultiRemoteAuthentication.test.ts", "./test/e2e/Authentication.test.ts", + "./test/e2e/AuthenticationCert.test.ts", "./test/e2e/ui5-late.test.ts", "./test/e2e/protocol/**/*.test.ts", "./test/e2e/workzone/**/*.test.ts" @@ -31,8 +32,8 @@ export const config: wdi5Config = { process.argv.indexOf("--headless") > -1 ? ["--headless"] : process.argv.indexOf("--debug") > -1 - ? ["window-size=1440,800", "--auto-open-devtools-for-tabs"] - : ["window-size=1440,800"] + ? ["window-size=1440,800", "--auto-open-devtools-for-tabs"] + : ["window-size=1440,800"] }, acceptInsecureCerts: true } diff --git a/package.json b/package.json index 0b69e093..5d0b933d 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "test:fe-app": "run-p -r _startApp:fe _test:fe-app", "//test:auth": "this runs either locally or on browserstack depending on the env variable BROWSERSTACK", "test:auth": "npm run test:authentication:bstack -w examples/ui5-ts-app", + "test:auth:cert": "npm run test:authentication:cert -w examples/ui5-ts-app", "test:capAuth": "run-p -r _startApp:cap _test:cap-app", "//test:protocol": "runs the same test with webdriver and devtools protocol", "test:protocol": "npm run test:protocol -w examples/ui5-ts-app",