当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

laravel-dusk-select2

Select2.js support for the Laravel Dusk testing
授权协议 MIT License
开发语言 PHP
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 谭文林
操作系统 跨平台
开源组织
适用人群 未知
 软件概览



Introduction

Select2.js support for the Laravel Dusk testing. Support Select2 v3 and Select2 v4 versions.

Demo

Install

composer require --dev roquie/laravel-dusk-select2

Now, u may use it!

Usage

For default select2:

$browse->select2('@selector');

@selector class name of your <select> html tag.

If value not passed, it be selected automatically.

Another way, if need concrete value:

$browse->select2('@selector', 'you_text_value');

For multiple mode usage like this:

$browse->select2('@selector', ['foo', 'bar'], 5);
// the last parameter - maximum count of seconds for ajax loading before choice item.

Examples

Here.

Todo

  • Add Laravel Dusk tests for Laravel Dusk extend feature ;)
  • Add gif demonstration how it works.
  • May be use + select2 out of the box?.
  • Integration with Circle CI.

Changelog

Upgrade from 2.0 to 2.1

Without breaking changes.

Migration

  1. Update your roquie/laravel-dusk-select2 dependency to ^2.1 in your composer.json file.

Changes

  1. This project moved back to native dependency laravel/dusk package and does not depend on full Laravel Framework like before in 1.*.
  2. Tests updated
  3. Migrated to new phpunit schema.
  4. Updated dependencies to latest versions.
  5. Removed composer.lock
  6. Fixed CI build
  7. Tests moved to namespace.
  8. Replaced Docker Image who runs these code.

Upgrade from 1.* to 2.0

2.0 version of this package potentially has full compatibility with select2 v.3 and v.4.But, I deleted a lot of code regarding select2 v.3. Tests passed for both versions, but withsome changes.

Migration

  1. Update your roquie/laravel-dusk-select2 dependency to ^2.0 in your composer.json file.
  2. That's all ...

Changes

  1. Project migrated to konsulting/dusk-standalone package to run tests. It more better solution, compares to download full laravel framework.
  2. Tests updated
  3. Minimal PHP version is 7.1 (!)
  4. Updated dependencies to latest versions.
  5. Fixed a bug when search input founded but is not displayed.

Upgrade from 0.1.* to 1.0.*

  1. Update your roquie/laravel-dusk-select2 dependency to ^1.0 in your composer.json file.
  2. Remove + .select2 from first parameter, also see last parameter.

Tests

Believe me, it's better to run it all in Docker:

  • make composer test

License

MIT License

Copyright (c) 2017-2021 roquie0@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

  • 这并非laravel官方强制要求的规范,而是我们在日常开发过程中遇到的一些容易忽视的优秀实现方式。 内容 单一职责原则 一个类和一个方法应该只有一个责任。 例如: public function getFullNameAttribute() { if (auth()->user() && auth()->user()->hasRole('client') && auth()->user()

  • 我们这里要讨论的并不是 Laravel 版的 SOLID 原则(想要了解更多 SOLID 原则细节查看这篇文章)亦或是设计模式,而是 Laravel 实际开发中容易被忽略的最佳实践。 内容概览 单一职责原则 胖模型,瘦控制器 验证 业务逻辑应该放到服务类 DRY(Don't Repeat Yourself,不要重复造轮子) 优先使用 Eloquent 而不是查询构建器和原生 SQL 查询,优先使用

  • 单一职责原则 一个类和方法只负责一项职责。 坏代码: public function getFullNameAttribute() { if (auth()->user() && auth()->user()->hasRole('client') && auth()->user()->isVerified()) { return 'Mr. ' . $this->first_

 相关资料
  • 我正在将我的Laravel5.3网站升级到5.5,无法让Dusk在我的本地主机上正常工作。我有其他单元测试可以在本地主机上正常工作,但是由于某些原因,Dusk对任何本地页面返回。本地页面似乎工作很好,在我的桌面上浏览它。 我的DuskTestCase null

  • 介绍 Laravel Dusk 提供了富有表现力、简单易用的浏览器自动化及测试 API 。默认情况下,Dusk 不需要在你的机器上安装 JDK 或者 Selenium 。而是需要使用单独的 Chrome 驱动 进行安装。当然,你也可以自由使用其他的兼容 Selenium 的驱动程序。 安装 你应该先向你的 Composer 依赖添加 laravel/dusk : composer require

  • Introduction Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your machine. Instead, Dusk uses a

  • Laravel 是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。 功能特点 1、语法更富有表现力 你知道下面这行代码里 “true” 代表什么意思么? $uri = Uri::create(‘some/uri’, array(), array(), tr

  • 我需要空间/Laravel权限的帮助。当我试图分配它给我错误哎呀,看起来像出了问题。 错误 Connection.php第761行中的QueryExcema:SQLSTATE[23000]:完整性约束冲突:1048列role_id不能为空(SQL:插入到(,)值(9,))

  • Laravel 作为现在最流行的 PHP 框架,其中的知识较多,所以单独拿出来写一篇。 简述 Laravel 的生命周期 Laravel 采用了单一入口模式,应用的所有请求入口都是 public/index.php 文件。 注册类文件自动加载器 : Laravel通过 composer 进行依赖管理,无需开发者手动导入各种类文件,而由自动加载器自行导入。 创建服务容器:从 bootstrap/ap