Codeception / Codeception/module-webdriver

Can't change user agent for firefox/geckodriver

未关闭
#122 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
39
派生
25
PR 合并指标
30 天内没有已合并 PR

描述

I'm trying to set a specific User-Agent in geckodriver for the sake of my tests. But I can't find how to properly set that option in yml settings.

Is there any way to change for firefox the user agent?

* Codeception version: 5.1
* PHP Version: 8.2
* Operating System: Ubuntu
* Installation type: Composer
* Suite configuration:

```yml
wpfirefox:
modules:
enabled:
config:
WPWebDriver:
url: '%TEST_LOCAL_WP_URL%'
adminUsername: '%TEST_WP_ADMIN_USERNAME%'
adminPassword: '%TEST_WP_ADMIN_PASSWORD%'
adminPath: '%TEST_WP_ADMIN_PATH%'
browser: firefox
path: ''
window_size: 1024x768
capabilities:
moz:firefoxOptions:
args: ["-user-agent=wp-browser", "-headless"]
prefs:
intl.accept_languages: "fr-FR"
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 WPWebDriver 套件配置及其 capabilities 条目开始,重点检查 issue 中所示的 moz:firefoxOptions args 和 prefs。使用 Firefox 复现该配置,并确定是否应用了请求的 user agent;完成的标准是测试浏览器报告已配置的 User-Agent,同时保留现有的 language 和 headless 设置。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
testing
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。