diff options
| author | Clement Michaud <clement.michaud34@gmail.com> | 2019-12-07 17:40:42 +0100 | 
|---|---|---|
| committer | Clément Michaud <clement.michaud34@gmail.com> | 2019-12-08 14:31:48 +0100 | 
| commit | 3d20142292cb9894791b290496b292d760d70f0b (patch) | |
| tree | ef4888583cd0ac65b83f61eedf50567f0423121b /internal/suites/suite_standalone_test.go | |
| parent | 3faa63e8ed0e3467d27a1319accbcaefe75b750d (diff) | |
Allow administrator to provide a Google Analytics tracking ID.
Providing a GA tracking ID allows administrators to analyze
how the portal is used by their users in large environments,
i.e., with many users.
This will make even more sense when we have users and admins
management interfaces.
Diffstat (limited to 'internal/suites/suite_standalone_test.go')
| -rw-r--r-- | internal/suites/suite_standalone_test.go | 31 | 
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/suites/suite_standalone_test.go b/internal/suites/suite_standalone_test.go index 8265844a8..afe08122c 100644 --- a/internal/suites/suite_standalone_test.go +++ b/internal/suites/suite_standalone_test.go @@ -9,6 +9,8 @@ import (  	"testing"  	"time" +	"github.com/clems4ever/authelia/internal/storage" +	"github.com/stretchr/testify/require"  	"github.com/stretchr/testify/suite"  ) @@ -65,6 +67,35 @@ func (s *StandaloneWebDriverSuite) TestShouldLetUserKnowHeIsAlreadyAuthenticated  	s.WaitElementLocatedByClassName(ctx, s.T(), "success-icon")  } +func (s *StandaloneWebDriverSuite) TestShouldCheckUserIsAskedToRegisterDevice() { +	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) +	defer cancel() + +	username := "john" +	password := "password" + +	// Clean up any TOTP secret already in DB +	provider := storage.NewSQLiteProvider("/tmp/authelia/db.sqlite3") +	require.NoError(s.T(), provider.DeleteTOTPSecret(username)) + +	// Login one factor +	s.doLoginOneFactor(ctx, s.T(), username, password, false, "") + +	// Check the user is asked to register a new device +	s.WaitElementLocatedByClassName(ctx, s.T(), "state-not-registered") + +	// Then register the TOTP factor +	s.doRegisterTOTP(ctx, s.T()) +	// And logout +	s.doLogout(ctx, s.T()) + +	// Login one factor again +	s.doLoginOneFactor(ctx, s.T(), username, password, false, "") + +	// now the user should be asked to perform 2FA +	s.WaitElementLocatedByClassName(ctx, s.T(), "state-method") +} +  type StandaloneSuite struct {  	suite.Suite  }  | 
