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

tryTo erring out in version 3.0 #5506

Closed
kingpinzs opened this issue May 15, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@kingpinzs
Copy link

commented May 15, 2019

What are you trying to achieve?

I am trying to get tryTo to work

        if ($I->tryToSeeElement('#userDropDown')) {
            $I->click('#userDropDown');
            $I->click('#logout_link');
        }

What do you get instead?

I get this error

[RuntimeException] Call to undefined method AcceptanceTester::tryToSeeElement 

Provide console output if related. Use -vvv mode for more details.

# paste output here

Provide test source code if related

// paste test

Details

  • Codeception version: 3.0
  • PHP Version: 7.3.2
  • Operating System: mac os Mojava 10.14.4
  • Installation type: Composer
  • List of installed packages (composer show)
    behat/gherkin v4.6.0 Gherkin DSL parser for PHP 5.3
    codeception/codeception 3.0.0 BDD-style testing framework
    codeception/phpunit-wrapper 8.0.4 PHPUnit classes used by Codeception
    codeception/stub 2.1.0 Flexible Stub wrapper for PHPUnit's Mock Builder
    doctrine/instantiator 1.2.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    facebook/webdriver 1.6.0 A PHP client for Selenium WebDriver
    guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
    guzzlehttp/promises v1.3.1 Guzzle promises library
    guzzlehttp/psr7 1.5.2 PSR-7 message implementation that also provides common utility methods
    hoa/consistency 1.17.05.02 The Hoa\Consistency library.
    hoa/console 3.17.05.02 The Hoa\Console library.
    hoa/event 1.17.01.13 The Hoa\Event library.
    hoa/exception 1.17.01.16 The Hoa\Exception library.
    hoa/file 1.17.07.11 The Hoa\File library.
    hoa/iterator 2.17.01.10 The Hoa\Iterator library.
    hoa/protocol 1.17.01.14 The Hoa\Protocol library.
    hoa/stream 1.17.02.21 The Hoa\Stream library.
    hoa/ustring 4.17.01.16 The Hoa\Ustring library.
    myclabs/deep-copy 1.9.1 Create deep copies (clones) of your objects
    phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
    phar-io/version 2.0.1 Library for handling version information and constraints
    phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
    phpdocumentor/reflection-docblock 4.3.1 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
    phpdocumentor/type-resolver 0.4.0
    phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage 7.0.3 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
    phpunit/php-file-iterator 2.0.2 FilterIterator implementation that filters files based on a list of suffixes.
    phpunit/php-text-template 1.2.1 Simple template engine.
    phpunit/php-timer 2.1.1 Utility class for timing
    phpunit/php-token-stream 3.0.1 Wrapper around PHP's tokenizer extension.
    phpunit/phpunit 8.1.5 The PHP Unit Testing framework.
    psr/http-message 1.0.1 Common interface for HTTP messages
    ralouphie/getallheaders 2.0.5 A polyfill for getallheaders.
    sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
    sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
    sebastian/diff 3.0.2 Diff implementation
    sebastian/environment 4.2.2 Provides functionality to handle HHVM/PHP environments
    sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
    sebastian/global-state 3.0.0 Snapshotting of global state
    sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
    sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
    sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
    sebastian/resource-operations 2.0.1 Provides a list of PHP built-in functions that operate on resources
    sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
    symfony/browser-kit v4.2.8 Symfony BrowserKit Component
    symfony/console v4.2.8 Symfony Console Component
    symfony/contracts v1.1.0 A set of abstractions extracted out of the Symfony components
    symfony/css-selector v4.2.8 Symfony CssSelector Component
    symfony/dom-crawler v4.2.8 Symfony DomCrawler Component
    symfony/event-dispatcher v4.2.8 Symfony EventDispatcher Component
    symfony/finder v4.2.8 Symfony Finder Component
    symfony/polyfill-ctype v1.11.0 Symfony polyfill for ctype functions
    symfony/polyfill-mbstring v1.11.0 Symfony polyfill for the Mbstring extension
    symfony/process v4.2.8 Symfony Process Component
    symfony/yaml v4.2.8 Symfony Yaml Component
    theseer/tokenizer 1.1.2 A small library for converting tokenized PHP source code into XML and potentially other formats
    webmozart/assert 1.4.0 Assertions to validate method input/output with nice error messages.
  • Suite configuration:
# paste suite config here
# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
extensions:
    enabled:
      - Codeception\Extension\RunProcess:
          0: java -jar ~/selenium-server-standalone-3.141.59.jar
          1: ~/chromedriver --url-base=/wd/hub
          sleep: 5 # wait 5 seconds for processes to boot
      
actor: AcceptanceTester
modules:
    enabled:
        #- PhpBrowser:
        - WebDriver:  
            url: https://www.upward.net
            port: 9515
            browser: chrome
            capabilities:
                 "goog:chromeOptions": # additional chrome options
        - \Helper\Acceptance
    step_decorators:
        - \Codeception\Step\TryTo
@DavertMik

This comment has been minimized.

Copy link
Member

commented May 20, 2019

Did you try to execute codecept build command?
It should fix it in short term. I will plan to make this work without rebuilding actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.