-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from jbrunton/improve-e2e-setup
chore: e2e setup script
- Loading branch information
Showing
6 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ | |
}, | ||
{ | ||
"path": "client" | ||
}, | ||
{ | ||
"path": "e2e" | ||
} | ||
], | ||
"settings": {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ | |
"packageManager": "[email protected]", | ||
"scripts": { | ||
"test:e2e": "playwright test", | ||
"test:e2e:ui": "playwright test --ui" | ||
"test:e2e:ui": "playwright test --ui", | ||
"test:e2e:setup": "node scripts/setup-env" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const fs = require("fs"); | ||
|
||
const setupEnvFile = () => { | ||
const user1Password = process.env.AUTH0_TEST_USER1_PASSWORD; | ||
const user2Password = process.env.AUTH0_TEST_USER2_PASSWORD; | ||
|
||
if (!user1Password || !user2Password) { | ||
throw new Error( | ||
"Script requires AUTH0_TEST_USER1_PASSWORD and AUTH0_TEST_USER2_PASSWORD env vars" | ||
); | ||
} | ||
|
||
const content = [ | ||
"[email protected]", | ||
`USER1_PASSWORD=${user1Password}`, | ||
"[email protected]", | ||
`USER2_PASSWORD=${user2Password}`, | ||
"", | ||
].join("\n"); | ||
|
||
fs.writeFileSync(".env", content, { encoding: "utf8" }); | ||
|
||
console.info(".env file created for e2e tests"); | ||
}; | ||
|
||
setupEnvFile(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters