File perl-Playwright.spec of Package perl-Playwright

#
# spec file for package perl-Playwright
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define cpan_name Playwright
Name:           perl-Playwright
Version:        1.532.0
Release:        0
# 1.532 -> normalize -> 1.532.0
%define cpan_version 1.532
License:        MIT
Summary:        Perl client for Playwright
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/T/TE/TEODESIAN/%{cpan_name}-%{cpan_version}.tar.gz
Source1:        cpanspec.yml
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Capture::Tiny)
BuildRequires:  perl(File::ShareDir)
BuildRequires:  perl(File::Which)
BuildRequires:  perl(JSON)
BuildRequires:  perl(JSON::MaybeXS)
BuildRequires:  perl(LWP::UserAgent)
BuildRequires:  perl(List::Util) >= 1.33
BuildRequires:  perl(Net::EmptyPort)
BuildRequires:  perl(Proc::ProcessTable)
BuildRequires:  perl(Sereal::Decoder)
BuildRequires:  perl(Sereal::Encoder)
BuildRequires:  perl(Sub::Install)
BuildRequires:  perl(Test2::Tools::Explain)
BuildRequires:  perl(Test2::V0)
BuildRequires:  perl(Test::Fatal)
BuildRequires:  perl(Test::Mock::Cmd)
BuildRequires:  perl(Test::MockFile)
BuildRequires:  perl(Test::MockModule)
BuildRequires:  perl(feature)
BuildRequires:  perl(parent)
Requires:       perl(Capture::Tiny)
Requires:       perl(File::ShareDir)
Requires:       perl(File::Which)
Requires:       perl(JSON)
Requires:       perl(JSON::MaybeXS)
Requires:       perl(LWP::UserAgent)
Requires:       perl(List::Util) >= 1.33
Requires:       perl(Net::EmptyPort)
Requires:       perl(Proc::ProcessTable)
Requires:       perl(Sereal::Decoder)
Requires:       perl(Sereal::Encoder)
Requires:       perl(Sub::Install)
Requires:       perl(feature)
Requires:       perl(parent)
Provides:       perl(Playwright) = %{version}
Provides:       perl(Playwright::APIRequest) = %{version}
Provides:       perl(Playwright::APIRequestContext) = %{version}
Provides:       perl(Playwright::APIResponse) = %{version}
Provides:       perl(Playwright::APIResponseAssertions) = %{version}
Provides:       perl(Playwright::Accessibility) = %{version}
Provides:       perl(Playwright::Android) = %{version}
Provides:       perl(Playwright::AndroidDevice) = %{version}
Provides:       perl(Playwright::AndroidInput) = %{version}
Provides:       perl(Playwright::AndroidSocket) = %{version}
Provides:       perl(Playwright::AndroidWebView) = %{version}
Provides:       perl(Playwright::Base) = %{version}
Provides:       perl(Playwright::Browser) = %{version}
Provides:       perl(Playwright::BrowserContext) = %{version}
Provides:       perl(Playwright::BrowserServer) = %{version}
Provides:       perl(Playwright::BrowserType) = %{version}
Provides:       perl(Playwright::CDPSession) = %{version}
Provides:       perl(Playwright::CDPSessionEvent) = %{version}
Provides:       perl(Playwright::Clock) = %{version}
Provides:       perl(Playwright::ConsoleMessage) = %{version}
Provides:       perl(Playwright::Coverage) = %{version}
Provides:       perl(Playwright::Dialog) = %{version}
Provides:       perl(Playwright::Download) = %{version}
Provides:       perl(Playwright::Electron) = %{version}
Provides:       perl(Playwright::ElectronApplication) = %{version}
Provides:       perl(Playwright::ElementHandle) = %{version}
Provides:       perl(Playwright::Error) = %{version}
Provides:       perl(Playwright::FileChooser) = %{version}
Provides:       perl(Playwright::FormData) = %{version}
Provides:       perl(Playwright::Frame) = %{version}
Provides:       perl(Playwright::FrameLocator) = %{version}
Provides:       perl(Playwright::GenericAssertions) = %{version}
Provides:       perl(Playwright::JSHandle) = %{version}
Provides:       perl(Playwright::Keyboard) = %{version}
Provides:       perl(Playwright::Locator) = %{version}
Provides:       perl(Playwright::LocatorAssertions) = %{version}
Provides:       perl(Playwright::Logger) = %{version}
Provides:       perl(Playwright::ModuleList) = %{version}
Provides:       perl(Playwright::Mouse) = %{version}
Provides:       perl(Playwright::Page) = %{version}
Provides:       perl(Playwright::PageAssertions) = %{version}
Provides:       perl(Playwright::PlaywrightAssertions) = %{version}
Provides:       perl(Playwright::PlaywrightException) = %{version}
Provides:       perl(Playwright::Request) = %{version}
Provides:       perl(Playwright::RequestOptions) = %{version}
Provides:       perl(Playwright::Response) = %{version}
Provides:       perl(Playwright::Route) = %{version}
Provides:       perl(Playwright::Selectors) = %{version}
Provides:       perl(Playwright::SnapshotAssertions) = %{version}
Provides:       perl(Playwright::TimeoutError) = %{version}
Provides:       perl(Playwright::Touchscreen) = %{version}
Provides:       perl(Playwright::Tracing) = %{version}
Provides:       perl(Playwright::Util) = %{version}
Provides:       perl(Playwright::Video) = %{version}
Provides:       perl(Playwright::WebError) = %{version}
Provides:       perl(Playwright::WebSocket) = %{version}
Provides:       perl(Playwright::WebSocketFrame) = %{version}
Provides:       perl(Playwright::WebSocketRoute) = %{version}
Provides:       perl(Playwright::Worker) = %{version}
%undefine       __perllib_provides
%{perl_requires}

%description
Perl interface to a lightweight node.js webserver that proxies commands
runnable by Playwright. Checks and automatically installs a copy of the
node dependencies in the local folder if needed.

Currently understands commands you can send to all the playwright classes
defined in api.json (installed wherever your OS puts shared files for CPAN
distributions).

See https://playwright.dev/versions and drill down into your relevant
version (run `npm list playwright` ) for what the classes do, and their
usage.

All the classes mentioned there will correspond to a subclass of the
Playwright namespace. For example:

    # ISA Playwright
    my $playwright = Playwright->new();
    # ISA Playwright::BrowserContext
    my $ctx = $playwright->newContext(...);
    # ISA Playwright::Page
    my $page = $ctx->newPage(...);
    # ISA Playwright::ElementHandle
    my $element = $ctx->select('body');

See example.pl for a more thoroughly fleshed-out display on how to use this
module.

%prep
%autosetup -n %{cpan_name}-%{cpan_version} -p1

%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build

%check
make test

%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist

%files -f %{name}.files
%doc Changes README
%license LICENSE

%changelog
openSUSE Build Service is sponsored by