macaca-chrome如何传入mobileEmulation模拟手机浏览器测试?
- Dominant language
- No language data
- Stars
- 3.2k
- Forks
- 418
- PR merge metrics
- No merged PRs in 30d
Description
查阅过macaca的api,目前没有找到macaca使用chrome驱动如何传入mobileEmulation使chrome表现为手机浏览器h5模式,在selenium中设置如下:
#指定手机设备
* mobileEmulation = {"deviceMetrics": {"width": WIDTH, "height": HEIGHT, "pixelRatio": PIXEL_RATIO}, "userAgent": UA}
* options = webdriver.ChromeOptions()
* options.add_experimental_option('mobileEmulation',mobileEmulation) #重写浏览器驱动,两个入参
* driver = webdriver.Chrome(executable_path='chromedriver.exe',chrome_options=options)
望告之
* **Macaca Version**: 2.0.12
* **Macaca Doctor Logs**:
macaca-doctor version: 2.0.3
* Node.js checklist:
node env: E:\nodejs\node.exe
node version: v8.4.0
Android checklist:
* JAVA version is `1.8.0_131`
JAVA_HOME is set to `E:\Java\jdk1.8.0_131`
ANDROID_HOME is set to `E:\adt-sdk\sdk`
Platforms is set to `E:\adt-sdk\sdk\platforms\android-27`
ADB tool is set to `E:\adt-sdk\sdk\platform-tools\adb.exe`
GRADLE_HOME is set to `E:\gradle-4.3`
* Installed driver list:
android: 2.0.40
chrome: 1.0.7
puppeteer: 1.0.2
* **Operate System**:Win7x64
* **Programming Language**:nodejs,python
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing Macaca's Chrome driver API with the Selenium mobileEmulation example included in the issue. Determine whether the driver options can carry this setting; done means providing a documented, working way to launch a mobile-emulated Chrome session.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, python
- Domain
- testing-qa, web-dev
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100