test: added scripting for user login

This commit is contained in:
Sheen Capadngan
2024-05-01 01:45:24 +08:00
parent 531fa634a2
commit 85f024c814
6 changed files with 91 additions and 3 deletions

View File

@@ -90,6 +90,8 @@ func TestUniversalAuth_SecretsGetWrongEnvironment(t *testing.T) {
func TestUserAuth_SecretsGetAll(t *testing.T) {
SetupCli(t)
UserLoginCmd(t);
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--include-imports=false", "--silent")
if err != nil {
t.Fatalf("error running CLI command: %v", err)
@@ -100,11 +102,12 @@ func TestUserAuth_SecretsGetAll(t *testing.T) {
if err != nil {
t.Fatalf("snapshot failed: %v", err)
}
// intentionally invoked this here because it should directly follow secretsGetAll
testUserAuth_SecretsGetAllWithoutConnection(t)
}
func TestUserAuth_SecretsGetAllWithoutConnection(t *testing.T) {
SetupCli(t)
func testUserAuth_SecretsGetAllWithoutConnection(t *testing.T) {
originalConfigFile, err := util.GetConfigFile()
if err != nil {
t.Fatalf("error getting config file")