gemini-testing / gemini

πŸ’€πŸ’€πŸ’€[DEPRECATED] Use hermione
https://github.com/gemini-testing/hermione
MIT License
1.5k stars 149 forks source link

Flick action doesn't work with selenium server #684

Open sp53519 opened 7 years ago

sp53519 commented 7 years ago

Output of gemini --version: 4.13.0

Contents of .gemini.yml file:

rootUrl: http://localhost/cartis/
sessionRequestTimeout: 60000
screenshotsDir: './screens'
browsers:
  chrome-ios: 
    rootUrl: http://localhost/mobile/ios
    screenshotsDir: './screens/ios'
    desiredCapabilities:
      browserName: 'chrome'
      chromeOptions:
        mobileEmulation: 
          userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4'
          deviceMetrics: 
            width: 375
            height: 667
            pixelRatio: 1
system:
    plugins:
      json-reporter:
        reportFile: ./gemini/report.json

Test source code:

gemini.suite('Testing', (suite) => {
    suite.setUrl('/')
        .capture('delete with swipe', (actions, find) => {    
            el = find('.swipeout:first-child');
            actions.flick({ x: 1000, y: 1000 }, 2, el);
        })
});

Command used to run the test:

gemini test --reporter html --reporter vflat

Result:

[flick({"ELEMENT":"11"},1000,1000,2)] Error response status: 13, UnknownError - An unknown server-side error occurred while processi
ng the command. Selenium error: java.util.HashMap cannot be cast to java.lang.String

Expected behaviour: Swipe occurs instead of the error.

eGavr commented 7 years ago

Yep! It is a bug :(

Unfortunately, I can not promise that it will be fixed really soon, so pull requests are welcome :)

sp53519 commented 7 years ago

Am I right this bug is in gemini-selenium layer? Or where is the problem in which component?

eGavr commented 7 years ago

It is a problem in gemini.

Flick works in wd (http client to selenium which gemini uses), it is a bug in gemini –> https://github.com/gemini-testing/gemini/blob/master/lib/tests-api/actions-builder.js#L294-L309

sp53519 commented 7 years ago

https://github.com/gemini-testing/gemini/blob/master/lib/tests-api/actions-builder.js#L301 I tried to change this code return browser.flick(elem, offsets.x, offsets.y, speed); to return browser.flick(elem.value, offsets.x, offsets.y, speed);

These changes work in chromedriver, but do not work in selenium. I do not understand what's the matter.

sipayRT commented 7 years ago

sorry, but what do you mean by "selenium"? what browser and environment?