Documentation bug in WebDriver $I->attachFile() example #3906

Open
still-dreaming-1 opened this Issue Jan 10, 2017 · 1 comment

Projects

None yet

2 participants

@still-dreaming-1

What are you trying to achieve?

The sample code at https://github.com/Codeception/Codeception/blob/master/docs/modules/WebDriver.md#attachfile should pass a lint via php -l filename.php with no errors.

What do you get instead?

Parse error: syntax error, unexpected end of file, expecting '`' in filename.php on line 5

Provide test source code if related
Here is the code from the documentation:

<?php
// file is stored in 'tests/_data/prices.xls'
$I->attachFile('input[ * `type="file"]',`  'prices.xls');
?>

Details

  • Codeception version: master branch
  • PHP Version: 5.5.9
  • Operating System: Linux Mint 17.3 64 bit Cinnamon edition
  • Installation type: Phar
  • List of installed packages (composer show)

jakoch/phantomjs-installer 2.1.1 A Composer package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project.
jonnyw/php-phantomjs v4.5.1 A PHP wrapper for loading pages through PhantomJS
simpletest/simpletest v1.1.7 Unit testing, mock objects and web testing framework for PHP built around test cases.
symfony/config v3.1.5 Symfony Config Component
symfony/dependency-injection v3.1.5 Symfony DependencyInjection Component
symfony/filesystem v3.1.5 Symfony Filesystem Component
symfony/yaml v3.1.5 Symfony Yaml Component
twig/twig v1.27.0 Twig, the flexible, fast, and secure template language for PHP

  • Suite configuration:
# 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.

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: http://localhost:8000
            browser: phantomjs
        - \Helper\Acceptance
@Naktibalda
Contributor

It is a bug of documentation generator which masks email addresses.
Example is correct in the source

$I->attachFile('input[@type="file"]', 'prices.xls');
@Naktibalda Naktibalda added the Docs label Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment