Mink documentation

Related tags

API docs mink
Overview
Comments
  • Rewrite the session chapter

    Rewrite the session chapter

    This is my work to fix https://github.com/minkphp/docs/issues/33

    I'm not yet done on it (everything after the .. todo:: directive is still the old content). I will update the PR later with the end of the chapter.

    opened by stof 11
  • Change the DNS for the mink.behat.org domain

    Change the DNS for the mink.behat.org domain

    It currently redirects to the Behat/Mink repo on Github. This will become wrong anyway when moving the code to the minkphp organization. We should update the domain to point to RTD

    opened by stof 6
  • WebDriver\Exception\UnknownException

    WebDriver\Exception\UnknownException

    I am having problem running mink + behat combo. The scenario looks as follows:

    @javascript @insulated
    Feature: Login
      Scenario: Login valid
        Given I am on "/auth/login"
        When I fill in the following:
          | email | xxx |
          | pass_hash | xxx |
        And I press "Sign in"
        Then I should be on "/dashboard"
    
      Scenario: Login invalid
        Given I am on "/auth/login"
        When I fill in the following:
          | email | yyy |
          | pass_hash | yyy |
        And I press "Sign in"
        Then I should see "Wrong e-mail or password."
    

    And I get the following result https://gist.github.com/rgembalik/fe7e8dbbe53d2ee8669b

    behat.yml looks like this:

    default:
        extensions:
            mink_extension.phar:
                mink_loader: mink.phar
                base_url: http://localhost/testpage
                goutte: ~
                selenium2:
                    wd_host: http://127.0.0.1:4444/wd/hub
                    capabilities:
                      version: ''
    

    Selenium session is created and firefox is launching, but no url is inserted. Sessions stays registered in selenium (it is visible under http://127.0.0.1:4444/wd/hub).

    Any idea and/or suggestions?

    EDIT: BTW, when I try it without @javascript @insulated it works just fine and the test passes. I have problems only with selenium.

    opened by rgembalik 6
  • HTTPS for the doc

    HTTPS for the doc

    ReadtheDocs now supports HTTPS for custom domains, but this requires migrating the CNAME to the new target (old CNAMEs don't support it).

    @everzet as you are the one controlling the DNS of the domain (at least as far as I know), could you update it to point at readthedocs.io ? https://docs.readthedocs.io/en/stable/custom_domains.html#custom-domain-ssl

    opened by stof 4
  • Rewrite the page traversing chapter

    Rewrite the page traversing chapter

    The focus should not be on the SelectorsHandler class (most users will not need to deal with it directly. It is an internal API). We should start from the user-facing API instead (i.e. Element::find and Element::findAll)

    Help wanted 
    opened by stof 3
  • Add options to Selenium2Driver setValue method

    Add options to Selenium2Driver setValue method

    Currently, the Selenium Driver setValue method includes the following at the bottom:

    $value = strval($value);
    
    if (in_array($elementName, array('input', 'textarea'))) {
      $existingValueLength = strlen($element->attribute('value'));
      // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
      // after leaving the field.
      $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
    }
    
    $element->postValue(array('value' => array($value)));
    

    There is no option given to exclude the tab key from the posted value, as it is presumed to be necessary to trigger the change event. In my work with Drupal 7's autocomplete field, however, the field reacts to the onChange event, and the tab will submit the value. In fields where the user must choose one of the predefined values, this causes an exception.

    I'd like to be able to optionally not add the tab key to the input. Something akin to:

    **
     * {@inheritdoc}
     */
    public function setValue($xpath, $value, $options=array()) {
      $options = $options + array(
        'addTab'=>TRUE
      );
      $element = $this->findElement($xpath);
      $elementName = strtolower($element->name());
    
      if ('select' === $elementName) {
        if (is_array($value)) {
          $this->deselectAllOptions($element);
    
          foreach ($value as $option) {
            $this->selectOptionOnElement($element, $option, TRUE);
          }
    
          return;
        }
    
        $this->selectOptionOnElement($element, $value);
    
        return;
      }
    
      if ('input' === $elementName) {
        $elementType = strtolower($element->attribute('type'));
    
        if (in_array($elementType, array('submit', 'image', 'button', 'reset'))) {
          throw new DriverException(sprintf('Impossible to set value an element with XPath "%s" as it is not a select, textarea or textbox', $xpath));
        }
    
        if ('checkbox' === $elementType) {
          if ($element->selected() xor (bool) $value) {
            $this->clickOnElement($element);
          }
    
          return;
        }
    
        if ('radio' === $elementType) {
          $this->selectRadioValue($element, $value);
    
          return;
        }
    
        if ('file' === $elementType) {
          $element->postValue(array('value' => array(strval($value))));
    
          return;
        }
      }
    
      $value = strval($value);
    
      if (in_array($elementName, array('input', 'textarea'))) {
        $existingValueLength = strlen($element->attribute('value'));
        // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
        // after leaving the field.
        $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . (($options['addTab']) ? Key::TAB : '');
      }
    
      $element->postValue(array('value' => array($value)));
    }
    

    A diff of the file from the original with these changes would be:

    290d289
    < 
    636d634
    <   public function setValue($xpath, $value) {
    637a636,639
    >   public function setValue($xpath, $value, $options=array()) {
    >     $options = $options + array(
    >       'addTab'=>TRUE
    >     );
    691c693
    <       $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
    
    ---
    >       $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . (($options['addTab']) ? Key::TAB : '');
    
    opened by aronbeal 2
  • Session interaction timing out for a particular site

    Session interaction timing out for a particular site

    I'm experiencing an issue using Mink to control Firefox through Sahi where when I try to interact with the session in any way (e.g. running getPage()->getContent() or simply wait(2000)) I don't get the expected response and Mink eventually times out.

    I've used the exact same code for various other websites and it works perfectly. This one single website seems to be stopping either Mink or Sahi from providing a response. I can't seem to find any reliable way of debugging the issue, all I can do is wait for the timeout to occur.

    The code I'm using to retrieve the markup from a page is as follows:

    // Configure driver
    $this->driver = new \Behat\Mink\Driver\SahiDriver('firefox',
        new \Behat\SahiClient\Client(
            new \Behat\SahiClient\Connection(null, CRAWL_SERVER, 9999)
        )
    );
    
    // Init session:
    $this->session = new \Behat\Mink\Session($this->driver);
    
    // Start session:
    $this->session->start();
    
    // Open the url
    $this->session->visit($config['url']);
    
    // Get the markup from the page
    $markup = $this->session->getPage()->getContent();
    

    The page I'm trying to scrape is: https://www.o2.co.uk/shop/phones/

    I also have a post up on on Stack Overflow here.

    I'm using Mink 1.6 - installed using composer on 27/11/2014

    tl;dr Why is Mink/Sahi timing out on this site?

    opened by jcjmcclean 2
  • Reorganize the documentation into multiple chapters

    Reorganize the documentation into multiple chapters

    The content is still the same. This change is focusing on moving it around to split the doc into multiple pages. The order of the toctree is also meant to put the emphasis on the Session and Element rather than on the driver like previously, because the driver is the internal API of Mink and beginners should never need to deal with it except for the instantiation.

    Next steps are now to rewrite each chapter to bring it uptodate and make it better (for instance making the Session chapter describe it as a main API rather than as a convenience layer on top of the driver, which is not described previously anymore). This will be done in separate PRs after this one is merged as it is easier when having multiple page.

    opened by stof 2
  • Update at-a-glance.rst

    Update at-a-glance.rst

    Grammatical error. In English, when you have a large amount of something, the 'something' has to be an 'uncountable' thing, such as sand or water, or sunshine. If you have a large number of things that are countable, such as 'browsers' or bricks, or cars then it should be "A large number of "

    opened by duncanssmith 1
  • Rewrite the Session documentation

    Rewrite the Session documentation

    The page about the Session needs to be rewritten. It should describe it as the main API of Mink rather than as a convenience layer on top of the driver

    Help wanted 
    opened by stof 1
  • Maybe mention chromedriver and xvfb-run?

    Maybe mention chromedriver and xvfb-run?

    I found xvfb-run chromedriver --port=4444 to work ... where google-chrome-stable --headless did not. I am not expert on this, I am just reporting and asking: would this be useful in the documentation?

    opened by chx 0
  • setValue can't work in vuejs apps

    setValue can't work in vuejs apps

    Hi. I'm integrating with an VueJS app and when I call $inputNode->setValue('test') I see the "test" string in the input, but when I click to submit form, for example, it's like the input was never inputed. In other words, vuejs can't get the input was changed.

    Someone can show me a light? Thanks.

    opened by rafwell 1
  • 'see function()' text should be a link

    'see function()' text should be a link

    On http://mink.behat.org/en/latest/guides/interacting-with-pages.html there are several occurrences of text like this:

    Looks for a button (see findButton) and presses on it.
    

    The 'see function' should ideally be a link.

    opened by joachim-n 0
  • Mention Chromedriver is async

    Mention Chromedriver is async

    I have written my first test this last week using Mink and Chromedriver and it really is not clear Chromedriver is async (it wasn't always so although it's been more 4.5 years since they switched). If this pull request is accepted, I will add notes to some method doxygen as well and perhaps provide sample code. Drupal 8.5.0 has

    public function waitForElement($selector, $locator, $timeout = 10000) {
      $page = $this->session->getPage();
    
      $result = $page->waitFor($timeout / 1000, function () use ($page, $selector, $locator) {
        return $page->find($selector, $locator);
      });
    
      return $result;
    }
    

    which is really helpful, what would be a good place to put this in the Mink documentation -- or perhaps the codebase?

    opened by chx 0
  • Doc about session lazy-start is outdated

    Doc about session lazy-start is outdated

    The managing-sessions page says that the Mink class starts the session automatically when getting it. This is not true anymore since the change to auto-start the session when visiting a page.

    Help wanted 
    opened by stof 0
Owner
Mink
The Mink project
Mink
Ariama Victor (A.K.A. OVAC4U) 106 Dec 25, 2022
The Laravel documentation.

Laravel Documentation You can find the online version of the Laravel documentation at https://laravel.com/docs Contribution Guidelines If you are subm

The Laravel Framework 2.6k Dec 31, 2022
The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io - Deprecation Notice This repository is deprecated! Daux.io has been moved to an organization, to guarantee future development and support. So

Justin Walsh 4.6k Dec 16, 2022
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It help

Daux.io 719 Jan 1, 2023
documentation for the oauth2-server-php library

OAuth2 Server PHP Documentation This repository hosts the documentation for the oauth2-server-php library. All submissions are welcome! To submit a ch

Brent Shaffer 227 Nov 24, 2022
The Symfony documentation

The official Symfony Documentation Online version | Screencasts Contributing We love contributors! For more information on how you can contribute to t

Symfony 2k Dec 30, 2022
Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Dec 28, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Dec 22, 2022
An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Dec 17, 2022
Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

Arne Blankerts 588 Dec 22, 2022
A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Code LTS 203 Dec 21, 2022
๐Ÿ“– The Nette documentation

How to contribute Nette welcomes contributions. You are free to make changes or translate existing pages. Before contributing, please read information

Nette Foundation 108 Dec 14, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023
A platform to create documentation/wiki content built with PHP & Laravel

BookStack A platform for storing and organising information and documentation. Details for BookStack can be found on the official website at https://w

BookStackApp 10.6k Jan 3, 2023
Laravel API Documentation Generator

Laravel API Documentation Generator Automatically generate your API documentation from your existing Laravel/Lumen/Dingo routes. php artisan apidoc:ge

Marcel Pociot 3.3k Dec 21, 2022
๐Ÿช Write gorgeous documentation for your products using Markdown inside your Laravel app.

LaRecipe Write gorgeous documentations for your products using Markdown inside your Laravel app. LaRecipe ?? LaRecipe is simply a code-driven package

Saleem Hadad 2.1k Dec 29, 2022
Simple IT Documentation Solution for MSPs

SimpleMSPDoc RC 1.0 I wasn't happy with what other IT documention software had. I felt they over complicated things and required so much clicky clicky

null 4 Jun 5, 2022
A simple API documentation package for Laravel using OpenAPI and Redoc

Laravel Redoc Easily publish your API documentation using your OpenAPI document in your Laravel Application. Installation You can install this package

Steve McDougall 15 Dec 27, 2022