JBehave
  1. JBehave
  2. JBEHAVE-390

browser not closing when done by @AfterStories

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: web-3.1.1
    • Fix Version/s: web-3.x
    • Component/s: Web Selenium
    • Labels:
      None
    • Number of attachments :
      0

      Description

      PerStoriesWebDriverSteps has a before and after stories. If there's a WebDriver thrown exception (a derivative of RuntimeE), then the @AfterStores annotated method is not called ..... and as such the browser frame is not closed.

        Activity

        Hide
        Paul Hammant added a comment -

        PerStoryWebDriverSteps and PerScenarioWebDriver work correctly ...
        ... the both open and close the browser window in the event of a WD exception causing a failure.

        Show
        Paul Hammant added a comment - PerStoryWebDriverSteps and PerScenarioWebDriver work correctly ... ... the both open and close the browser window in the event of a WD exception causing a failure.
        Hide
        Paul Hammant added a comment -

        To reproduce, go to examples/trader-runner-webdriver change the steps class TraderWebSteps:

        @Given("user is on Home page")
        public void userIsOnHomePage()

        { pages.home().open(); pages.home().open(); + throw new RuntimeException("I cause the @AfterStories method to be bypassed"); }
        Show
        Paul Hammant added a comment - To reproduce, go to examples/trader-runner-webdriver change the steps class TraderWebSteps: @Given("user is on Home page") public void userIsOnHomePage() { pages.home().open(); pages.home().open(); + throw new RuntimeException("I cause the @AfterStories method to be bypassed"); }
        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s web-3.x [ 17273 ]
        Hide
        Ivan Vanyushkin added a comment - - edited

        I have this issue with runner:

        maven-surefire-plugin => JUnitStories.run() => embedder.runStoriesAsPaths()
        

        I also have this issue with assertion exceptions: java.lang.AssertionError.

        I don't have this issue with runner:

        jbehave-maven-plugin:run-stories-as-embeddables
        

        with same code.

        Maybe related issue: JBEHAVE-465.

        Show
        Ivan Vanyushkin added a comment - - edited I have this issue with runner: maven-surefire-plugin => JUnitStories.run() => embedder.runStoriesAsPaths() I also have this issue with assertion exceptions: java.lang.AssertionError . I don't have this issue with runner: jbehave-maven-plugin:run-stories-as-embeddables with same code. Maybe related issue: JBEHAVE-465 .

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Hammant
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: