Ejemplo n.º 1
0
        public async Task NewItemAutoAppearsOnOtherPersonsWishlist()
        {
            var rand           = Guid.NewGuid().ToString();
            var nameOfWishlist = "NewItemAutoAppearsOnOtherPersonsWishlist " + rand;
            await PlaywrightHelpers.CreateWishlist(baseUrl, nameOfWishlist, CreatorId, page);

            var wishlistPage = new WishlistPageObject(page);
            await wishlistPage.AddNewPerson("New", "*****@*****.**");

            var page2 = await browser.NewPageAsync();

            var loginPage2 = new LoginPageObject(page2);
            await page2.GoToAsync(baseUrl);

            await loginPage2.LoginUsingForm("*****@*****.**", "New");

            await page2.GoToAsync(baseUrl);

            await page2.ClickAsync("text=" + nameOfWishlist);

            await page2.WaitForTimeoutAsync(1000);

            await wishlistPage.AddItem("New present idea");

            await page2.ClickAsync("text=New present idea");
        }
Ejemplo n.º 2
0
        public async Task AllowsNewPeopleToBeAdded()
        {
            await PlaywrightHelpers.CreateWishlist(baseUrl, "AllowsNewPeopleToBeAdded", CreatorId, page);

            var wishlistPage = new WishlistPageObject(page);
            await wishlistPage.AddNewPerson("*****@*****.**", "Ed");
        }
Ejemplo n.º 3
0
        public async Task AllowsYouToAddItem()
        {
            await PlaywrightHelpers.CreateWishlist(baseUrl, "AllowsYouToAddItem", CreatorId, page);

            var wishlistPage = new WishlistPageObject(page);
            await wishlistPage.AddNewPerson("Ed", "*****@*****.**");

            await wishlistPage.AddItem("New present idea");
        }
Ejemplo n.º 4
0
        public async Task DoesntAllowDuplicateNamesToBeAdded()
        {
            await PlaywrightHelpers.CreateWishlist(baseUrl, "DoesntAllowDuplicateNamesToBeAdded", CreatorId, page);

            var wishlistPage = new WishlistPageObject(page);
            await wishlistPage.AddNewPerson("Ed", "*****@*****.**");

            await wishlistPage.ClickAddNewPerson();

            await wishlistPage.EnterNameAndEmail("Ed", "*****@*****.**");

            var createNewPersonIsEnabled = await wishlistPage.CreateNewPersonIsEnabled();

            createNewPersonIsEnabled.Should().BeFalse();

            await wishlistPage.EnterNameAndEmail("Ed", "*****@*****.**");

            createNewPersonIsEnabled = await wishlistPage.CreateNewPersonIsEnabled();

            createNewPersonIsEnabled.Should().BeTrue();
        }
Ejemplo n.º 5
0
        public async Task AllowsYouToClaimAndUnclaim()
        {
            var rand           = Guid.NewGuid().ToString();
            var nameOfWishlist = "AllowsYouToClaimAndUnclaim " + rand;
            await PlaywrightHelpers.CreateWishlist(baseUrl, nameOfWishlist, CreatorId, page);

            var wishlistPage = new WishlistPageObject(page);
            await wishlistPage.AddNewPerson("New", "*****@*****.**");

            await wishlistPage.AddItem("New present idea");

            await page.Context.ClearCookiesAsync();

            await page.GoToAsync(baseUrl);

            await loginPage.LoginUsingForm("*****@*****.**", "New");

            await page.GoToAsync(baseUrl);

            await page.ClickAsync("text=" + nameOfWishlist);

            await page.ClickAsync("text=New present idea");
        }