@zohodesk/testinglibrary 0.4.58-experimental → 0.4.60-n18-experimental
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,22 +33,12 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
|
33
33
|
}
|
|
34
34
|
await (0, _checkAuthCookies.loadCookiesIfPresent)(page, authFile);
|
|
35
35
|
const isAlreadyLoggedIn = await isLoggedIn(testInfo);
|
|
36
|
-
let storage = {};
|
|
37
36
|
if (!isAlreadyLoggedIn) {
|
|
38
37
|
await loginSteps(testInfo);
|
|
39
38
|
await isLoggedIn(testInfo);
|
|
40
39
|
await page.context().storageState({
|
|
41
40
|
path: authFile
|
|
42
41
|
});
|
|
43
|
-
if ((0, _fs.existsSync)(authFile)) {
|
|
44
|
-
const fileContent = await (0, _fs.readFileSync)(authFile, 'utf-8');
|
|
45
|
-
storage = JSON.parse(fileContent);
|
|
46
|
-
}
|
|
47
|
-
const modifiedStorage = {
|
|
48
|
-
...storage,
|
|
49
|
-
domain: page.url()
|
|
50
|
-
};
|
|
51
|
-
(0, _fs.writeFileSync)(authFile, JSON.stringify(modifiedStorage), null, 2);
|
|
52
42
|
}
|
|
53
43
|
} catch (error) {
|
|
54
44
|
console.error(`Error during login for ${email}:`, error);
|
package/build/utils/fileUtils.js
CHANGED