<commit_before>Feature: Changing page object namespaces
  In order to organise my code better
  As a Developer
  I need to define namespaces for my page objects

  Scenario: Configuring both element and page namespaces
    Given a behat configuration:
    """
    default:
      suites:
        default:
          contexts: [SearchContext]
      extensions:
        SensioLabs\Behat\PageObjectExtension:
          namespaces:
            page: Acme\Page
            element: Acme\Element
        Behat\MinkExtension:
          goutte: ~
          base_url: http://localhost:8000
    """
    And a context file "features/bootstrap/SearchContext.php" contains:
    """
    <?php

    use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

    class SearchContext extends PageObjectContext
    {
        /**
         * @Given /^I visited the homepage$/
         */
        public function iVisitedTheHomepage()
        {
            $this->getPage('Homepage')->open();
        }

        /**
         * @Then /^I should not see the tabs$/
         */
        public function iShouldSeeTheTabs()
        {
            if ($this->getPage('Homepage')->hasTabs()) {
                throw new \LogicException('Tabs are visible');
            }
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Homepage.php" contains:
    """
    <?php

    namespace Acme\Page;

    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class Homepage extends Page
    {
        /**
         * @var string $path
         */
        protected $path = '/';

        public function hasTabs()
        {
            return $this->hasElement('Search results navigation');
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Element/SearchResultsNavigation.php" contains:
    """
    <?php

    namespace Acme\Element;

    use Behat\Mink\Exception\ElementNotFoundException;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Element;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class SearchResultsNavigation extends Element
    {
        /**
         * @var array $selector
         */
        protected $selector = array('xpath' => '//div[@class="tabs"]');
    }
    """
    And a feature file "features/search.feature" contains:
    """
    Feature: Search
      In order to find lolcats
      As a Cat Lover
      I want to search the internetz

      Scenario: Searching for lolcats
        Given I visited the homepage
        Then I should not see the tabs
    """
    When I run behat
    Then it should pass

  Scenario: Configuring page namespace only
    Given a behat configuration:
    """
    default:
      suites:
        default:
          contexts: [SearchContext]
      extensions:
        SensioLabs\Behat\PageObjectExtension:
          namespaces:
            page: Acme\Page
        Behat\MinkExtension:
          goutte: ~
          base_url: http://localhost:8000
    """
    And a context file "features/bootstrap/SearchContext.php" contains:
    """
    <?php

    use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

    class SearchContext extends PageObjectContext
    {
        /**
         * @Given /^I visited the homepage$/
         */
        public function iVisitedTheHomepage()
        {
            $this->getPage('Homepage')->open();
        }

        /**
         * @Then /^I should not see the tabs$/
         */
        public function iShouldSeeTheTabs()
        {
            if ($this->getPage('Homepage')->hasTabs()) {
                throw new \LogicException('Tabs are visible');
            }
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Homepage.php" contains:
    """
    <?php

    namespace Acme\Page;

    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class Homepage extends Page
    {
        /**
         * @var string $path
         */
        protected $path = '/';

        public function hasTabs()
        {
            return $this->hasElement('Search results navigation');
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Element/SearchResultsNavigation.php" contains:
    """
    <?php

    namespace Acme\Page\Element;

    use Behat\Mink\Exception\ElementNotFoundException;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Element;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class SearchResultsNavigation extends Element
    {
        /**
         * @var array $selector
         */
        protected $selector = array('xpath' => '//div[@class="tabs"]');
    }
    """
    And a feature file "features/search.feature" contains:
    """
    Feature: Search
      In order to find lolcats
      As a Cat Lover
      I want to search the internetz

      Scenario: Searching for lolcats
        Given I visited the homepage
        Then I should not see the tabs
    """
    When I run behat
    Then it should pass<commit_msg>Add an acceptance test for multiple namespace support.<commit_after>Feature: Changing page object namespaces
  In order to organise my code better
  As a Developer
  I need to define namespaces for my page objects

  Scenario: Configuring both element and page namespaces
    Given a behat configuration:
    """
    default:
      suites:
        default:
          contexts: [SearchContext]
      extensions:
        SensioLabs\Behat\PageObjectExtension:
          namespaces:
            page: Acme\Page
            element: Acme\Element
        Behat\MinkExtension:
          goutte: ~
          base_url: http://localhost:8000
    """
    And a context file "features/bootstrap/SearchContext.php" contains:
    """
    <?php

    use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

    class SearchContext extends PageObjectContext
    {
        /**
         * @Given /^I visited the homepage$/
         */
        public function iVisitedTheHomepage()
        {
            $this->getPage('Homepage')->open();
        }

        /**
         * @Then /^I should not see the tabs$/
         */
        public function iShouldSeeTheTabs()
        {
            if ($this->getPage('Homepage')->hasTabs()) {
                throw new \LogicException('Tabs are visible');
            }
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Homepage.php" contains:
    """
    <?php

    namespace Acme\Page;

    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class Homepage extends Page
    {
        /**
         * @var string $path
         */
        protected $path = '/';

        public function hasTabs()
        {
            return $this->hasElement('Search results navigation');
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Element/SearchResultsNavigation.php" contains:
    """
    <?php

    namespace Acme\Element;

    use Behat\Mink\Exception\ElementNotFoundException;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Element;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class SearchResultsNavigation extends Element
    {
        /**
         * @var array $selector
         */
        protected $selector = array('xpath' => '//div[@class="tabs"]');
    }
    """
    And a feature file "features/search.feature" contains:
    """
    Feature: Search
      In order to find lolcats
      As a Cat Lover
      I want to search the internetz

      Scenario: Searching for lolcats
        Given I visited the homepage
        Then I should not see the tabs
    """
    When I run behat
    Then it should pass

  Scenario: Configuring page namespace only
    Given a behat configuration:
    """
    default:
      suites:
        default:
          contexts: [SearchContext]
      extensions:
        SensioLabs\Behat\PageObjectExtension:
          namespaces:
            page: Acme\Page
        Behat\MinkExtension:
          goutte: ~
          base_url: http://localhost:8000
    """
    And a context file "features/bootstrap/SearchContext.php" contains:
    """
    <?php

    use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

    class SearchContext extends PageObjectContext
    {
        /**
         * @Given /^I visited the homepage$/
         */
        public function iVisitedTheHomepage()
        {
            $this->getPage('Homepage')->open();
        }

        /**
         * @Then /^I should not see the tabs$/
         */
        public function iShouldSeeTheTabs()
        {
            if ($this->getPage('Homepage')->hasTabs()) {
                throw new \LogicException('Tabs are visible');
            }
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Homepage.php" contains:
    """
    <?php

    namespace Acme\Page;

    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class Homepage extends Page
    {
        /**
         * @var string $path
         */
        protected $path = '/';

        public function hasTabs()
        {
            return $this->hasElement('Search results navigation');
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Element/SearchResultsNavigation.php" contains:
    """
    <?php

    namespace Acme\Page\Element;

    use Behat\Mink\Exception\ElementNotFoundException;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Element;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class SearchResultsNavigation extends Element
    {
        /**
         * @var array $selector
         */
        protected $selector = array('xpath' => '//div[@class="tabs"]');
    }
    """
    And a feature file "features/search.feature" contains:
    """
    Feature: Search
      In order to find lolcats
      As a Cat Lover
      I want to search the internetz

      Scenario: Searching for lolcats
        Given I visited the homepage
        Then I should not see the tabs
    """
    When I run behat
    Then it should pass

  @wip
  Scenario: Configuring multiple namespaces
    Given a behat configuration:
    """
    default:
      suites:
        default:
          contexts: [SearchContext]
      extensions:
        SensioLabs\Behat\PageObjectExtension:
          namespaces:
            page: [Page, Acme\Page]
            element: [Element, Acme\Element]
        Behat\MinkExtension:
          goutte: ~
          base_url: http://localhost:8000
    """
    And a context file "features/bootstrap/SearchContext.php" contains:
    """
    <?php

    use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;

    class SearchContext extends PageObjectContext
    {
        /**
         * @Given /^I visited the homepage$/
         */
        public function iVisitedTheHomepage()
        {
            $this->getPage('Homepage')->open();
        }

        /**
         * @Then /^I should not see the tabs$/
         */
        public function iShouldSeeTheTabs()
        {
            if ($this->getPage('Homepage')->hasTabs()) {
                throw new \LogicException('Tabs are visible');
            }
        }
    }
    """
    And a page object file "features/bootstrap/Acme/Page/Homepage.php" contains:
    """
    <?php

    namespace Acme\Page;

    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class Homepage extends Page
    {
        /**
         * @var string $path
         */
        protected $path = '/';

        public function hasTabs()
        {
            return $this->hasElement('Search results navigation');
        }
    }
    """
    And a page object file "features/bootstrap/Element/SearchResultsNavigation.php" contains:
    """
    <?php

    namespace Element;

    use Behat\Mink\Exception\ElementNotFoundException;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Element;
    use SensioLabs\Behat\PageObjectExtension\PageObject\Page;

    class SearchResultsNavigation extends Element
    {
        /**
         * @var array $selector
         */
        protected $selector = array('xpath' => '//div[@class="tabs"]');
    }
    """
    And a feature file "features/search.feature" contains:
    """
    Feature: Search
      In order to find lolcats
      As a Cat Lover
      I want to search the internetz

      Scenario: Searching for lolcats
        Given I visited the homepage
        Then I should not see the tabs
    """
    When I run behat
    Then it should pass
{'fraction_non_alphanumeric': 0.09772326438993105, 'fraction_numerical': 0.00160333493666827, 'mean_word_length': 1.9617758784425452, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4816315', 'n_tokens_mistral': 3526, 'n_tokens_neox': 3396, 'n_words': 886}