8000 Execute before() or after() without call to capture() · Issue #919 · gemini-testing/gemini · GitHub
[go: up one dir, main page]

Skip to content
7FFF
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Execute before() or after() without call to capture() #919

Open

Description

@wabisabit

Gemini version 5.7.2

I'm using executeJS in order to set a localStorage item for the next suite as explained here: #799

Although it works, in my case, I don't want to capture anything in the first suite, so using before or after instead of capture would make more sense. But without a call to capture the actions are ignored.

gemini.suite( 'Login (capture unwanted)', suite => {

  suite
    .setUrl( 'index.html' )
    .before( function( actions, find ) {

      actions.executeJS( function( window ) {
        window.localStorage.setItem( 'user', 'data' );
      } );

    } );

} );

gemini.suite( 'Logged-in app', suite => {

  suite
    .setUrl( 'index.html' )
    .setCaptureElements( 'html' )

    .capture( 'plain' )
} );

Command used to run the test:

gemini test

Result:
The localStorage item is unavailable in the second suite

Expected behaviour:
The localStorage item is available in the second suite

Activity

  1. FrEaKmAn commented on Apr 1, 2019

    @FrEaKmAn

    I think you need to wrap second suite inside first one as described in Nested tests - https://gemini-testing.github.io/doc/tests.html#nested-suites to be able to access stored localStorage

  2. wabisabit commented on Apr 8, 2019

    @wabisabit
    Author

    Thank you @FrEaKmAn I'll try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      0