Skip to content

Conversation

@danxuliu
Copy link
Member

This pull request adds a workaround for a bug in the Mink Extension for Behat used in the acceptance tests.

When the Selenium2 driver is configured in the Mink Extension an InvalidConfigurationException is thrown if the file for the custom Firefox profile does not exist. However, at that point the parameters have not been replaced yet by their value, so the path that is verified is the raw value specified in the behat.yml file. Thus, when a paramater is used in that path the path is always seen as invalid, even if it would be valid once the parameter was replaced by its value.

Due to that bug it is not possible to use the paths.base parameter in the path to the custom Firefox profile in behat.yml. paths.base is a special parameter in the Behat configuration that refers to the directory in which behat.yml is stored. This comes in very handy to set the path to custom Firefox profiles in the acceptance tests for apps, as even if the behat.yml file belongs to an app its paths are relative to the directory in which the tests are run, that is, the tests/acceptance directory of the server.

Until the bug is fixed, just before the acceptance tests are run the paths.base parameter in the path to the custom Firefox profile is replaced by its value in the behat.yml file used by the acceptance tests. Note that the file that is modified is the one inside the Docker container used to run the acceptance tests, so the original file is not touched.

danxuliu added 3 commits May 29, 2018 18:20
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Due to a bug in the Mink Extension for Behat it is not possible to use
the "paths.base" parameter in the path to the custom Firefox profile.
"paths.base" is a special parameter in the Behat configuration that
refers to the directory in which "behat.yml" is stored. This comes in
very handy to set the path to custom Firefox profiles in the acceptance
tests for apps, as even if the "behat.yml" file belongs to an app its
paths are relative to the directory in which the tests are run, that is,
the "tests/acceptance" directory of the server.

Until the bug is fixed, just before the acceptance tests are run the
"paths.base" parameter in the path to the custom Firefox profile is
replaced by its value in the "behat.yml" file used by the acceptance
tests. Note that the file that is modified is the one inside the Docker
container used to run the acceptance tests, so the original file is not
touched.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Although in the case of the acceptance tests for the server it is not
strictly needed it was modified for consistency with the configuration
used for the acceptance tests in apps.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added the 3. to review Waiting for reviews label May 29, 2018
@danxuliu danxuliu added this to the Nextcloud 14 milestone May 29, 2018
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever! 👍

@MorrisJobke MorrisJobke merged commit 8376ca3 into master May 29, 2018
@MorrisJobke MorrisJobke deleted the add-workaround-for-parameter-not-available-in-mink-extension branch May 29, 2018 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants