joomla-projects/joomla-browser

joomla-browser Codeception 模块

v4.0.0 2022-04-15 21:05 UTC

README

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

目录

The Joomla Browser

Joomla Browser是一个Codeception.com模块。它允许通过提供一组预定义的任务来快速构建Joomla站点的系统测试。

在可用的功能之间,你可以找到

  • 安装
    • 安装Joomla
    • 安装Joomla并删除安装文件夹
    • 安装多语言Joomla站点
  • 管理员
    • 执行管理员登录
    • 执行管理员注销
    • 设置错误报告为开发模式
    • 搜索条目
    • 检查条目是否存在
    • 发布模块
    • 设置模块位置并发布
    • 扩展管理器
      • 从文件夹安装扩展
      • 从URL安装扩展
      • 启用插件
      • 卸载扩展
      • 搜索结果插件名称
  • 前端
    • 执行前端登录
  • 管理员用户界面
    • 在选择的选项中选择
    • 在单选字段中选择选项
    • 在Chosen中选择多个选项
  • 其他
    • 检查PHP通知或警告

Joomla Browser正在不断发展,每个月都在添加更多方法。要查找它们的完整列表,请检查公共方法:https://github.com/joomla-projects/joomla-browser/blob/develop/src/JoomlaBrowser.php

Joomla Browser在行动

如果你想看到JoomlaBrowser的工作示例,请查看以下链接的测试:https://github.com/joomla-extensions/weblinks#tests

使用说明

更新你的项目中的Composer.json文件,并下载

下载

composer require joomla-projects/joomla-browser:dev-develop

在Codeception中加载模块

最后,在Acceptance.suite.yml中做出以下更改,以将JoomlaBrowser作为模块添加。

你的原始acceptance.suite.yml可能看起来像

modules:
    enabled:
        - WebDriver
        - AcceptanceHelper
    config:
        WebDriver:
            url: 'http://localhost/joomla-cms3/'     # the url that points to the joomla cms
            browser: 'firefox'
            window_size: 1024x768
            capabilities:
              unexpectedAlertBehaviour: 'accept'
        AcceptanceHelper:
            ...

你应该删除WebDriver模块,并用JoomlaBrowser模块替换它

    config:
        JoomlaBrowser:
            url: 'http://localhost/joomla-cms/'     # the url that points to the joomla installation at /tests/system/joomla-cms
            browser: 'firefox'
            window_size: 1024x768
            capabilities:
              unexpectedAlertBehaviour: 'accept'
            username: 'admin'
            password: 'admin'
            database host: 'localhost'             # place where the Application is Hosted #server Address
            database user: 'root'                  # MySQL Server user ID, usually root
            database password: '1234'                  # MySQL Server password, usually empty or root
            database name: 'dbname'            # DB Name, at the Server
            database type: 'mysqli'                # type in lowercase one of the options: MySQL\MySQLi\PDO
            database prefix: 'jos_'                # DB Prefix for tables
            install sample data: 'Yes'              # Do you want to Download the Sample Data Along with Joomla Installation, then keep it Yes
            sample data: 'Default English (GB) Sample Data'    # Default Sample Data
            admin email: 'admin@mydomain.com'      # email Id of the Admin
            language: 'English (United Kingdom)'   # Language in which you want the Application to be Installed
            joomla folder: '/home/.../path to Joomla Folder' # Path to Joomla installation where we execute the tests
        AcceptanceHelper:
            ...

代码样式检查器

要自动检查代码样式,请在存储库根目录的终端窗口中执行以下命令

  • $ composer install
  • $ vendor/bin/phpcs --extensions=php -p --standard=vendor/joomla/coding-standards/Joomla src