joomla-projects / gsoc16_browser-automated-tests

Joomla GSoC16: Project VIII: Browser Automated Tests for Joomla! CMS(covering Users and Content features)
https://summerofcode.withgoogle.com/projects/#5724182314745856
GNU General Public License v2.0
9 stars 28 forks source link

Failure in test suite category #128

Open astridx opened 7 years ago

astridx commented 7 years ago

Steps to reproduce the issue

Run all tests

Expected result

All tests are successful.

Actual result

The test stopped on this line: https://github.com/joomla-projects/gsoc16_browser-automated-tests/blob/staging/tests/codeception/acceptance/category.feature#L77

Additional comments

The reason why this tests stops is the following: The mark up of the drop down changed.

At the moment the method

https://github.com/joomla-projects/gsoc16_browser-automated-tests/blob/staging/tests/codeception/_support/Step/Acceptance/Administrator/Category.php#L513

is starting the method

https://github.com/joomla-projects/gsoc16_browser-automated-tests/blob/staging/tests/codeception/_support/Page/Acceptance/Administrator/AdminPage.php#L261

and expects this markup:

public function selectOptionInChosenById($selectId, $option) {
        $chosenSelectID = $selectId . '_chzn';
        $I = $this;
        $I->comment("I open the $chosenSelectID chosen selector");
        $I->click(['xpath' => "//div[@id='$chosenSelectID']/a/div/b"]);
        $I->comment("I select $option");
        $I->click(['xpath' => "//div[@id='$chosenSelectID']//li[text()='$option']"]);
        // Gives time to chosen to close
        $I->wait(1);
}

If you have a look at the current mark up in joomla-cms you see this markup:

    public function selectOptionInChosenById($selectId, $option)
    {
        $chosenSelectID = $selectId . "_chzn";

        $I = $this;
        $I->comment("I open the $chosenSelectID chosen selector");
        $I->click(['xpath' => "//div[@id='$chosenSelectID']/a/span"]);
        $I->comment("I select $option");
        $I->click(['xpath' => "//div[@id='$chosenSelectID']//span[text()='$option']"]);

        // Gives time to chosen to close
        $I->wait(1);
    }

So the selectors /div/b and li has to changed in span.

As we are now start to create a editor for gherkin we have to find a solution for this problem.