Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a GitLab pipeline schedule to run a Playwright job on a cron cadence, save screenshots into a known directory, and publish that directory as a job artifact. The schedule targets a branch or tag and runs with its owner’s permissions, so configure both the job and its ownership before relying on recurring captures.

How the scheduled screenshot pipeline works

A GitLab schedule starts a pipeline independently of commits or merge requests. The pipeline runs the capture job from its configured branch or tag; Playwright opens the target pages and writes image files; GitLab artifacts retain those files for download and review.

  1. Add a Playwright capture script and a CI job that runs it.
  2. Configure the runner with a Playwright-compatible browser runtime.
  3. Save screenshots under a predictable directory and declare that directory under artifacts:paths.
  4. Create a pipeline schedule with a cron expression, target ref, and suitable timezone.
  5. Run the schedule once manually and confirm the pages, files, and artifacts before depending on recurrence.

Set up Playwright and the capture script

Playwright’s CI guidance recommends its public Docker image for GitLab CI, or installing browser dependencies with its CLI. Keep the image tag compatible with the Playwright package version in the project. The following example assumes a Node project whose lockfile and dependencies are committed.

Install the project dependency

Add @playwright/test as a project dependency and commit the resulting package-lock.json. The CI job below uses npm ci to install the locked dependency set. Select a pinned Playwright image tag compatible with that package version; the tag shown is a placeholder pattern, not a recommendation for a particular version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Create a script that captures your URLs

Create scripts/capture-screenshots.mjs. Ensure the destination directory exists, handle navigation failures as errors, and choose a readiness condition appropriate to the site rather than assuming every page is ready at the same point.

import { chromium } from '@playwright/test';
import { mkdir } from 'node:fs/promises';

const urls = [
  { name: 'home', url: 'https://www.example.com' },
  { name: 'pricing', url: 'https://www.example.com/pricing' },
];

await mkdir('screenshots', { recursive: true });
const browser = await chromium.launch();

try {
  for (const { name, url } of urls) {
    const page = await browser.newPage();
    const response = await page.goto(url, {
      waitUntil: 'networkidle',
      timeout: 60_000,
    });

    if (!response || !response.ok()) {
      throw new Error(`Navigation failed for ${url}: ${response?.status() ?? 'no response'}`);
    }

    await page.screenshot({ path: `screenshots/${name}.png`, fullPage: true });
    await page.close();
  }
} finally {
  await browser.close();
}

This example deliberately fails the job if navigation produces no response or a non-success HTTP status. Adjust that policy if the site intentionally uses a different status, and add authentication, consent handling, or explicit readiness checks when the target requires them. A long-lived request can prevent networkidle from becoming suitable; in that case use another wait condition or wait for a page-specific selector before capturing.

Configure the GitLab CI job and preserve the files

Add a job to .gitlab-ci.yml. GitLab’s job artifact documentation describes artifacts as archived files or directories produced by jobs; paths selects what gets included.

stages:
  - capture

capture_screenshots:
  stage: capture
  image: mcr.microsoft.com/playwright:<pinned-version>-noble
  script:
    - npm ci
    - node scripts/capture-screenshots.mjs
  artifacts:
    when: always
    paths:
      - screenshots/
    expire_in: 7 days

Replace <pinned-version> with a real image tag compatible with the package version. The seven-day artifact lifetime is illustrative: choose retention based on how long reviewers need the files and project storage policy. GitLab documents a default maximum artifact file size of 100 MB, but this platform setting can vary by offering or configuration; check the target instance before relying on it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

when: always asks GitLab to upload artifacts even if the script fails, which can help preserve any screenshots captured before an error. It does not make a failed job successful. If the script never creates files, there will be no screenshots to retrieve.

Create and manage the GitLab pipeline schedule

In GitLab, open the project and go to Build > Pipeline schedules, then create a schedule. Set the cron expression, timezone, target branch or tag, and any supported inputs. GitLab’s schedule setup and permission requirements are documented in its pipeline schedules guide.

Choose a cron cadence and timezone

Cron has five fields: minute, hour, day of month, month, and day of week. For example, 0 * * * * runs at the start of every hour. A daily run at 06:30 is 30 6 * * *. The timezone determines how those clock times map to actual runs, including daylight-saving changes where applicable.

GitLab instances may enforce a maximum schedule frequency, so a cron expression that is valid syntactically may still be too frequent for a particular instance. GitLab also advises spreading similar schedules across different minute marks to avoid many pipelines starting together; for instance, avoid placing every hourly job at minute zero when staggered start times are acceptable.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Select the ref and account for schedule ownership

A schedule is attached to a branch or tag, and the scheduled pipeline uses that ref’s configuration. Choose a ref that contains the intended .gitlab-ci.yml and capture script. Scheduled pipelines run with the schedule owner’s permissions, so that account must retain suitable project access. Protected refs may require merge permission to schedule. If the owner is blocked or removed, the schedule can become inactive; assign an appropriate active owner and periodically verify the schedule still runs.

Pass configuration safely

GitLab recommends pipeline inputs over variables for pipeline configuration, and schedule inputs persist for each scheduled run. If you use variables, remember that pipeline variables can have high precedence and may override values from other scopes. Do not place secrets in plain schedule inputs or print credentials in job logs. Use protected variables or the project’s secret-management mechanism according to its access model.

GitLab also supports schedule management through the pipeline schedules API and the GitLab CLI. The UI is a straightforward choice for an operator creating a schedule manually; API or CLI management is useful when schedule creation is part of an automated workflow.

Choose screenshot shape and retention deliberately

Viewport or full page

By default, a screenshot captures the visible viewport. Set fullPage: true to capture the full scrollable page, as in the script above. Viewport captures suit fixed-screen monitoring; full-page images cover long pages but can become large and may take longer to render or inspect. Playwright documents screenshot options in its screenshots guide.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Artifact lifetime and capture cadence

Set the schedule cadence to match how often a change would matter to a reviewer, and set artifact expiration to cover the review window without retaining files unnecessarily. These are project-specific choices: more frequent captures and longer retention create more artifacts to store and inspect. Compare the actual artifact size against the instance’s applicable limit.

Make recurring captures reproducible

Playwright cautions that screenshot rendering can vary with host operating system, browser version, browser settings, hardware, power source, and headless mode; see its visual comparison guidance. To make scheduled images useful for visual comparisons:

  • Keep the Playwright package and browser image version pinned and compatible.
  • Use the same CI image and runner environment for baseline and recurring captures whenever possible.
  • Keep viewport, device scale, locale, timezone, authentication state, and page readiness checks consistent.
  • Start with one worker in CI for stability; increase parallelism only when runner resources and site behavior support it.

Playwright does not recommend caching browser binaries in CI as a general optimization: restoring them can take as long as downloading them, and Linux system dependencies cannot be cached. Prefer a compatible image and measure pipeline duration before adding caching complexity.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

  • Browser launch fails: Check that the Docker image tag matches the installed Playwright package and that browser dependencies are present. Use the Playwright image or install dependencies with the Playwright CLI as documented for CI.
  • The job succeeds but the artifact is missing: Confirm the script writes to the exact path listed under artifacts:paths, that the directory is created, and that the job reaches its artifact-upload stage. Check the job log for upload errors or artifact size limits.
  • The screenshot is blank or incomplete: Navigation completion is not necessarily application readiness. Wait for a meaningful selector or a site-specific condition, and account for consent dialogs, login requirements, or delayed content.
  • networkidle hangs or times out: Pages with long-lived network connections may not become idle. Use a more appropriate navigation wait condition and an explicit selector or readiness check.
  • A schedule stops running: Check whether its owner was blocked or removed, whether the owner still has project access, and whether the schedule remains active.
  • A run is missed or delayed: Check the configured timezone, cron cadence and instance frequency limits, target branch or tag, and runner availability.
  • Images differ unexpectedly: Compare the runner OS, browser/package versions, viewport, settings, and execution mode with those used for the baseline. Environment differences can alter rendering even when the page content has not changed.

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server if you want a managed capture instead of maintaining a Playwright browser job. A single GET request can return an image or PDF; see the API documentation. For a scheduled pipeline, call it from a job and save the response as an artifact:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://www.example.com 
  -o shot.webp

Store the API key as a protected CI secret rather than committing it or placing it in a plain schedule input. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server exposes screenshot tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan to try scheduled captures without a card.

Frequently Asked Questions

Can a GitLab scheduled pipeline take screenshots every day?

Yes. Set a daily cron schedule, select the branch or tag containing the CI configuration, and retain the generated image directory as an artifact.

Where do I download screenshots from a GitLab pipeline?

Open the pipeline’s capture job and download its artifacts, provided the screenshot directory is included under artifacts:paths and has not expired.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.