diff options
Diffstat (limited to 'python-percy-python-selenium.spec')
| -rw-r--r-- | python-percy-python-selenium.spec | 304 |
1 files changed, 304 insertions, 0 deletions
diff --git a/python-percy-python-selenium.spec b/python-percy-python-selenium.spec new file mode 100644 index 0000000..e6827cd --- /dev/null +++ b/python-percy-python-selenium.spec @@ -0,0 +1,304 @@ +%global _empty_manifest_terminate_build 0 +Name: python-percy-python-selenium +Version: 1.0.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/0f/6f/96745634ec04a48801bf49cba166696b39f239a03caab1743c501ccc6131/percy-python-selenium-1.0.0.tar.gz +BuildArch: noarch + +Requires: python3-percy-selenium + +%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 +- Additional snapshot options (overrides any project options) (`**kwargs**`): + - `widths` - An array of widths to take screenshots at + - `min_height` - The minimum viewport height to take screenshots at + - `percy_css` - Percy specific CSS only applied in Percy's rendering environment + - `request_headers` - Headers that should be used during asset discovery + - `enable_javascript` - Enable JavaScript in Percy's rendering environment + +### 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-python-selenium +Summary: Python client for visual testing with Percy +Provides: python-percy-python-selenium +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-percy-python-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 +- Additional snapshot options (overrides any project options) (`**kwargs**`): + - `widths` - An array of widths to take screenshots at + - `min_height` - The minimum viewport height to take screenshots at + - `percy_css` - Percy specific CSS only applied in Percy's rendering environment + - `request_headers` - Headers that should be used during asset discovery + - `enable_javascript` - Enable JavaScript in Percy's rendering environment + +### 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-python-selenium +Provides: python3-percy-python-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 +- Additional snapshot options (overrides any project options) (`**kwargs**`): + - `widths` - An array of widths to take screenshots at + - `min_height` - The minimum viewport height to take screenshots at + - `percy_css` - Percy specific CSS only applied in Percy's rendering environment + - `request_headers` - Headers that should be used during asset discovery + - `enable_javascript` - Enable JavaScript in Percy's rendering environment + +### 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-python-selenium-1.0.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-python-selenium -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.0-1 +- Package Spec generated |
