Пример #1
0
        public async Task SignUp_SessionCrated()
        {
            // Arrange
            await Task.Delay(TimeSpan.FromSeconds(5));

            using IdentityApp app = _testContext.CreateApp <IdentityApp>();
            await app.TestContext.StartMagnetAsync();

            string mobileNr = "+41798074288";
            string email    = $"{Guid.NewGuid().ToString("N").Substring(0, 6)}@magic-media.io";

            // Act
            SignUpPage page = app.Open <SignUpPage>($"{app.TestContext.HostUrl}SignUp");

            page.SignUp(email, mobileNr);

            ValidateMobilePage validatePage = app.WaitForPage <ValidateMobilePage>();

            SmsMessage sms = await app.TestContext.MagnetSession.WaitForSms(mobileNr);

            var code = ParseSecurityCode(sms.Body);

            validatePage.EnterCode(code);

            SignUpCompletedPage completed = app.WaitForPage <SignUpCompletedPage>();

            // Assert
            completed.SuccessAlert.Text.Should().Be("Registration completed");

            SignUpSession session = await GetSessionAsync(email);

            session.State.Should().Be("Completed");
        }