Added console write statements to improve user experience

[Fixes #642] Show test progress when running functional tests
This commit is contained in:
Kiran Challa 2016-04-21 16:19:48 -07:00
Родитель 547d7dc227
Коммит 123cea9da7
5 изменённых файлов: 39 добавлений и 32 удалений

Просмотреть файл

@ -174,6 +174,8 @@ namespace E2ETests
return url.Replace("//", "/").Replace("%2F%2F", "%2F").Replace("%2F/", "%2F");
}
// Making a request to a protected resource that this user does not have access to - should
// automatically redirect to the configured access denied page
public async Task AccessStoreWithoutPermissions(string email = null)
{
_logger.LogInformation("Trying to access StoreManager that needs ManageStore claim with the current user : {email}", email ?? "Anonymous");

Просмотреть файл

@ -69,9 +69,11 @@ namespace E2ETests
"connect to the server after multiple retries");
var validator = new Validator(httpClient, httpClientHandler, _logger, deploymentResult);
Console.WriteLine("Verifying home page");
await validator.VerifyNtlmHomePage(response);
//Should be able to access the store as the Startup adds necessary permissions for the current user
Console.WriteLine("Verifying access to store with permissions");
await validator.AccessStoreWithPermissions();
_logger.LogInformation("Variation completed successfully.");

Просмотреть файл

@ -94,9 +94,11 @@ namespace E2ETests
"connect to the server after multiple retries");
var validator = new Validator(httpClient, httpClientHandler, _logger, deploymentResult);
Console.WriteLine("Verifying home page");
await validator.VerifyHomePage(response);
// OpenIdConnect login.
Console.WriteLine("Verifying login by OpenIdConnect");
await validator.LoginWithOpenIdConnect();
_logger.LogInformation("Variation completed successfully.");

Просмотреть файл

@ -168,9 +168,11 @@ namespace E2ETests
"connect to the server after multiple retries");
var validator = new Validator(httpClient, httpClientHandler, _logger, deploymentResult);
Console.WriteLine("Verifying home page");
await validator.VerifyHomePage(response);
// Static files are served?
Console.WriteLine("Verifying static files are served from static file middleware");
await validator.VerifyStaticContentServed();
if (serverType != ServerType.IISExpress)

Просмотреть файл

@ -32,89 +32,88 @@ namespace E2ETests
var validator = new Validator(httpClient, httpClientHandler, logger, deploymentResult);
Console.WriteLine("Verifying home page");
await validator.VerifyHomePage(response);
// Verify the static file middleware can serve static content.
Console.WriteLine("Verifying static files are served from static file middleware");
await validator.VerifyStaticContentServed();
// Making a request to a protected resource should automatically redirect to login page.
Console.WriteLine("Verifying access to a protected resource should automatically redirect to login page.");
await validator.AccessStoreWithoutPermissions();
// Register a user - Negative scenario where the Password & ConfirmPassword do not match.
Console.WriteLine("Verifying mismatched passwords trigger validaton errors during user registration");
await validator.RegisterUserWithNonMatchingPasswords();
// Register a valid user.
Console.WriteLine("Verifying valid user registration");
var generatedEmail = await validator.RegisterValidUser();
await validator.SignInWithUser(generatedEmail, "Password~1");
// Register a user - Negative scenario : Trying to register a user name that's already registered.
Console.WriteLine("Verifying duplicate user email registration");
await validator.RegisterExistingUser(generatedEmail);
// Logout from this user session - This should take back to the home page
Console.WriteLine("Verifying user logout");
await validator.SignOutUser(generatedEmail);
// Sign in scenarios: Invalid password - Expected an invalid user name password error.
Console.WriteLine("Verifying incorrect password login");
await validator.SignInWithInvalidPassword(generatedEmail, "InvalidPassword~1");
// Sign in scenarios: Valid user name & password.
Console.WriteLine("Verifying valid user log in");
await validator.SignInWithUser(generatedEmail, "Password~1");
// Change password scenario
Console.WriteLine("Verifying change password");
await validator.ChangePassword(generatedEmail);
// SignIn with old password and verify old password is not allowed and new password is allowed
Console.WriteLine("Verifying old password is not valid anymore");
await validator.SignOutUser(generatedEmail);
await validator.SignInWithInvalidPassword(generatedEmail, "Password~1");
await validator.SignInWithUser(generatedEmail, "Password~2");
// Making a request to a protected resource that this user does not have access to - should
// automatically redirect to the configured access denied page
Console.WriteLine("Verifying authenticated user trying to access unauthorized resource");
await validator.AccessStoreWithoutPermissions(generatedEmail);
// Logout from this user session - This should take back to the home page
Console.WriteLine("Verifying user log out");
await validator.SignOutUser(generatedEmail);
// Login as an admin user
Console.WriteLine("Verifying admin user login");
await validator.SignInWithUser("Administrator@test.com", "YouShouldChangeThisPassword1!");
// Now navigating to the store manager should work fine as this user has
// the necessary permission to administer the store.
Console.WriteLine("Verifying admin user's access to store manager page");
await validator.AccessStoreWithPermissions();
// Create an album
Console.WriteLine("Verifying creating a new album");
var albumName = await validator.CreateAlbum();
var albumId = await validator.FetchAlbumIdFromName(albumName);
// Get details of the album
Console.WriteLine("Verifying retrieved album details");
await validator.VerifyAlbumDetails(albumId, albumName);
// Verify status code pages acts on non-existing items.
Console.WriteLine("Verifying status code pages for non-existing items");
await validator.VerifyStatusCodePages();
// Get the non-admin view of the album.
Console.WriteLine("Verying non-admin view of an album");
await validator.GetAlbumDetailsFromStore(albumId, albumName);
// Add an album to cart and checkout the same
Console.WriteLine("Verifying adding album to a cart");
await validator.AddAlbumToCart(albumId, albumName);
Console.WriteLine("Verifying cart checkout");
await validator.CheckOutCartItems();
// Delete the album from store
Console.WriteLine("Verifying deletion of album from a cart");
await validator.DeleteAlbum(albumId, albumName);
// Logout from this user session - This should take back to the home page
Console.WriteLine("Verifying administrator log out");
await validator.SignOutUser("Administrator");
// Google login
Console.WriteLine("Verifying Google login scenarios");
await validator.LoginWithGoogle();
// Facebook login
Console.WriteLine("Verifying Facebook login scenarios");
await validator.LoginWithFacebook();
// Twitter login
Console.WriteLine("Verifying Twitter login scenarios");
await validator.LoginWithTwitter();
// MicrosoftAccountLogin
Console.WriteLine("Verifying Microsft login scenarios");
await validator.LoginWithMicrosoftAccount();
logger.LogInformation("Variation completed successfully.");