A simple Qlik Sense app, with all charts, hosted in GitHub pages via Qlik anonymous access. Includes some basic tests.
This repository provides a simple, hosted Qlik Sense app that demonstrates all available chart types. It includes:
- An embeddable web app (
embed/index.html
) for viewing the Qlik Sense app via Qlik's web components. - Automated deployment to GitHub Pages for the embed app. This is configured to deploy to a Qlik Cloud anonymous tenant (note this is why the NL object won't render).
- Automated deployment of the Qlik Sense app (
src/*.qvf
) to your Qlik Cloud tenant using GitHub Actions.
embed/
— Contains the embeddable web app and deployment scriptsindex.html
— Main embed page (uses Qlik web components)index.css
— Styling for the embed pageqlik-upload.js
— Node.js script to upload and publish Qlik Sense apps to your tenant
src/
— Contains Qlik Sense app files (.qvf
).github/workflows/
— GitHub Actions workflows for automationREADME.md
— This documentation
The embed/
directory contains several example HTML pages that use Qlik's web components to display Qlik Sense apps and charts in different configurations:
index.html
— Main embed page (uses Qlik web components)dual-classic-app.html
— Dual chart classic app examplesolo-classic-app.html
— Single classic app examplesolo-analytics-snapshot.html
— Analytics snapshot example (static data, no live backend required)configurator.html
— Interactive configuration UI for embedding charts
These pages require several Qlik Cloud variables to be injected at build/deploy time:
{{qlikHost}}
— Your Qlik Cloud tenant host (e.g.your-tenant.qlikcloud.com
){{qlikClientId}}
— OAuth client ID for anonymous access{{qlikAccessCode}}
— Access code for the anonymous app share{{qlikAppId}}
— The Qlik Sense app ID to display
These placeholders are replaced automatically during the GitHub Pages deployment workflow.
Workflow: .github/workflows/pages.yml
- Triggers: On push to
main
affectingembed/**
, or manually via workflow dispatch - Steps:
- Checks for required Qlik environment variables
- Replaces placeholders in
embed/index.html
with values from repository variables - Uploads the
embed/
directory as a GitHub Pages artifact - Deploys to GitHub Pages
QLIK_HOST
— Your Qlik Cloud tenant hostQLIK_CLIENT_ID
— OAuth client ID for anonymous accessQLIK_ACCESS_CODE
— Access code for the anonymous app shareQLIK_APP_ID
— The Qlik Sense app ID to embed
There are two workflows for working with Qlik Sense apps in this repository:
-
Workflow:
.github/workflows/qlik_app_deploy.yml
- Purpose: Deploys (uploads and publishes) Qlik Sense apps from
src/*.qvf
to your Qlik Cloud tenant for consumption via the embed page. - Triggers: On push to
main
affectingsrc/*.qvf
, or manually via workflow dispatch. - Steps:
- Installs dependencies
- Runs
embed/qlik-upload.js
to upload and publish the Qlik Sense app(s) to your tenant
- Purpose: Deploys (uploads and publishes) Qlik Sense apps from
-
Workflow:
.github/workflows/unbuild_app.yml
- Purpose: Extracts ("unbuilds") the definition of each Qlik Sense app in
src/
into a/diff
folder for version control and review. This does not deploy apps. - Triggers: On pull requests to
main
affectingsrc/**
, or manually via workflow dispatch. - Steps:
- For each
.qvf
insrc/
, imports the app to a temporary Qlik Cloud context - Runs
qlik app unbuild
to extract the app definition (without data) into/diff/<qvf-name>/
- Downloads any app images/media into
/diff/<qvf-name>/images/
- Commits and pushes changes in
/diff
if any are detected
- For each
- Purpose: Extracts ("unbuilds") the definition of each Qlik Sense app in
Note: Use
qlik-app-deploy.yml
to deploy apps to your tenant. Useunbuild_app.yml
to extract and version app definitions for code review and change tracking. The/diff
folder is only updated by the unbuild workflow and is not used for deployment.
QLIK_HOST
— Your Qlik Cloud tenant hostQLIK_ADMIN_CLIENT_ID
— Machine-to-machine OAuth client ID withadmin_classic
anduser_default
scopesQLIK_ADMIN_CLIENT_SECRET
(Secret) — Machine-to-machine OAuth client secret
- Go to your GitHub repository > Settings > Secrets and variables > Actions
- Add the following Variables:
QLIK_HOST
QLIK_CLIENT_ID
QLIK_ACCESS_CODE
QLIK_APP_ID
QLIK_ADMIN_CLIENT_ID
- Add the following Secret:
QLIK_ADMIN_CLIENT_SECRET
You can preview the embed app locally by opening embed/index.html
in your browser, but you must manually replace the {{qlikHost}}
, {{qlikClientId}}
, {{qlikAccessCode}}
, and {{qlikAppId}}
placeholders with your actual values.
For a better development experience, use the included Node.js development server:
-
Install dependencies:
npm install
-
Start the development server:
npm run dev # or node server.js
-
Open your browser and navigate to:
- Main app: http://localhost:3000
The server will serve all files from the embed/
directory and provide helpful console output with available routes and placeholder information.
Note: You'll still need to manually replace the Qlik placeholders in the HTML files with your actual values for the charts to render properly.
MIT License. See LICENSE.
This repository includes automated visual regression tests using Playwright. These tests ensure that the Qlik Sense charts render correctly and match the expected visual output.
-
Install dependencies:
npm install --no-save @playwright/test playwright npx playwright install --with-deps
-
Run the tests:
npx playwright test
- The tests navigate to the hosted Qlik Sense app and verify the presence of key elements.
- Visual regression checks are performed on the
.main-container
to ensure it matches the baseline image. - Timeout for rendering elements is set to 15 seconds to accommodate iframe loading delays.