Skip to content

Taking screenshot fails if name of the test contains "/" character (using pytest-bdd) #64

@kliput

Description

@kliput

Hello,

I'm using:

platform linux2 -- Python 2.7.6, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
plugins: bdd-2.16.1, splinter-1.7.3

My .feature file contains:

Scenario Outline: Application login page renders with proper title
  Given I'm visiting Application site
  When I go to the <page> page
  Then The page title should contain <title>

  Examples:
  | page        | title |
  | home/login  | login |
  | a           | b     |

I'm creating test cases with pytest_bdd:

scenarios('../features')

When test fails, it fails to take a screenshot, because generated test name contains / character:

WSPL504 None Could not save screenshot: [Errno 2] No such file or directory: '/home/kliput/Application/selenium-experiments/python/scenarios.test_lol/test_application_login_page_renders_with_proper_title[home/login-login]-browser.html'

The workaround is to use other chars and replace them with / inside tests, but it will be nice to escape / when creating path for screenshot file :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions