Files
openobserve/.github/workflows/playwright.yml
T
e2ad15f0c0 test: Framework rework Playwright e2e tests (#8118)
### **PR Type**
Tests, Enhancement


___

### **Description**
- Migrate sanity tests to enhanced framework

- Add robust SanityPage page-object methods

- Introduce logging and wait helpers

- Refactor service account tests setup


___

### Diagram Walkthrough


```mermaid
flowchart LR
  Specs["Playwright specs (sanity, serviceAccount)"]
  Utils["Enhanced test utils (fixtures, logger, waits)"]
  Pages["New page objects (SanityPage, etc.)"]
  Archives["Old specs archived (_old)"]

  Specs -- "use" --> Utils
  Specs -- "call" --> Pages
  Legacy["Legacy inline flows"] -- "moved to" --> Archives
  Legacy -- "replaced by" --> Pages
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>sanityPage.js</strong><dd><code>New Sanity page object with
robust flows</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-a0ac0217ef875311dc536edb97deda19927a64e73cede62123b97cbe7df113b8">+669/-0</a>&nbsp;
</td>

</tr>

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>2
files</summary><table>
<tr>
<td><strong>sanity.spec.js</strong><dd><code>Refactor to enhanced
fixtures and page object</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-89290ca55858ff744863278ee9381e32276c37a6c0718fb3f9dcba71a6451d91">+159/-442</a></td>

</tr>

<tr>
<td><strong>serviceAccount.spec.js</strong><dd><code>Migrate service
account tests to enhanced setup</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-270e1e217b97afe4d451df3a48a0bfb14db453241adf1b7388342292707d5bb1">+114/-36</a></td>

</tr>

</table></details></td></tr><tr><td><strong>Miscellaneous</strong></td><td><details><summary>2
files</summary><table>
<tr>
<td><strong>sanity.spec_old.js</strong><dd><code>Archive legacy sanity
spec implementation</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-51cb8e6cd5047c3d1ace254fa770ae74a3c13aa97e93315132dede6c4a84739a">+498/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>sanity2.spec_old.js</strong><dd><code>Archive legacy sanity2
spec with helpers</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-0e189adff26af46cfcc03f014d522c6a37ac268f7ad3e1a3ace1267bd64161e3">[link]</a>&nbsp;
&nbsp; </td>

</tr>
</table></details></td></tr><tr><td><strong>Additional
files</strong></td><td><details><summary>31 files</summary><table>
<tr>
  <td><strong>playwright.yml</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-7afcd2d8f7b49bda74843f209eefb7b2da45f7e7803bf2e4bd636699b76aa2d3">+7/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>package.json</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-a41ba7975823b7b2dc071285391f835fbefd33bfffeb5aa2fba3ae15425cc64f">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>changeOrgPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-1061a261a5b7ae8ffd6c4b48e382bb262289aacca97207aa15f00053b822038b">+224/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>enrichmentPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-98a7e60352ddf3be23cf70170559e637ef448c189cd9414448e9afff897c3019">+507/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>schemaLoadPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-6f0791c152c7a17e60e0167d52c4032edc6384553b69b9a94b81e380e98dd1d3">+265/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>schemaPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-1c0c0fc2fdbebae8c8aa7bef5ba92d31dee65238272581453e6f2b9a3f135468">+397/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>userPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-bba64431d6702ebcfd265dd690f81d8c06a285fb09016c4823ed3490403ed777">+26/-7</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>iamPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-e537da3c3eaa929da94df90ba76b3b17f08792c9de268de899d310d13740efcf">+13/-5</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>page-manager.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-565eab8b3c767ae50c9d05e591621d14f66b81af84d6b5ea6efe136c1c3933df">+11/-1</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>pipelinesPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-d5f2771fd1139c174c46d09a9ab2da0ea4588b853e2b87e4728322d072542f49">+9/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>reportsPage.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-bc6b666f3862dce898d9ca68d036f317305b3f3d063d6eda423f2d864d36be0f">+8/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>changeOrg.spec.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-d5557230e5f003c7c0129aab00855dc94501cc12a06b1f7814ff85d9fe389f47">+188/-149</a></td>

</tr>

<tr>
  <td><strong>enrichment.spec.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-f52a06db75e7593aee95da4e0b255cb0001aa6c2b416d30358858e2f39b0cdcd">+106/-319</a></td>

</tr>

<tr>
  <td><strong>schema.spec.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-72dd04280e3c77242b982bd7853ffa447428c0f9419c37a71d867ec7cd28d4b8">+121/-265</a></td>

</tr>

<tr>
  <td><strong>schemaload.spec.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-5184069ec159ab301454535a5f45967635972e108095b82401ba96cb92856c5b">+114/-184</a></td>

</tr>

<tr>
  <td><strong>usersOrg.spec.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-0bf40521e88d2cf427617e49affa14d4ebe469b6da4ea4aeef4fe3e246eb24c7">+177/-77</a></td>

</tr>

<tr>
  <td><strong>enhanced-baseFixtures.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-3657cfe42414b97b6676be58109d3c3f92e8ba2f52bb09840b65ac9f9c889997">+137/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>framework-test.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-d3d8309ee6bdfb8edd0e39b4f8d2008ffe07775f130882a60b0509b29ae1a15d">+33/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>global-setup.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-06323dad7214f86b41b62e121e716eeea0054bc4d950c6bcf4a0efe53894acc8">+147/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>global-teardown.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-f3a6f320a6dd08450cf34d96f07847b9324fff8415f768963252ce0e1e35315e">+30/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>slack-reporter.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-29fdf4df416fe8e9965be16bc0419787175c227c385ac37560da40dc935328f5">+162/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>test-logger.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-9ad67a2a3dbfce3994655b30eb07c0a1b795ce0dc10ae9785481f9472394ce5e">+202/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>wait-helpers.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-fdf1e3fd5f38875694acd5e3f0a140ed89326ce8a2910f07b18d1004fd5d2165">+331/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>playwright.config.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-91cb9615068914b2e4f5d66fcbed50d3e9771ea2d882f8e8048bbe54eab3c414">+19/-7</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>changeOrg.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-1a658a67b111f3f391520406aed0a66793d0e91c3157dca683a6e3603ff37bc6">+239/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>enrichment.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-92bb2446bdc69b0b0a88ea39a9ae169f5266e6021df70ea50149f0c624f1b7f9">+325/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>sanity2_consolidated.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-59079f7e0748f2f8d484ea6537936f8bfc488793799fa118c5f92c710645e175">+76/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td><strong>schema.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-61f5d68bba432d1c3c14d155e24088dd5849e90df5f4e636bf79c6477947105e">+275/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>schemaload.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-f230c8cf8362435b93ca2346369054471f362221d4209308616eb256970f8c8e">+188/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>serviceAccount.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-fed6804e49039a3e8ad282d4db4ddf9da8afc954bdb4c4dbc0cdeccbe1f3f1c0">+138/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>usersOrg.spec_old.js</strong></td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8118/files#diff-e7b7c318f5ca80a33d8351d60134f6ff3983d89e76e517eb0d8e94ca9b30fac9">+211/-0</a>&nbsp;
</td>

</tr>
</table></details></td></tr></tr></tbody></table>

</details>

___

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Neha P <144308844+neha00290@users.noreply.github.com>
Co-authored-by: ktx-akshay <akshay.patil@kiara.tech>
2025-08-29 00:30:23 +05:30

338 lines
10 KiB
YAML

name: Playwright UI Tests
on:
push:
branches:
- "main"
paths-ignore:
- "**.md"
- "**.yml"
- "**.yaml"
# paths:
# - "web/**"
pull_request:
branches:
- "*"
paths-ignore:
- "**.md"
- "**.yml"
- "**.yaml"
# paths:
# - "web/**"
env:
COLUMNS: 150
ZO_ROOT_USER_EMAIL: root@example.com
ZO_ROOT_USER_PASSWORD: Complexpass#123
ZO_BASE_URL: http://localhost:5080
WS_ZO_BASE_URL: ws://localhost:5080
ZO_BASE_URL_SC: http://localhost:5080
ZO_BASE_URL_SC_UI: http://localhost:5080
INGESTION_URL: http://localhost:5080
ORGNAME: default
ZO_QUICK_MODE_NUM_FIELDS: 100
ZO_QUICK_MODE_STRATEGY: first
ZO_ALLOW_USER_DEFINED_SCHEMAS: true
ZO_INGEST_ALLOWED_UPTO: 5
ZO_FEATURE_QUERY_EXCLUDE_ALL: false
ZO_USAGE_BATCH_SIZE: 200
ZO_USAGE_PUBLISH_INTERVAL: 2
ZO_USAGE_REPORTING_ENABLED: true
ZO_MIN_AUTO_REFRESH_INTERVAL: 5
ZO_STREAMING_ENABLED: true
ZO_COLS_PER_RECORD_LIMIT: "80000"
ZO_SMTP_ENABLED: true
ZO_FORMAT_STREAM_NAME_TO_LOWERCASE: false
ZO_CREATE_ORG_THROUGH_INGESTION: true
ZO_UTF8_VIEW_ENABLED: false
jobs:
build_binary:
name: build_binary
runs-on:
labels: ubicloud-standard-16
steps:
- name: Remove unused tools
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Clone the current repo
uses: actions/checkout@v5
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-05-20
targets: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12"
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Build frontend code
env:
NODE_OPTIONS: "--max-old-space-size=8192"
VITE_COVERAGE: "true"
COVERAGE: "true"
run: cd web && npm install && npm run build
- name: Build and run binary
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debug-binary
path: target/x86_64-unknown-linux-gnu/release/openobserve
retention-days: 1
ui_integration_tests:
name: e2e / ${{ matrix.testfolder }}
needs: [build_binary]
runs-on:
labels: ubicloud-standard-8
container:
image: mcr.microsoft.com/playwright:v1.50.0-jammy
options: --user root
strategy:
matrix:
include:
- testfolder: "GeneralTests"
browser: "chrome"
run_files: [
"sanity.spec.js",
"changeOrg.spec.js",
"enrichment.spec.js",
"schema.spec.js",
"schemaload.spec.js",
"serviceAccount.spec.js",
"usersOrg.spec.js"
]
- testfolder: "Logs-Core"
browser: "chrome"
run_files: [
"join.spec.js",
"logshistogram.spec.js",
"logspage.spec.js",
"logsquickmode.spec.js",
"pagination.spec.js",
"unflattened.spec.js"
]
- testfolder: "Logs-Queries"
browser: "chrome"
run_files: [
"logsqueries.spec.js",
"secondsPrecisionAdded.spec.js",
"logsqueries.cte.spec.js",
"logsqueries.matchall.spec.js",
"searchpartition.spec.js"
]
- testfolder: "Alerts"
browser: "chrome"
run_files: [
"alerts-e2e-flow.spec.js",
"alerts-ui-operations.spec.js",
"alerts-import.spec.js"
]
- testfolder: "Dashboards-Core"
browser: "chrome"
run_files: [
"dashboard.spec.js",
"dashboard2.spec.js",
"dashboardtype.spec.js",
"dashboard-folder.spec.js",
"dashboard-import.spec.js"
]
- testfolder: "Dashboards-Settings"
browser: "chrome"
run_files: [
"dashboard-filter.spec.js",
"dashboard-general-setting.spec.js",
"dashboard-tabs-setting.spec.js",
"dashboard-variables-setting.spec.js",
"dashboard-transpose.spec.js"
]
- testfolder: "Dashboards-Charts"
browser: "chrome"
run_files: [
"custom-charts.spec.js",
"dashboard-geoMap.spec.js",
"dashboard-maps.spec.js",
"dashboard-multi-y-axis.spec.js",
"dashboard-html-chart.spec.js"
# "visualize.spec.js",
# "visualization-vrl.spec.js"
]
- testfolder: "Pipelines"
browser: "chrome"
run_files: [
"pipelines.spec.js",
"pipeline-dynamic.spec.js",
"pipeline-core.spec.js",
# "remotepipeline.spec.js"
]
- testfolder: "Reports"
browser: "chrome"
run_files: [
"reportsUpdated.spec.js",
"reportsUpdated2.spec.js"
]
- testfolder: "Streams"
browser: "chrome"
run_files: [
"multiselect-stream.spec.js",
"streamname.spec.js",
"streaming.spec.js"
]
steps:
- name: Clone the current repo
uses: actions/checkout@v5
- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: debug-binary
path: debug-binary
- name: Start OpenObserve
run: chmod +x ./debug-binary/openobserve && ./debug-binary/openobserve > o2.log 2>&1 &
- name: Wait for start
run: sleep 15
- name: Ensure we are getting a reply from the server
run: curl http://localhost:5080/web/login
- name: Create coverage json folder
run: mkdir -p tests/ui-testing/.nyc_output
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies and run ui-tests
run: |
touch .env
echo "ZO_ROOT_USER_EMAIL=${ZO_ROOT_USER_EMAIL}" >> .env
echo "ZO_ROOT_USER_PASSWORD=${ZO_ROOT_USER_PASSWORD}" >> .env
echo "ZO_BASE_URL=${ZO_BASE_URL}" >> .env
echo "WS_ZO_BASE_URL=${WS_ZO_BASE_URL}" >> .env
echo "ZO_BASE_URL_SC=${ZO_BASE_URL_SC}" >> .env
echo "ZO_BASE_URL_SC_UI=${ZO_BASE_URL_SC_UI}" >> .env
echo "INGESTION_URL=${INGESTION_URL}" >> .env
echo "ORGNAME=${ORGNAME}" >> .env
echo "ZO_SMTP_ENABLED=${ZO_SMTP_ENABLED}" >> .env
mv .env tests/ui-testing
cd tests/ui-testing && npm ci
# Get list of files to run using join function
FILE_LIST="${{ join(matrix.run_files, ' ') }}"
echo "DEBUG: FILE_LIST = $FILE_LIST"
echo "DEBUG: matrix.testfolder = ${{ matrix.testfolder }}"
if [ -n "$FILE_LIST" ]; then
# Map logical folder names to actual directories
case "${{ matrix.testfolder }}" in
"Logs-Core"|"Logs-Queries")
ACTUAL_FOLDER="Logs"
;;
"Dashboards-Core"|"Dashboards-Settings"|"Dashboards-Charts")
ACTUAL_FOLDER="Dashboards"
;;
*)
ACTUAL_FOLDER="${{ matrix.testfolder }}"
;;
esac
echo "DEBUG: ACTUAL_FOLDER = $ACTUAL_FOLDER"
# Build file paths
FILE_PATHS=""
for file in $FILE_LIST; do
FILE_PATH="./playwright-tests/$ACTUAL_FOLDER/$file"
echo "DEBUG: Will run file: $FILE_PATH"
FILE_PATHS="$FILE_PATHS $FILE_PATH"
done
# Run all specified files at once
echo "DEBUG: Final command: npx playwright test$FILE_PATHS"
npx playwright test $FILE_PATHS
else
echo "No files specified to run for ${{ matrix.testfolder }} folder"
fi
- name: Sanitize Test Folder Name
shell: bash
run: |
# Assign the matrix variable to a Bash variable
SANITIZED_FOLDERNAME="${{ matrix.testfolder }}"
# Export as a GitHub Actions environment variable
echo "SANITIZED_FOLDERNAME=$SANITIZED_FOLDERNAME" >> $GITHUB_ENV
- name: Upload Coverage Data
uses: actions/upload-artifact@v4
with:
name: playwright-coverage-${{ env.SANITIZED_FOLDERNAME }}
path: tests/ui-testing/.nyc_output
include-hidden-files: true
- name: Generate Coverage Report
run: cd tests/ui-testing && npx nyc report
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Check OpenObserve logs
if: always()
run: cat o2.log
generate_coverage_report:
name: Generate Coverage Report
needs: [build_binary, ui_integration_tests]
runs-on: ubicloud-standard-8
if: always()
steps:
- name: Clone the current repo
uses: actions/checkout@v5
- name: Download Playwright Coverage Data
uses: actions/download-artifact@v5
with:
pattern: playwright-coverage-* # Match all artifacts with this prefix
path: merged-coverage
merge-multiple: true
- name: Verify Downloaded Files
run: ls -R merged-coverage # Check the structure and contents
- name: Move Coverage Files to .nyc_output
run: |
mkdir -p tests/ui-testing/.nyc_output
mv merged-coverage/* tests/ui-testing/.nyc_output/ || echo "No files to move"
- name: Generate Coverage Report
run: cd tests/ui-testing && npm ci && npx nyc report
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: tests/ui-testing/coverage-report
retention-days: 7