From 5a9160f82f4c64e2373aecebff1399f837b11a87 Mon Sep 17 00:00:00 2001 From: miguelangarano Date: Thu, 19 Mar 2026 22:10:29 -0500 Subject: [PATCH 1/2] feat: add gitlab example submodule --- .gitmodules | 3 +++ README.md | 1 + gitlab/README.md | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .gitmodules create mode 100644 gitlab/README.md diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d7bea76 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gitlab/gitlab-playwright-currents"] + path = gitlab/gitlab-playwright-currents + url = https://gitlab.com/currents.dev/gitlab-playwright-currents.git diff --git a/README.md b/README.md index b5f4006..0313195 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Examples demonstrating Playwright integration with Currents, including sharding, | [**GitHub Actions — Orchestration**](playwright/ci/github-actions/orchestration/) | Optimized parallel execution with load balancing | | [**GitHub Actions — Rerun Failed**](playwright/ci/github-actions/rerun-failed/) | Rerun only failed tests from a previous build | | [**GitHub Actions — Visual Testing**](playwright/ci/github-actions/argos/) | Integration with Argos for visual regression testing | +| [**GitLab CI**](gitlab/) | Playwright + Currents on GitLab CI ([source on GitLab](https://gitlab.com/currents.dev/gitlab-playwright-currents)) | | [**Jenkins**](playwright/ci/jenkins/jenkins-last-failed/) | Advanced Jenkins setup with Docker, Sharding, and "Last Failed" rerun | | [**Nx Monorepo**](playwright/ci/nx/) | Playwright in an Nx workspace | diff --git a/gitlab/README.md b/gitlab/README.md new file mode 100644 index 0000000..17b3446 --- /dev/null +++ b/gitlab/README.md @@ -0,0 +1,27 @@ +# GitLab + +Playwright + Currents examples that live in GitLab (not vendored in full in this monorepo). + +## Playwright on GitLab CI + +The reference project is hosted here: + +**[gitlab.com/currents.dev/gitlab-playwright-currents](https://gitlab.com/currents.dev/gitlab-playwright-currents)** + +Clone it from GitLab, or use the git submodule in this repo (see below). + +### Submodule checkout + +This repository includes [`gitlab-playwright-currents`](./gitlab-playwright-currents/) as a **git submodule** pointing at that GitLab project. After cloning `currents-examples`: + +```bash +git submodule update --init --recursive +``` + +Or clone with submodules in one step: + +```bash +git clone --recurse-submodules https://github.com/currents-dev/currents-examples.git +``` + +If the submodule directory is empty, run `git submodule update --init gitlab/gitlab-playwright-currents` from the repo root. From d7b5b326974511e960f370ab6b17745208fa494f Mon Sep 17 00:00:00 2001 From: miguelangarano Date: Thu, 19 Mar 2026 22:12:56 -0500 Subject: [PATCH 2/2] chore: fix readme --- gitlab/README.md | 78 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/gitlab/README.md b/gitlab/README.md index 17b3446..4dc8599 100644 --- a/gitlab/README.md +++ b/gitlab/README.md @@ -1,27 +1,73 @@ -# GitLab +# 🎭 Currents - Playwright - GitLab CI/CD -Playwright + Currents examples that live in GitLab (not vendored in full in this monorepo). +This repo showcases [Playwright](https://playwright.dev/) integration with [Currents](https://currents.dev). The example is based on https://github.com/MarcusFelling/demo.playwright, the [basic](./basic) test scenarios. -## Playwright on GitLab CI +

+ +

-The reference project is hosted here: +See the [`.gitlab-ci.yml`](.gitlab-ci.yml) file - it created a GitLab CI pipeline with 3 workers using 3 [Playwright Shards](https://playwright.dev/docs/test-sharding). -**[gitlab.com/currents.dev/gitlab-playwright-currents](https://gitlab.com/currents.dev/gitlab-playwright-currents)** +Example command: -Clone it from GitLab, or use the git submodule in this repo (see below). +```sh +npx pwc --key $CURRENTS_RECORD_KEY --project-id bnsqNa --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL +``` -### Submodule checkout +## Setup -This repository includes [`gitlab-playwright-currents`](./gitlab-playwright-currents/) as a **git submodule** pointing at that GitLab project. After cloning `currents-examples`: +- Create an account at https://app.currents.dev and grab the **Project ID** and **Record Key**. +- Add `CURRENTS_RECORD_KEY` as [GitLab CI/CD Secrets](https://docs.gitlab.com/ee/ci/variables/) (make sure it's not protected) +- [Optional] Add `CURRENTS_API_KEY` as [GitLab CI/CD Secrets](https://docs.gitlab.com/ee/ci/variables/) (only used in the examples with `npx currents api` commands) -```bash -git submodule update --init --recursive -``` +Additional resources: -Or clone with submodules in one step: +- Playwright Features on Currents: https://currents.dev/playwright +- Integration Documentation: https://currents.dev/readme/integration-with-playwright/currents-playwright +- CI Build ID Guide: https://currents.dev/readme/guides/cypress-ci-build-id -```bash -git clone --recurse-submodules https://github.com/currents-dev/currents-examples.git -``` +## Additional examples + +- [`.gitlab-ci.yml`](.gitlab-ci.yml) - The basic 3 parrallel job sharded pipeline +- Examples of running only the failed tests when retrying a CI pipeline/job + - For `playwright test` (with currents reporter) : [`./gitlab/ci/with-reruns-reporter.yml`](./gitlab/ci/with-reruns-reporter.yml) + - For `pwc` : [`./gitlab/ci/with-reruns-pwc.yml`](./gitlab/ci/with-reruns-pwc.yml) + - For `pwc-p` (orchestration) : [`./gitlab/ci/with-reruns-pwcp.yml`](./gitlab/ci/with-reruns-pwcp.yml) + +## GitLab CI Playwright Results + +The results are being reported to Currents for more efficient troubleshooting, and monitoring test suite flakiness and performance. + +Currents will collect the following information: + +- console output +- screenshots +- videos +- trace files +- timing +- outcomes +- flaky tests +- error details +- tags for more convenient management of the tests + +### GitLab Merge Request Notes + +Take a look at the example merge request: https://gitlab.com/currents.dev/gitlab-playwright-currents/-/merge_requests/3 + +When [GitLab integration](https://currents.dev/readme/integrations/gitlab) is enabled, Currents will post a Merge Commit note with run results: + +

+ +

+ +In addition, Currents will post an [External Status check](https://docs.gitlab.com/ee/user/project/merge_requests/status_checks.html) for every Playwright project configured. For example: + +

+ +

+ +### Example of Playwright run reported to GitLab CI/CD -If the submodule directory is empty, run `git submodule update --init gitlab/gitlab-playwright-currents` from the repo root. + + Video +