diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-percy-selenium.spec | 284 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 286 insertions, 0 deletions
@@ -0,0 +1 @@ +/percy-selenium-1.1.0.tar.gz diff --git a/python-percy-selenium.spec b/python-percy-selenium.spec new file mode 100644 index 0000000..7a55deb --- /dev/null +++ b/python-percy-selenium.spec @@ -0,0 +1,284 @@ +%global _empty_manifest_terminate_build 0 +Name: python-percy-selenium +Version: 1.1.0 +Release: 1 +Summary: Python client for visual testing with Percy +License: MIT +URL: https://github.com/percy/percy-selenium-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6a/29/aee6dcf53b9f2f3a4448b6d7665368a1dae493d19b16e956732b1f5ba405/percy-selenium-1.1.0.tar.gz +BuildArch: noarch + +Requires: python3-selenium +Requires: python3-requests + +%description +# percy-selenium-python + + +[Percy](https://percy.io) visual testing for Python Selenium. + +## Installation + +npm install `@percy/cli`: + +```sh-session +$ npm install --save-dev @percy/cli +``` + +pip install Percy selenium package: + +```ssh-session +$ pip install percy-selenium +``` + +## Usage + +This is an example test using the `percy_snapshot` function. + +``` python +from percy import percy_snapshot + +browser = webdriver.Firefox() +browser.get('http://example.com') + +# take a snapshot +percy_snapshot(browser, 'Python example') +``` + +Running the test above normally will result in the following log: + +```sh-session +[percy] Percy is not running, disabling snapshots +``` + +When running with [`percy +exec`](https://github.com/percy/cli/tree/master/packages/cli-exec#percy-exec), and your project's +`PERCY_TOKEN`, a new Percy build will be created and snapshots will be uploaded to your project. + +```sh-session +$ export PERCY_TOKEN=[your-project-token] +$ percy exec -- [python test command] +[percy] Percy has started! +[percy] Created build #1: https://percy.io/[your-project] +[percy] Snapshot taken "Python example" +[percy] Stopping percy... +[percy] Finalized build #1: https://percy.io/[your-project] +[percy] Done! +``` + +## Configuration + +`percy_snapshot(driver, name[, **kwargs])` + +- `driver` (**required**) - A selenium-webdriver driver instance +- `name` (**required**) - The snapshot name; must be unique to each snapshot +- `**kwargs` - [See per-snapshot configuration options](https://docs.percy.io/docs/cli-configuration#per-snapshot-configuration) + +### Migrating Config + +If you have a previous Percy configuration file, migrate it to the newest version with the +[`config:migrate`](https://github.com/percy/cli/tree/master/packages/cli-config#percy-configmigrate-filepath-output) command: + +```sh-session +$ percy config:migrate +``` + + +%package -n python3-percy-selenium +Summary: Python client for visual testing with Percy +Provides: python-percy-selenium +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-percy-selenium +# percy-selenium-python + + +[Percy](https://percy.io) visual testing for Python Selenium. + +## Installation + +npm install `@percy/cli`: + +```sh-session +$ npm install --save-dev @percy/cli +``` + +pip install Percy selenium package: + +```ssh-session +$ pip install percy-selenium +``` + +## Usage + +This is an example test using the `percy_snapshot` function. + +``` python +from percy import percy_snapshot + +browser = webdriver.Firefox() +browser.get('http://example.com') + +# take a snapshot +percy_snapshot(browser, 'Python example') +``` + +Running the test above normally will result in the following log: + +```sh-session +[percy] Percy is not running, disabling snapshots +``` + +When running with [`percy +exec`](https://github.com/percy/cli/tree/master/packages/cli-exec#percy-exec), and your project's +`PERCY_TOKEN`, a new Percy build will be created and snapshots will be uploaded to your project. + +```sh-session +$ export PERCY_TOKEN=[your-project-token] +$ percy exec -- [python test command] +[percy] Percy has started! +[percy] Created build #1: https://percy.io/[your-project] +[percy] Snapshot taken "Python example" +[percy] Stopping percy... +[percy] Finalized build #1: https://percy.io/[your-project] +[percy] Done! +``` + +## Configuration + +`percy_snapshot(driver, name[, **kwargs])` + +- `driver` (**required**) - A selenium-webdriver driver instance +- `name` (**required**) - The snapshot name; must be unique to each snapshot +- `**kwargs` - [See per-snapshot configuration options](https://docs.percy.io/docs/cli-configuration#per-snapshot-configuration) + +### Migrating Config + +If you have a previous Percy configuration file, migrate it to the newest version with the +[`config:migrate`](https://github.com/percy/cli/tree/master/packages/cli-config#percy-configmigrate-filepath-output) command: + +```sh-session +$ percy config:migrate +``` + + +%package help +Summary: Development documents and examples for percy-selenium +Provides: python3-percy-selenium-doc +%description help +# percy-selenium-python + + +[Percy](https://percy.io) visual testing for Python Selenium. + +## Installation + +npm install `@percy/cli`: + +```sh-session +$ npm install --save-dev @percy/cli +``` + +pip install Percy selenium package: + +```ssh-session +$ pip install percy-selenium +``` + +## Usage + +This is an example test using the `percy_snapshot` function. + +``` python +from percy import percy_snapshot + +browser = webdriver.Firefox() +browser.get('http://example.com') + +# take a snapshot +percy_snapshot(browser, 'Python example') +``` + +Running the test above normally will result in the following log: + +```sh-session +[percy] Percy is not running, disabling snapshots +``` + +When running with [`percy +exec`](https://github.com/percy/cli/tree/master/packages/cli-exec#percy-exec), and your project's +`PERCY_TOKEN`, a new Percy build will be created and snapshots will be uploaded to your project. + +```sh-session +$ export PERCY_TOKEN=[your-project-token] +$ percy exec -- [python test command] +[percy] Percy has started! +[percy] Created build #1: https://percy.io/[your-project] +[percy] Snapshot taken "Python example" +[percy] Stopping percy... +[percy] Finalized build #1: https://percy.io/[your-project] +[percy] Done! +``` + +## Configuration + +`percy_snapshot(driver, name[, **kwargs])` + +- `driver` (**required**) - A selenium-webdriver driver instance +- `name` (**required**) - The snapshot name; must be unique to each snapshot +- `**kwargs` - [See per-snapshot configuration options](https://docs.percy.io/docs/cli-configuration#per-snapshot-configuration) + +### Migrating Config + +If you have a previous Percy configuration file, migrate it to the newest version with the +[`config:migrate`](https://github.com/percy/cli/tree/master/packages/cli-config#percy-configmigrate-filepath-output) command: + +```sh-session +$ percy config:migrate +``` + + +%prep +%autosetup -n percy-selenium-1.1.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-percy-selenium -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1 +- Package Spec generated @@ -0,0 +1 @@ +b1e41f20dc2cd8886e823a8b43f6fd7a percy-selenium-1.1.0.tar.gz |
