mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
refactor: Update login test to handle missing user credentials
The login test in Login.spec.ts has been updated to handle cases where the user credentials (email and password) are missing. Previously, the test would only check if the user is registered, but now it also checks if the registered user email and password are available. This change ensures that the test behaves correctly in all scenarios and improves the reliability of the login functionality.
This commit is contained in:
parent
3e2e581e52
commit
4fa9adfc7d
@ -9,7 +9,7 @@ import URL from 'Common/Types/API/URL';
|
||||
|
||||
test.describe('Login', () => {
|
||||
test('should be able to login', async ({ page }: { page: Page }) => {
|
||||
if (!IS_USER_REGISTERED) {
|
||||
if (!IS_USER_REGISTERED || !REGISTERED_USER_EMAIL || !REGISTERED_USER_PASSWORD) {
|
||||
// pass this test if the user is not registered
|
||||
return;
|
||||
}
|
||||
|
8
E2E/package-lock.json
generated
8
E2E/package-lock.json
generated
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@oneuptime/tests",
|
||||
"name": "@oneuptime/e2e",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@oneuptime/tests",
|
||||
"name": "@oneuptime/e2e",
|
||||
"version": "1.0.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
@ -26,12 +26,12 @@
|
||||
"dependencies": {
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"axios": "^1.6.8",
|
||||
"axios": "^1.7.2",
|
||||
"crypto-js": "^4.1.1",
|
||||
"json5": "^2.2.3",
|
||||
"moment": "^2.30.1",
|
||||
"moment-timezone": "^0.5.45",
|
||||
"posthog-js": "^1.116.6",
|
||||
"posthog-js": "^1.133.0",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"slugify": "^1.6.5",
|
||||
"typeorm": "^0.3.20",
|
||||
|
@ -8,7 +8,8 @@
|
||||
"test": "playwright test || (curl $E2E_TESTS_FAILED_WEBHOOK_URL && exit 1)",
|
||||
"dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true",
|
||||
"clear-modules": "rm -rf node_modules && rm package-lock.json && npm install",
|
||||
"compile": "tsc"
|
||||
"compile": "tsc",
|
||||
"debug-tests": "playwright test --debug"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "OneUptime <hello@oneuptime.com> (https://oneuptime.com/)",
|
||||
|
@ -200,7 +200,7 @@ LOG_LEVEL=ERROR
|
||||
|
||||
# Thse env vars are for E2E tests
|
||||
E2E_TEST_IS_USER_REGISTERED=false
|
||||
E2E_TEST_REGISERED_USER_EMAIL=
|
||||
E2E_TEST_REGISTERED_USER_EMAIL=
|
||||
E2E_TEST_REGISTERED_USER_PASSWORD=
|
||||
# If you want to run the E2E tests on a status page, then you need to fill in the URL.
|
||||
E2E_TEST_STATUS_PAGE_URL=
|
||||
|
@ -354,7 +354,7 @@ services:
|
||||
environment:
|
||||
<<: *common-variables
|
||||
E2E_TEST_IS_USER_REGISTERED: ${E2E_TEST_IS_USER_REGISTERED}
|
||||
E2E_TEST_REGISERED_USER_EMAIL: ${E2E_TEST_REGISERED_USER_EMAIL}
|
||||
E2E_TEST_REGISTERED_USER_EMAIL: ${E2E_TEST_REGISTERED_USER_EMAIL}
|
||||
E2E_TEST_REGISTERED_USER_PASSWORD: ${E2E_TEST_REGISTERED_USER_PASSWORD}
|
||||
E2E_TEST_STATUS_PAGE_URL: ${E2E_TEST_STATUS_PAGE_URL}
|
||||
E2E_TESTS_FAILED_WEBHOOK_URL: ${E2E_TESTS_FAILED_WEBHOOK_URL}
|
||||
|
Loading…
Reference in New Issue
Block a user