Run tests in chrome mobile emulation: Reproduce invalid UI output, occurring when accessing from mobile.
UI output is valid. No emulation happened. Of course manually emulating the device, the output is invalid.
env:
top:
modules:
config:
WebDriver:
browser: 'chrome'
window_size: 360x640 # Logically this should not be needed
capabilities:
platform: ANDROID
browserName: chrome
mobileEmulation:
deviceName: 'Galaxy S5'
Codeception browser capabilities
Capabilities & ChromeOptions Search: mobileEmulation
It isn't an issue of Codeception.
@Naktibalda OK thanks.
Wasn't sure the below configuration was correct.
mobileEmulation:
deviceName: 'Galaxy S5'
I was right, my configuration was incorrect.
So if you need to start codeception tests in mobile emulation mode here's the environment section you need to use:
env:
top:
modules:
config:
WebDriver:
browser: 'chrome'
window_size: 360x640
capabilities:
platform: ANDROID
browserName: chrome
chromeOptions:
mobileEmulation:
deviceName: 'Samsung Galaxy S4'
Just putting the mobile resolution is not enough. We need to put the tests in mobile emulation.
E.g. when using chosen jquery plugin. Simply resizing to a mobile size, said library seemed to be working correctly. However, when testing from an actual mobile device it was not. The above configuration achieves this.
I had problems with this code, especially with "deviceName".
Actual list of "deviceName" you can find here.
Thanks for the update @vabue you probably saved me some time from my next upcoming acceptance tests run-through :) It seems the Samsung Galaxy S4 is not supported anymore from the Chrome driver. Logical as the above comment was six month ago.
@vabue would you mind listing the Chrome driver and Selenium version you're using?
@rdok sure.
Selenium Server 3.4.0
Google Chrome Driver 2.29
MS Windows 10, 64bit.
Also, I'm wondering is there a possibility to use mobile emulation in other browsers: Firefox, Safari, Edge.
Most helpful comment
I was right, my configuration was incorrect.
So if you need to start codeception tests in mobile emulation mode here's the environment section you need to use:
Just putting the mobile resolution is not enough. We need to put the tests in mobile emulation.
E.g. when using chosen jquery plugin. Simply resizing to a mobile size, said library seemed to be working correctly. However, when testing from an actual mobile device it was not. The above configuration achieves this.