[imp] Add scrollTo function to Webdriver Module #2844

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
@javigomez
Contributor

javigomez commented Feb 25, 2016

This pull closes #2840

This pull is work in progress. The code partially works but I need advise from you @DavertMik and @Naktibalda on the following topics:

1.- Passing offsets to Facebook Webdriver doesn't do any action. Please see the following 5 seconds video:
https://www.youtube.com/watch?v=OlCn3W4cj_E

In the video you will notice that scrolling to an element works 馃憤 , however scrolling to that element passing offsets doesn't seems to work 馃憥 . It doesn't looks like Codeception issue but a Facebook webdriver issue, but I would need your help to confirm.

I'm running this test, you can use it as example:

<?php

class scrollToCest
{
    public function scrollToConfigurationInWebdriverPage(AcceptanceTester $I, $scenario)
    {
        $I->amOnUrl('http://codeception.com/docs/modules/WebDriver');
        $I->scrollTo(['id' => 'configuration']);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 0, 100);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 10, 200);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 20, 300);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 30, 400);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 40, 500);
        $I->wait(1);
        $I->scrollTo(['id' => 'configuration'], 50, 600);
    }
}

2.- I was planning to add the test of issue 1. in the Codeception tests folder: https://github.com/Codeception/Codeception/blob/2.1/tests/web/WebDriverTest.php#L616. But I would need your advise, because I'm not sure how to generate the dummy page to be tested.

javigomez added some commits Feb 25, 2016

[imp] ignore robo.phar
Robo is required to build documentation, but we don't want it to be tracked in the repo therefore I'm ignoring it.
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Feb 26, 2016

Member

Thanks!
To create a test page you can create a page at tests/app/view/form/example*.php where you can put a test code and probably JS script which to some action on mouse over.

This page will be accessible at /form/example* url.

Use robo test:launch-server to start a test app locally

Member

DavertMik commented Feb 26, 2016

Thanks!
To create a test page you can create a page at tests/app/view/form/example*.php where you can put a test code and probably JS script which to some action on mouse over.

This page will be accessible at /form/example* url.

Use robo test:launch-server to start a test app locally

@javigomez

This comment has been minimized.

Show comment
Hide comment
@javigomez

javigomez Mar 8, 2016

Contributor

I have added a test, but something is wrong, and I'm not sure what.

Please have a look at this small video and give me your advise: https://www.youtube.com/watch?v=3qZcx4qsPA0

Thanks very much.

Contributor

javigomez commented Mar 8, 2016

I have added a test, but something is wrong, and I'm not sure what.

Please have a look at this small video and give me your advise: https://www.youtube.com/watch?v=3qZcx4qsPA0

Thanks very much.

@DavertMik DavertMik referenced this pull request Mar 8, 2016

Merged

MoveCursorTo #2882

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Mar 8, 2016

Member

@javigomez I took a brief investigation and looks like scrollTo makes only sense for mobile browsers, so its implementation at CodeceptJS and WebdriverIO is just about that. For desktop-based browsers seelenium scrolls page automatically, so in our case it's preferable to call method moveCursorTo (yes, same method exists in CodeceptJS http://codecept.io/helpers/WebDriverIO/#movecursorto

Also I pulled from your branch and resent your PR #2882

Member

DavertMik commented Mar 8, 2016

@javigomez I took a brief investigation and looks like scrollTo makes only sense for mobile browsers, so its implementation at CodeceptJS and WebdriverIO is just about that. For desktop-based browsers seelenium scrolls page automatically, so in our case it's preferable to call method moveCursorTo (yes, same method exists in CodeceptJS http://codecept.io/helpers/WebDriverIO/#movecursorto

Also I pulled from your branch and resent your PR #2882

@DavertMik DavertMik closed this Mar 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment