定制 drevops/behat-relativity 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drevops/behat-relativity

最新稳定版本:0.4.0

Composer 安装命令:

composer require drevops/behat-relativity

包简介

Behat context for relative elements testing.

README 文档

README

Behat context for relative elements testing

CircleCI Latest Stable Version Total Downloads License

What is this?

This extension allows to test visual elements positioning on the page relatively to each other. Such tests are dead-simple to write, but they can capture potential issues when developing features on existing project.

Example feature to test elements on the www.google.com

Feature: Google example test

  Show how Behat Relativity can be used to test pages using google.com as an example.

  Background:
    Given I define components:
      | top navigation    | #gb                     |
      | logo              | #hplogo                 |
      | search            | #lst-ib                 |
      | search button     | .jsb input[name="btnK"] |
      | lucky button      | .jsb input[name="btnI"] |
      | bottom navigation | .fbar                   |


  @javascript
  Scenario: Anonymous user visits google.com
    Given I am on "https://www.google.com"
    Then I see top navigation above logo, search, search button, lucky button and bottom navigation
    And I see logo above search, search button, lucky button and bottom navigation
    And I see search above search button, lucky button and bottom navigation
    And I see search button and lucky button above bottom navigation
    And I see search button to the left of lucky button

Installation

composer require --dev drevops/behat-relativity

usage

Example behat.yml:

default:
  suites:
    default:
      contexts:
        - DrevOps\BehatRelativityExtension\Context\RelativityContext
        - FeatureContext

  extensions:
    DrevOps\BehatRelativityExtension:
      breakpoints:
        mobile:
          width: 320
          height: 480
        tablet:
          width: 768
          height: 1024
        desktop:
          width: 992
          height: 1024
          default: true
        desktop_large:
          width: 1200
          height: 900
      # Vertical offset - document will be scrolled to the element with this offset.
      # Useful when fixed elements may cover part of pages making it impossible to click on components.
      offset: 60
      # List of site-wide components.
      components:
        'page': "#page"
        'main': "#main"
        'top': "#top"
        'bottom': "#bottom"

Maintenance

Local development setup

  1. Install Docker.
  2. If using M1: cp default.docker-compose.override.yml docker-compose.override.yml
  3. Start environment: docker-compose up -d --build.
  4. Install dependencies: docker-compose exec phpserver composer install --ansi --no-suggest.

Lint code

docker-compose exec phpserver vendor/bin/phpcs

Run tests

docker-compose exec phpserver vendor/bin/behat

Enable Xdebug

XDEBUG_ENABLE=true docker-compose up -d phpserver

To disable, run

docker-compose up -d phpserver

统计信息

  • 总下载量: 1.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2023-03-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固