From ba70ee33b6724a3db7b43172d9783656945fff2b Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 2 Feb 2024 15:42:30 +0700 Subject: [PATCH] Fix login test Signed-off-by: Andrey Sobolev --- README.md | 2 +- dev/tool/src/index.ts | 14 +++----------- scripts/create-workspace.sh | 2 +- tests/prepare.sh | 2 +- tests/sanity/tests/login.spec.ts | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6312cd5c66b..ca374ee650b 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Before you can begin, you need to create a workspace and an account and associat ```bash cd ./tool # dev/tool in the repository root -rushx run-local create-workspace ws1 -o DevWorkspace # Create workspace +rushx run-local create-workspace ws1 -w DevWorkspace # Create workspace rushx run-local create-account user1 -p 1234 -f John -l Appleseed # Create account rushx run-local configure ws1 --list --enable '*' # Enable all modules, even if they are not yet intended to be used by a wide audience. rushx run-local assign-workspace user1 ws1 # Assign workspace to user. diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 103b7400d68..9f15b4aa473 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -206,20 +206,12 @@ export function devTool ( program .command('create-workspace ') .description('create workspace') - .requiredOption('-o, --organization ', 'organization name') + .requiredOption('-w, --workspaceName ', 'Workspace name') + .option('-e, --email ', 'Author email', 'platform@email.com') .action(async (workspace, cmd) => { const { mongodbUri, txes, version, migrateOperations } = prepareTools() await withDatabase(mongodbUri, async (db) => { - await createWorkspace( - version, - txes, - migrateOperations, - db, - productId, - 'platform@email.com', - cmd.organization, - workspace - ) + await createWorkspace(version, txes, migrateOperations, db, productId, cmd.email, cmd.workspaceName, workspace) }) }) diff --git a/scripts/create-workspace.sh b/scripts/create-workspace.sh index 7ceb709c70b..e61d44333ad 100644 --- a/scripts/create-workspace.sh +++ b/scripts/create-workspace.sh @@ -1,5 +1,5 @@ cd ./dev/tool -rushx run-local create-workspace ws1 -o DevWorkspace # Create workspace +rushx run-local create-workspace ws1 -w DevWorkspace # Create workspace rushx run-local create-account user1 -p 1234 -f John -l Appleseed # Create account rushx run-local configure ws1 --list --enable '*' # Enable all modules, even if they are not yet intended to be used by a wide audience. rushx run-local assign-workspace user1 ws1 # Assign workspace to user. diff --git a/tests/prepare.sh b/tests/prepare.sh index eaed0ad4670..2d352c10b86 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -7,7 +7,7 @@ docker compose -p sanity up -d --force-recreate --renew-anon-volumes ./wait-elastic.sh 9201 # Create workspace record in accounts -./tool.sh create-workspace sanity-ws -o SanityTest +./tool.sh create-workspace sanity-ws -w SanityTest # Create user record in accounts ./tool.sh create-account user1 -f John -l Appleseed -p 1234 ./tool.sh create-account user2 -f Kainin -l Dirak -p 1234 diff --git a/tests/sanity/tests/login.spec.ts b/tests/sanity/tests/login.spec.ts index 1131aff8dbe..61f88b6da82 100644 --- a/tests/sanity/tests/login.spec.ts +++ b/tests/sanity/tests/login.spec.ts @@ -17,6 +17,6 @@ test.describe('login test', () => { await loginPage.login(PlatformUser, '1234') const selectWorkspacePage = new SelectWorkspacePage(page) - await selectWorkspacePage.selectWorkspace('sanity-ws') + await selectWorkspacePage.selectWorkspace('SanityTest') }) })