예제 #1
0
        public void GivenNewUser()
        {
            window = BrowserWindow.Launch($"{TestConfig.UrlBase}/DecomposingPageObjects/Change4");

            HtmlCustom nav = new HtmlCustom(window);

            nav.SearchProperties.Add(HtmlControl.PropertyNames.TagName, "nav");

            HtmlButton registerButton = new HtmlButton(nav);

            registerButton.SearchProperties.Add(HtmlButton.PropertyNames.DisplayText, "Register");

            Mouse.Click(registerButton);

            RegistrationControlPageObject registrationControl = new RegistrationControlPageObject(window);

            this.newUsername = Guid.NewGuid().ToString("N");
            this.newPassword = "******";
            registrationControl.SetFormValues(this.newUsername, this.newPassword, this.newPassword);
            registrationControl.ClickRegister();

            HtmlButton ordersButton = new HtmlButton(nav);

            ordersButton.SearchProperties.Add(HtmlButton.PropertyNames.DisplayText, "Orders");

            Mouse.Click(ordersButton);

            this.ordersPageObject = new OrdersPageObject(window);
        }
예제 #2
0
        public void AfterRegisteringNewUser_AccountSettingsIsShown()
        {
            var registerControl = new RegistrationControlPageObject(this.window);

            registerControl.SetFormValues(Guid.NewGuid().ToString("N"), "pass", "pass");

            HtmlDiv accountSettingsDiv = new HtmlDiv(window);

            accountSettingsDiv.SearchProperties.Add(HtmlDiv.PropertyNames.Id, "accountSettingsControl");

            Assert.IsTrue(accountSettingsDiv.Width == 0 && accountSettingsDiv.Height == 0);

            registerControl.ClickRegister();

            Assert.IsFalse(accountSettingsDiv.Width == 0 && accountSettingsDiv.Height == 0);
        }