Hey there,
I’m trying to implement the autoLogin plugin while using Playwright. It works successfully for my first test and the store_session.json has all the right information, but I get a javascript error inside network.js when it tries to use the saved credentials for the next test.
codecept.conf.js
autoLogin: { enabled: true, saveToFile: true, inject: 'login', users: { store: { login: (I) => I.loginStoreAssociate(), check: async (I) => await I.checkIfLoggedIn(), } } }
}
My before section in my test file:
Before(login => { login('store'); // login using user session });
The error when it starts the second test in the file:
cookies.map is not a function ypeError: cookies.map is not a function at Object.rewriteCookies (node_modules/playwright-core/lib/network.js:44:20) at CRBrowserContext.addCookies (node_modules/playwright-core/lib/chromium/crBrowser.js:296:84) at CRBrowserContext.<anonymous> (node_modules/playwright-core/lib/helper.js:64:31) at Playwright.setCookie (node_modules/codeceptjs/lib/helper/Playwright.js:1406:34) at Step.run (node_modules/codeceptjs/lib/step.js:70:47) at /Users/jxr1831/Documents/GitHub/orderup-sell-testing/node_modules/codeceptjs/lib/actor.js:92:23
Is there some Playwright specific config needed?
“playwright”: “^1.0.2”
“codeceptjs”: “^2.6.5”,
Thank you for the help!