guikingone/panther-extension 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

guikingone/panther-extension

Composer 安装命令:

composer require guikingone/panther-extension

包简介

Panther extension for Mink

README 文档

README

Mink extension for controlling Chrome | Firefox | Selenium thanks to Symfony Panther.

Foreword:

This extension is experimental (even if stable at 95%), some features may be missing.

Installation:

First, you need to install Symfony Panther and it's required dependencies, then:

composer require guikingone/panther-extension

Usage:

default:
  suites:
    default:
      contexts:
        - PantherExtension\Context\PantherContext:
        - PantherExtension\Context\WaitContext:
        # Your contexts

  extensions:
    PantherExtension\Extension\PantherExtension: ~
    Behat\MinkExtension:
      browser_name: chrome
      base_url: http://localhost
      sessions:
        default:
          panther:
            driver: 'chrome' # Or 'firefox', 'selenium', 'chrome' is the default value

WaitContext has been introduced in 0.4

If you need to use Selenium, just adapt the session configuration:

# ...

  extensions:
    PantherExtension\Extension\PantherExtension: ~
    Behat\MinkExtension:
      browser_name: chrome
      base_url: http://localhost
      sessions:
        default:
          panther:
            driver: 'selenium'
            selenium:
              hub_url: 'http://127.0.0.1:4444/wd/hub'

Here's a simple example using a POC project which call API-Platform website

Feature:
  As a newbie in API-Platform, I want to document myself in many features

  Scenario: I should be able to see the main documentation                           
    Given I am on "/"                                                                
    And I should see "REST and GraphQL framework to build modern API-driven projects"

  Scenario: I should be able to see the main documentation                                           
    Given I am on "/"                                                                                
    And I go to "/docs/distribution/"                                                                
    Then I should see "API Platform is the most advanced API platform, in any framework or language."

  Scenario: I should be able to document myself about GraphQL support
    Given I am on "/"                                                
    And I follow "Get started"                                       
    When I follow "Adding GraphQL Support"                           
    Then I should be on "/docs/distribution/#adding-graphql-support" 
    Then I should see "You now have a GraphQL API!"                  

  Scenario: I should be able to document myself about GraphQL support thanks to the search field
    Given I am on "/"                                                                           
    When I fill in "SEARCH..." with "GraphQL"                                                   
    And I wait for "#algolia-autocomplete-listbox-0"                                            
    Then I should see "Documentation"                                                           
    And I should see "Search by"                                                                
    And I should see "Enabling GraphQL"                                                         

  Scenario: I should be able to test the demo                  
    Given I am on "/"                                          
    And I follow "Demo"                                        
    Then I should be on "https://demo-client.api-platform.com/"
    When I follow "API"                                        
    Then I should be on "https://demo.api-platform.com/"       

  Scenario: I should be able to test the demo                                         
    Given I am on "/"                                                                 
    And I follow "Community"                                                          
    And I create a new client "test" using the "chrome" driver                        
    Then I switch to client "test"                                                    
    And I go to "/"                                                                   
    Then I should see "REST and GraphQL framework to build modern API-driven projects"
    Then I remove the client "test"                                                   
    Then I should see "API Platform's community"                                      

6 scenarios (6 passed)
29 steps (29 passed)
0m28.61s (20.63Mb)

Documentation

The full documentation can be found here

CI usage

Please refer to Symfony Panther documentation about using it in CI environments.

Development

The project can be launched using:

make boot

Every test can be launched using:

make tests

For more commands or help, please use:

make

Contributing

Just fork this repo and submit a new PR!

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固