gemini-testing / gemini

💀💀💀[DEPRECATED] Use hermione
https://github.com/gemini-testing/hermione
MIT License
1.5k stars 149 forks source link

How I maintain one session for all gemini suits ? #922

Closed anuraggautam77 closed 6 years ago

anuraggautam77 commented 6 years ago

Hi Team , I am facing issue while run multiple Gemini suits, I want same login session to be maintined for all Gemini Suits, Eg : 1)Suits One (Login functionality) -Login page (set logging credentials ) 2) Suits Two(Dashboard page ) Capture some header/ footer.

Result: For every suit, A new browser session is open. so I am not able to test suit no two without log-in into the application although I am able to log-in the application in suit one but Browser is closed after successful completion of Suit one. Here for every suits browser wants login.

Expected behaviour: Gemini should maintain login session throughout all Suits and browser should not be close in between the Suits

j0tunn commented 6 years ago

All suites in gemini are expected to be independent because in general they are run in parallel. You can obtain the behavior you've described by setting sessionsPerBrowser option to 1 and suitesPerSession to Infinity. But in fact even that will not guarantee that all suites will be run in one session in case of some specific errors. I'd suggest you to make login actions in before hook.

anuraggautam77 commented 6 years ago

@j0tunn Thanks for your suggestion but setting of sessionsPerBrowser to 1 and suitesPerSession to Infinity didn't work for me. Need to write code in every before block to login into the application.

j0tunn commented 6 years ago

Can you show your config file and gemini output with DEBUG=gemini:* env variable?

anuraggautam77 commented 6 years ago

@j0tunn Sorry for the late response `

module.exports = { rootUrl: 'http://localhost',

gridUrl: 'http://localhost:4444/wd/hub',

screenshotsDir: 'frontend/gemini/references/components',

calibrate: false,
tolerance: 50,
httpTimeout: 30000,
sessionRequestTimeout: 30000,
compositeImage: true,
sessionsPerBrowser: 1,
suitesPerSession: 1,
retry: 2,

browsers: {
    'desktop-chrome': {
        //windowSize: '1025x1000',
        desiredCapabilities: {
            browserName: 'chrome'
        }
    },
    'desktop-firefox': {
        windowSize: '1024x1000',
        desiredCapabilities: {
            browserName: 'firefox'
        }
    },
    'desktop-ie': {
        windowSize: '1024x1000',
        desiredCapabilities: {
            browserName: 'internet explorer'

        }
    }
},

sets: {
    local: {
        files: [

        ],
        browsers: ['desktop-chrome']
    }
},

system: {
    parallelLimit: 1,
    plugins: {
        'html-reporter': {
            enabled: true,
            path: 'frontend/gemini/report'
        },

        'teamcity': {
            enabled: true,
            path: 'frontend/gemini/teamcity'
        },

        optipng: {
            level: 5
        }
    }
}

}; `

j0tunn commented 6 years ago

As I've said before you should set:

suitesPerSession: Infinity

Or just remove this option from config, because this is the default value. Take a look at config documentation for more details