Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WebdriverClassicDriver factory #26

Conversation

uuf6429
Copy link

@uuf6429 uuf6429 commented Mar 4, 2024

@uuf6429 uuf6429 marked this pull request as draft March 5, 2024 19:04
@uuf6429 uuf6429 marked this pull request as ready for review April 5, 2024 18:38
@uuf6429 uuf6429 requested a review from aik099 April 5, 2024 18:39
uuf6429

This comment was marked as outdated.

composer.json Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
@uuf6429 uuf6429 force-pushed the feature/implement-webdriver-classic-extension branch from 5023d3b to 18a3f77 Compare April 6, 2024 12:14
Copy link

@aik099 aik099 left a comment

Choose a reason for hiding this comment

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

Approving, because all points from my previous review were addressed.

@benr77
Copy link

benr77 commented Apr 12, 2024

If I use webdriver-classic: in behat.yml then I get the following error:

Unrecognized option "webdriver_classic" under "testwork.mink.sessions.default". Did you mean "webdriver-classic"?

But this is reporting that I do what I have done. It looks like somewhere the hyphen is being replaced by an underscore.

Solution is to change the hyphen to an underscore here

@aik099
Copy link

aik099 commented Apr 12, 2024

@benr77 , I'm new to Behat. Please describe the steps needed to create a test project with Behat + MinkExtension + this PR code so that it's easier to diagnose the problem. Yaml itself doesn't prohibit hyphen usage inside the key names.

@uuf6429
Copy link
Author

uuf6429 commented Apr 12, 2024

@benr77 @aik099 The other drivers are using underscores instead of dashes. It probably makes sense to do it that way, if anything just to keep it consistent.

As to the buggy behaviour, I don't feel like investigating another thing that will take ages to be accepted. 🤷

@benr77
Copy link

benr77 commented Apr 13, 2024

This underscore fix is now working as expected. Thank you. Hopefully this PR can get merged soon.

@aik099
Copy link

aik099 commented Apr 13, 2024

FYI: The webdriver-classic in YAML becoming webdriver_classic in PHP is part of the normalization process done by the used Symfony/Config Component: https://symfony.com/doc/current/components/config/definition.html#normalization

The separator used in keys is typically _ in YAML and - in XML. For example, auto_connect in YAML and auto-connect in XML. The normalization would make both of these auto_connect.

@claudiu-cristea
Copy link

Landed here trying to use minkphp/webdriver-classic-driver with my Behat setup. @benr77, could you share a behat.yml that uses this PR+minkphp/webdriver-classic-driver?

@benr77
Copy link

benr77 commented Jun 26, 2024

@claudiu-cristea All I have is this behat.yaml, alongside using this branch instead of main - the important bit is using webdriver_classic.

default:
  suites:
    default:
      contexts:
        - FeatureContext
  extensions:
    Behat\MinkExtension:
      base_url: http://php
      browser_name: chrome
      sessions:
        default:
          webdriver_classic:
            browser: chrome
            wd_host: http://chrome:4444/wd/hub
            capabilities:
              browserName: chrome
              platform: any
              chrome:
                switches:
                  - '--headless'
                  - '--window-size=1200,1100'
                  - '--disable-gpu'
                  - '--no-sandbox'

composer.json Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect this driver to the "Behat\MinkExtension" project
6 participants