Auto login plugin is not working with Tescafe #3041
              
                Unanswered
              
          
                  
                    
                      sstanchevaxway
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am trying to use Testcafe as an alternative to Webdriver, and to speed up the tests I want to persist the user login session. I tried to use auto login plugin, as I use it successfully with the Webdriver, but in the saved file from the plugin (writeUser_session.json) I only can see the "undefined". I did not find any open issues for this and my expectation is that this is a valid flow. Is there something that I am missing?
Configuration is simple without any customizations.
This is the config file auto login part:
autoLogin: { enabled: true, saveToFile: true, inject: 'loginAs', users: { writeUser: { login: async (I) => { I.amOnPage("https://login url") I.fillField('email', "[email protected]") I.pressKey('Enter') I.fillField('password', '*****') I.pressKey('Enter') }, check: async (I) => { I.amOnPage('/') I.seeCurrentUrlEquals('https://test page url/'); }, fetch: () => {}, // empty function restore: () => {} // empty function } } } }This is the test scenario:
Scenario("test 2", async ({I,loginAs}) => { await loginAs('writeUser') I.amOnPage('/') I.see('find this text') })Beta Was this translation helpful? Give feedback.
All reactions